OGS
GetFluidDensityAndViscosity.cpp
Go to the documentation of this file.
1
13
17
18namespace MaterialPropertyLib
19{
20
21double getFluidDensity(double const t, double const dt,
23 Phase const& fluid_phase, VariableArray& vars)
24{
25 // Compute density:
26 // Quick workaround: If fluid density is described as ideal gas, then
27 // the molar mass must be passed to the MPL::IdealGasLaw via the
28 // variable_array and the fluid must have the property
29 // MPL::PropertyType::molar_mass. For other density models (e.g.
30 // Constant), it is not mandatory to specify the molar mass.
32 {
33 vars.molar_mass =
35 .template value<double>(vars, pos, t, dt);
36 }
37
39 .template value<double>(vars, pos, t, dt);
40}
41
42std::tuple<double, double> getFluidDensityAndViscosity(
43 double const t, double const dt, ParameterLib::SpatialPosition const& pos,
44 MaterialPropertyLib::Phase const& fluid_phase,
46{
47 auto const fluid_density = getFluidDensity(t, dt, pos, fluid_phase, vars);
48
49 assert(fluid_density > 0.);
50 vars.density = fluid_density;
51
52 auto const viscosity =
54 .template value<double>(vars, pos, t, dt);
55
56 return {fluid_density, viscosity};
57}
58
59} // namespace MaterialPropertyLib
Property const & property(PropertyType const &p) const
Definition Phase.cpp:53
bool hasProperty(PropertyType const &p) const
Definition Phase.cpp:69
std::tuple< double, double > getFluidDensityAndViscosity(double const t, double const dt, ParameterLib::SpatialPosition const &pos, MaterialPropertyLib::Phase const &fluid_phase, MaterialPropertyLib::VariableArray &vars)
It computes fluid density and viscosity for single phase flow model.
double getFluidDensity(double const t, double const dt, ParameterLib::SpatialPosition const &pos, Phase const &fluid_phase, VariableArray &vars)
It computes fluid density for single phase flow model.