Skip to content

Commit

Permalink
Merge branch 'rename_phase_pressure' into 'master'
Browse files Browse the repository at this point in the history
[MPL/PL] unify phase_pressure -> gas_phase_pressure / liquid_phase_pressure

See merge request ogs/ogs!4808
  • Loading branch information
endJunction committed Dec 3, 2023
2 parents 5c0150e + 47c849c commit e8c9da8
Show file tree
Hide file tree
Showing 143 changed files with 388 additions and 296 deletions.
2 changes: 1 addition & 1 deletion MaterialLib/MPL/Properties/AverageMolarMass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PropertyDataType AverageMolarMass::dValue(
ParameterLib::SpatialPosition const& pos, double const t,
double const dt) const
{
if ((variable != Variable::phase_pressure) &&
if ((variable != Variable::gas_phase_pressure) &&
(variable != Variable::temperature))
{
OGS_FATAL(
Expand Down
2 changes: 1 addition & 1 deletion MaterialLib/MPL/Properties/ClausiusClapeyron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ PropertyDataType ClausiusClapeyron::dValue(
{
return 0.;
}
if (variable == Variable::phase_pressure)
if (variable == Variable::gas_phase_pressure)
{
return 0.;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PropertyDataType WaterDensityIAPWSIF97Region1::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = std::max(0.0, variable_array.phase_pressure);
double const p = std::max(0.0, variable_array.liquid_phase_pressure);
double const T = variable_array.temperature;
const double tau = ref_T_ / T;
const double pi = p / ref_p_;
Expand All @@ -41,7 +41,7 @@ PropertyDataType WaterDensityIAPWSIF97Region1::dValue(
double const /*dt*/) const
{
const double T = variable_array.temperature;
double const p = std::max(0.0, variable_array.phase_pressure);
double const p = std::max(0.0, variable_array.liquid_phase_pressure);

const double tau = ref_T_ / T;
const double pi = p / ref_p_;
Expand All @@ -58,7 +58,7 @@ PropertyDataType WaterDensityIAPWSIF97Region1::dValue(
(MaterialLib::PhysicalConstant::SpecificGasConstant::
WaterVapour *
T * T * dgamma_dpi);
case Variable::phase_pressure:
case Variable::liquid_phase_pressure:
return -gibbs_free_energy_.get_dgamma_dpi_dpi(tau, pi) /
(MaterialLib::PhysicalConstant::SpecificGasConstant::
WaterVapour *
Expand All @@ -67,7 +67,7 @@ PropertyDataType WaterDensityIAPWSIF97Region1::dValue(
OGS_FATAL(
"WaterDensityIAPWSIF97Region1::dValue is implemented for "
"derivatives with "
"respect to temperature or phase_pressure only.");
"respect to temperature or liquid_phase_pressure only.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PropertyDataType WaterLiquidDensityIAPWSIF97Region4::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;

/// According to the IAPWS-IF97:
/// http://www.iapws.org/relguide/IF97-Rev.pdf,
Expand Down
8 changes: 4 additions & 4 deletions MaterialLib/MPL/Properties/Density/WaterVapourDensity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PropertyDataType WaterVapourDensity::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;
double const T = variable_array.temperature;
double const water_density = variable_array.density;

Expand All @@ -56,7 +56,7 @@ PropertyDataType WaterVapourDensity::dValue(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;
double const T = variable_array.temperature;
double const water_density = variable_array.density;

Expand All @@ -72,7 +72,7 @@ PropertyDataType WaterVapourDensity::dValue(
SpecificGasConstant::WaterVapour);
}

if (variable == Variable::phase_pressure)
if (variable == Variable::liquid_phase_pressure)
{
double const factor =
1.0 /
Expand All @@ -85,7 +85,7 @@ PropertyDataType WaterVapourDensity::dValue(

OGS_FATAL(
"WaterVapourDensity::dValue is implemented for derivatives with "
"respect to temperature or phase_pressure only.");
"respect to temperature or liquid_phase_pressure only.");
}

} // namespace MaterialPropertyLib
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ PropertyDataType WaterVapourDensityIAPWSIF97Region4::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;

/// According to the IAPWS-IF97:
/// http://www.iapws.org/relguide/IF97-Rev.pdf,
Expand Down
2 changes: 1 addition & 1 deletion MaterialLib/MPL/Properties/DupuitPermeability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PropertyDataType DupuitPermeability::value(
ParameterLib::SpatialPosition const& pos, double const t,
double const /*dt*/) const
{
double const pressure = variable_array.phase_pressure;
double const pressure = variable_array.liquid_phase_pressure;
auto const& permeability_values = parameter_(t, pos);

auto const& permeability_variant = fromVector(permeability_values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ PropertyDataType WaterEnthalpyIAPWSIF97Region1::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = std::max(0.0, variable_array.phase_pressure);
double const p = std::max(0.0, variable_array.liquid_phase_pressure);
double const T = variable_array.temperature;

double const tau = ref_T_ / T;
Expand All @@ -47,7 +47,7 @@ PropertyDataType WaterEnthalpyIAPWSIF97Region1::dValue(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = std::max(0.0, variable_array.phase_pressure);
double const p = std::max(0.0, variable_array.liquid_phase_pressure);
double const T = variable_array.temperature;

double const tau = ref_T_ / T;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PropertyDataType WaterLiquidEnthalpyIAPWSIF97Region4::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;

/// According to the IAPWS-IF97:
/// http://www.iapws.org/relguide/IF97-Rev.pdf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ PropertyDataType WaterVapourEnthalpyIAPWSIF97Region4::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;

/// According to the IAPWS-IF97:
/// http://www.iapws.org/relguide/IF97-Rev.pdf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ PropertyDataType GasPressureDependentPermeability<DisplacementDim>::value(
ParameterLib::SpatialPosition const& pos, double const t,
double const /*dt*/) const
{
double const gas_pressure = variable_array.phase_pressure;
double const gas_pressure = variable_array.gas_phase_pressure;

auto k_data = k0_(t, pos);

Expand Down
16 changes: 8 additions & 8 deletions MaterialLib/MPL/Properties/IdealGasLaw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PropertyDataType IdealGasLaw::value(
double const /*dt*/) const
{
const double gas_constant = MaterialLib::PhysicalConstant::IdealGasConstant;
const double pressure = variable_array.phase_pressure;
const double pressure = variable_array.gas_phase_pressure;
const double temperature = variable_array.temperature;
const double molar_mass = variable_array.molar_mass;

Expand All @@ -44,7 +44,7 @@ PropertyDataType IdealGasLaw::dValue(
double const /*dt*/) const
{
const double gas_constant = MaterialLib::PhysicalConstant::IdealGasConstant;
const double pressure = variable_array.phase_pressure;
const double pressure = variable_array.gas_phase_pressure;
const double temperature = variable_array.temperature;
const double molar_mass = variable_array.molar_mass;
// todo: add molar mass derivatives
Expand All @@ -56,7 +56,7 @@ PropertyDataType IdealGasLaw::dValue(
temperature;
}

if (variable == Variable::phase_pressure)
if (variable == Variable::gas_phase_pressure)
{
// extend to take pressure-dependent molar mass into account
return molar_mass / gas_constant / temperature;
Expand All @@ -75,13 +75,13 @@ PropertyDataType IdealGasLaw::d2Value(
double const /*t*/, double const /*dt*/) const
{
const double gas_constant = MaterialLib::PhysicalConstant::IdealGasConstant;
const double pressure = variable_array.phase_pressure;
const double pressure = variable_array.gas_phase_pressure;
const double temperature = variable_array.temperature;
const double molar_mass = variable_array.molar_mass;
// todo: add molar mass derivatives

if ((variable1 == Variable::phase_pressure) &&
(variable2 == Variable::phase_pressure))
if ((variable1 == Variable::gas_phase_pressure) &&
(variable2 == Variable::gas_phase_pressure))
{
// d2rho_dp2
// extend to take pressure-dependent molar mass into account
Expand All @@ -95,10 +95,10 @@ PropertyDataType IdealGasLaw::d2Value(
return 2. * molar_mass * pressure / gas_constant / temperature /
temperature / temperature;
}
if (((variable1 == Variable::phase_pressure) &&
if (((variable1 == Variable::gas_phase_pressure) &&
(variable2 == Variable::temperature)) ||
((variable1 == Variable::temperature) &&
(variable2 == Variable::phase_pressure)))
(variable2 == Variable::gas_phase_pressure)))
{
// d2rho_dpdT or d2rho_dTdp
// extend to take pressure-temperature-dependent molar mass into account
Expand Down
6 changes: 3 additions & 3 deletions MaterialLib/MPL/Properties/IdealGasLawBinaryMixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PropertyDataType IdealGasLawBinaryMixture::value(
double const /*dt*/) const
{
const double R = MaterialLib::PhysicalConstant::IdealGasConstant;
const double pGR = variable_array.phase_pressure;
const double pGR = variable_array.gas_phase_pressure;
const double T = variable_array.temperature;
const double MG = variable_array.molar_mass;

Expand All @@ -41,14 +41,14 @@ PropertyDataType IdealGasLawBinaryMixture::dValue(
double const /*dt*/) const
{
const double R = MaterialLib::PhysicalConstant::IdealGasConstant;
const double pGR = variable_array.phase_pressure;
const double pGR = variable_array.gas_phase_pressure;
const double T = variable_array.temperature;
const double MG = variable_array.molar_mass;
const double dMG_dx = variable_array.molar_mass_derivative;

switch (variable)
{
case Variable::phase_pressure:
case Variable::gas_phase_pressure:
return MG / R / T + pGR / R / T * dMG_dx;
case Variable::capillary_pressure:
return pGR / R / T * dMG_dx;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ PropertyDataType WaterSaturationTemperatureIAPWSIF97Region4::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = variable_array.phase_pressure;
double const p = variable_array.liquid_phase_pressure;

/// According to the IAPWS-IF97:
/// http://www.iapws.org/relguide/IF97-Rev.pdf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PropertyDataType WaterTemperatureIAPWSIF97Region1::value(
ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
double const /*dt*/) const
{
double const p = std::max(0.0, variable_array.phase_pressure);
double const p = std::max(0.0, variable_array.liquid_phase_pressure);
double const h = variable_array.enthalpy;

static constexpr double ref_h_ = 2500e3; ///< reference enthalpy in J/kg.
Expand Down
10 changes: 5 additions & 5 deletions MaterialLib/MPL/VariableType.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum class Variable : int
molar_mass,
molar_mass_derivative,
molar_fraction,
phase_pressure,
gas_phase_pressure,
porosity,
solid_grain_pressure,
stress,
Expand Down Expand Up @@ -72,7 +72,7 @@ static const std::array<std::string,
"molar_mass",
"molar_mass_derivative",
"molar_fraction",
"phase_pressure",
"gas_phase_pressure",
"porosity",
"solid_grain_pressure",
"stress",
Expand Down Expand Up @@ -132,8 +132,8 @@ class VariableArray
return molar_mass_derivative;
case Variable::molar_fraction:
return molar_fraction;
case Variable::phase_pressure:
return phase_pressure;
case Variable::gas_phase_pressure:
return gas_phase_pressure;
case Variable::porosity:
return porosity;
case Variable::solid_grain_pressure:
Expand Down Expand Up @@ -183,7 +183,7 @@ class VariableArray
double molar_mass = nan_;
double molar_mass_derivative = nan_;
double molar_fraction = nan_;
double phase_pressure = nan_;
double gas_phase_pressure = nan_;
double porosity = nan_;
double solid_grain_pressure = nan_;
std::variant<std::monostate,
Expand Down
Loading

0 comments on commit e8c9da8

Please sign in to comment.