Theseus
Compressible flow solver
Loading...
Searching...
No Matches
Transport.hpp
Go to the documentation of this file.
1// Copyright (c) 2025-2026 Board of Trustees of the University of Illinois
2//
3// This file is part of Theseus.
4//
5// SPDX-License-Identifier: BSD-3-Clause
6#pragma once
7
8#include <cmath>
9#include "Physics.hpp"
10#include "GasState.hpp"
11
12namespace Theseus
13{
14
15 // ============================================================================
16 // Transport: Simple transport, also support Sutherland model (for now)
17 // ============================================================================
18
19 struct Transport
20 {
21
22 template<typename EOSType, typename StateViewType>
23 MFEM_HOST_DEVICE
24 inline mfem::real_t viscosity(const PhysicsConstants &phys, const StateLayout &L,
25 const EOSType &eos, const StateViewType &S) const
26 {
27#ifdef SUTHERLAND
28 // mu0 * T0pTs / (T + Ts) * (T / T0) * std::sqrt(T / T0);
29 const mfem::real_t temptr = eos.temperature(phys, L, S);
30 const mfem::real_t Trel = temptr / phys.T0;
31 const mfem::real_t T0pTs = phys.T0 + phys.Ts;
32 return phys.mu0 * T0pTs * Trel * std::sqrt(Trel) / (temptr + phys.Ts);
33#else
34 return phys.mu;
35#endif
36 }
37
38 template<typename EOSType, typename StateViewType>
39 MFEM_HOST_DEVICE
40 inline mfem::real_t bulk_viscosity(const PhysicsConstants &phys, const StateLayout &L,
41 const EOSType &eos, const StateViewType &S) const
42 {
43 return phys.mu_bulk;
44 }
45
46 // Thermal cond kappa = mu * cp / Pr
47 template<typename EOSType, typename StateViewType>
48 MFEM_HOST_DEVICE
49 inline mfem::real_t thermal_conductivity(const PhysicsConstants &phys, const StateLayout &L,
50 const EOSType &eos, const StateViewType &S) const
51 {
52 return viscosity(phys, L, eos, S) * eos.cp(phys, L, S) * phys.PrInverse;
53 }
54 };
55 // TODO: Consider refactoring; would be better (explicit) design
56 // struct SutherlandTransport {***} using phys.mu0, phys.T0, phys.Ts, etc.
57}
Definition AxisymmetricGeometry.hpp:15
Definition Physics.hpp:14
mfem::real_t mu
Definition Physics.hpp:28
mfem::real_t mu0
Definition Physics.hpp:40
mfem::real_t Ts
Definition Physics.hpp:42
mfem::real_t T0
Definition Physics.hpp:41
mfem::real_t PrInverse
Definition Physics.hpp:25
mfem::real_t mu_bulk
Definition Physics.hpp:39
Definition GasState.hpp:37
Definition Transport.hpp:20
MFEM_HOST_DEVICE mfem::real_t viscosity(const PhysicsConstants &phys, const StateLayout &L, const EOSType &eos, const StateViewType &S) const
Definition Transport.hpp:24
MFEM_HOST_DEVICE mfem::real_t bulk_viscosity(const PhysicsConstants &phys, const StateLayout &L, const EOSType &eos, const StateViewType &S) const
Definition Transport.hpp:40
MFEM_HOST_DEVICE mfem::real_t thermal_conductivity(const PhysicsConstants &phys, const StateLayout &L, const EOSType &eos, const StateViewType &S) const
Definition Transport.hpp:49