OGS
LiquidFlowLocalAssembler.cpp
Go to the documentation of this file.
1
13
14namespace ProcessLib
15{
16namespace LiquidFlow
17{
18std::tuple<double, double> getFluidDensityAndViscosity(
19 double const t, double const dt, ParameterLib::SpatialPosition const& pos,
20 MaterialPropertyLib::Phase const& fluid_phase,
22{
23 // Compute density:
24 // Quick workaround: If fluid density is described as ideal gas, then
25 // the molar mass must be passed to the MPL::IdealGasLaw via the
26 // variable_array and the fluid must have the property
27 // MPL::PropertyType::molar_mass. For other density models (e.g.
28 // Constant), it is not mandatory to specify the molar mass.
30 {
31 vars.molar_mass =
33 .template value<double>(vars, pos, t, dt);
34 }
35
36 auto const fluid_density =
38 .template value<double>(vars, pos, t, dt);
39 assert(fluid_density > 0.);
40 vars.density = fluid_density;
41
42 auto const viscosity =
44 .template value<double>(vars, pos, t, dt);
45
46 return {fluid_density, viscosity};
47}
48} // namespace LiquidFlow
49} // namespace ProcessLib
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)