Skip to content

Commit

Permalink
Allow user to set gamma and R in DryAir::GasMixture
Browse files Browse the repository at this point in the history
  • Loading branch information
trevilo committed May 15, 2023
1 parent 552c9ad commit 39f907a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/M2ulPhyS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2345,6 +2345,8 @@ void M2ulPhyS::parseFluidPreset() {
tpsP->getInput("flow/fluid", fluidTypeStr, std::string("dry_air"));
if (fluidTypeStr == "dry_air") {
config.workFluid = DRY_AIR;
tpsP->getInput("flow/specific_heat_ratio", config.dryAirInput.specific_heat_ratio, 1.4);
tpsP->getInput("flow/gas_constant", config.dryAirInput.gas_constant, 287.058);
} else if (fluidTypeStr == "user_defined") {
config.workFluid = USER_DEFINED;
} else if (fluidTypeStr == "lte_table") {
Expand Down
3 changes: 3 additions & 0 deletions src/dataStructures.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,9 @@ struct DryAirInput {
double bulk_visc_mult;
#else
#endif

double specific_heat_ratio;
double gas_constant;
};

struct PerfectMixtureInput {
Expand Down
8 changes: 4 additions & 4 deletions src/equation_of_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ DryAir::DryAir(RunConfiguration &_runfile, int _dim, int nvel)
// : DryAir(_runfile.workFluid, _runfile.GetEquationSystem(), _runfile.visc_mult, _runfile.bulk_visc, _dim, nvel) {}
: DryAir(_runfile.dryAirInput, _dim, nvel) {}

MFEM_HOST_DEVICE DryAir::DryAir(const DryAirInput inputs, int _dim, int nvel) : GasMixture(inputs.f, _dim, nvel) {
MFEM_HOST_DEVICE DryAir::DryAir(const DryAirInput inputs, int _dim, int nvel)
: GasMixture(inputs.f, _dim, nvel),
specific_heat_ratio(inputs.specific_heat_ratio),
gas_constant(inputs.gas_constant) {
numSpecies = (inputs.eq_sys == NS_PASSIVE) ? 2 : 1;
ambipolar = false;
twoTemperature_ = false;
Expand All @@ -139,9 +142,6 @@ MFEM_HOST_DEVICE DryAir::DryAir(const DryAirInput inputs, int _dim, int nvel) :
assert(numSpecies <= gpudata::MAXSPECIES);
#endif

gas_constant = 287.058;
specific_heat_ratio = 1.4;

// TODO(kevin): replace Nconservative/Nprimitive.
// add extra equation for passive scalar
if (inputs.eq_sys == Equations::NS_PASSIVE) {
Expand Down

0 comments on commit 39f907a

Please sign in to comment.