OGS
ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionModel< DisplacementDim > Struct Template Reference

Detailed Description

template<int DisplacementDim>
struct ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionModel< DisplacementDim >

Definition at line 37 of file TRMVaporDiffusion.h.

#include <TRMVaporDiffusion.h>

Public Member Functions

void eval (SpaceTimeData const &x_t, MediaData const &media_data, LiquidDensityData const &rho_L_data, SaturationData const &S_L_data, SaturationDataDeriv const &dS_L_data, PorosityData const &poro_data, CapillaryPressureData< DisplacementDim > const &p_cap_data, TemperatureData< DisplacementDim > const &T_data, TRMVaporDiffusionData< DisplacementDim > &out) const
 

Member Function Documentation

◆ eval()

template<int DisplacementDim>
void ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionModel< DisplacementDim >::eval ( SpaceTimeData const & x_t,
MediaData const & media_data,
LiquidDensityData const & rho_L_data,
SaturationData const & S_L_data,
SaturationDataDeriv const & dS_L_data,
PorosityData const & poro_data,
CapillaryPressureData< DisplacementDim > const & p_cap_data,
TemperatureData< DisplacementDim > const & T_data,
TRMVaporDiffusionData< DisplacementDim > & out ) const

Definition at line 32 of file TRMVaporDiffusion.cpp.

39{
40 namespace MPL = MaterialPropertyLib;
41 MPL::VariableArray variables;
42 variables.temperature = T_data.T;
43 variables.liquid_phase_pressure = -p_cap_data.p_cap;
44 // setting pG to 1 atm
45 // TODO : rewrite equations s.t. p_L = pG-p_cap
46 variables.gas_phase_pressure = 1.0e5;
47 variables.density = rho_L_data.rho_LR;
48 variables.liquid_saturation = S_L_data.S_L;
49
50 auto const& medium = media_data.medium;
51
52 MPL::Phase const* gas_phase =
53 medium.hasPhase("Gas") ? &medium.phase("Gas") : nullptr;
54
55 out.setZero();
56
57 if (gas_phase && S_L_data.S_L < 1.0)
58 {
59 double const rho_wv =
61 .template value<double>(variables, x_t.x, x_t.t, x_t.dt);
62
63 double const drho_wv_dT =
65 .template dValue<double>(variables, MPL::Variable::temperature,
66 x_t.x, x_t.t, x_t.dt);
67 double const drho_wv_dp =
69 .template dValue<double>(variables,
70 MPL::Variable::liquid_phase_pressure,
71 x_t.x, x_t.t, x_t.dt);
72 auto const f_Tv =
73 gas_phase
74 ->property(
75 MPL::PropertyType::thermal_diffusion_enhancement_factor)
76 .template value<double>(variables, x_t.x, x_t.t, x_t.dt);
77
78 double const phi = poro_data.phi;
79 variables.porosity = phi;
80
81 double const S_g = 1.0 - S_L_data.S_L;
82 double const tortuosity =
83 medium.property(MPL::PropertyType::tortuosity)
84 .template value<double>(variables, x_t.x, x_t.t, x_t.dt);
85 double const D_v =
86 phi * S_g * tortuosity *
87 gas_phase->property(MPL::PropertyType::diffusion)
88 .template value<double>(variables, x_t.x, x_t.t, x_t.dt);
89
90 out.J_pT_X_dNTdN = f_Tv * D_v * drho_wv_dT;
91 out.K_pp_X_dNTdN = D_v * drho_wv_dp;
92
93 out.vapor_flux = -(out.J_pT_X_dNTdN * T_data.grad_T -
94 out.K_pp_X_dNTdN * p_cap_data.grad_p_cap);
95 out.heat_capacity_vapor =
96 gas_phase
97 ->property(
99 .template value<double>(variables, x_t.x, x_t.t, x_t.dt);
100
101 out.M_TT_X_NTN += out.heat_capacity_vapor * rho_wv * S_g * phi;
102
103 out.storage_coefficient_by_water_vapor =
104 phi * (rho_wv * dS_L_data.dS_L_dp_cap + S_g * drho_wv_dp);
105
106 out.M_pT_X_NTN += phi * S_g * drho_wv_dT;
107
108 //
109 // Latent heat term
110 //
111 if (gas_phase->hasProperty(MPL::PropertyType::specific_latent_heat))
112 {
113 double const factor = phi * S_g / rho_L_data.rho_LR;
114 // The volumetric latent heat of vaporization of liquid water
115 double const L0 =
116 gas_phase->property(MPL::PropertyType::specific_latent_heat)
117 .template value<double>(variables, x_t.x, x_t.t, x_t.dt) *
118 rho_L_data.rho_LR;
119
120 double const rho_wv_over_rho_L = rho_wv / rho_L_data.rho_LR;
121
122 out.M_TT_X_NTN +=
123 factor * L0 *
124 (drho_wv_dT - rho_wv_over_rho_L * rho_L_data.drho_LR_dT);
125 out.M_Tp_X_NTN =
126 (factor * L0 *
127 (drho_wv_dp - rho_wv_over_rho_L * rho_L_data.drho_LR_dp) +
128 L0 * phi * rho_wv_over_rho_L * dS_L_data.dS_L_dp_cap);
129 out.K_TT_X_dNTdN = L0 * out.J_pT_X_dNTdN / rho_L_data.rho_LR;
130 out.K_Tp_X_dNTdN = L0 * out.K_pp_X_dNTdN / rho_L_data.rho_LR;
131 }
132 }
133}
Property const & property(PropertyType const &p) const
Definition Phase.cpp:53
bool hasProperty(PropertyType const &p) const
Definition Phase.cpp:69

References MaterialPropertyLib::density, MaterialPropertyLib::VariableArray::density, ProcessLib::ThermoRichardsMechanics::LiquidDensityData::drho_LR_dp, ProcessLib::ThermoRichardsMechanics::LiquidDensityData::drho_LR_dT, ProcessLib::ThermoRichardsMechanics::SaturationDataDeriv::dS_L_dp_cap, ProcessLib::ConstitutiveRelations::SpaceTimeData::dt, MaterialPropertyLib::VariableArray::gas_phase_pressure, ProcessLib::ThermoRichardsMechanics::CapillaryPressureData< DisplacementDim >::grad_p_cap, ProcessLib::ThermoRichardsMechanics::TemperatureData< DisplacementDim >::grad_T, MaterialPropertyLib::Phase::hasProperty(), ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::heat_capacity_vapor, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::J_pT_X_dNTdN, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::K_pp_X_dNTdN, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::K_Tp_X_dNTdN, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::K_TT_X_dNTdN, MaterialPropertyLib::VariableArray::liquid_phase_pressure, MaterialPropertyLib::VariableArray::liquid_saturation, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::M_pT_X_NTN, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::M_Tp_X_NTN, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::M_TT_X_NTN, ProcessLib::ThermoRichardsMechanics::MediaData::medium, ProcessLib::ThermoRichardsMechanics::CapillaryPressureData< DisplacementDim >::p_cap, ProcessLib::ThermoRichardsMechanics::PorosityData::phi, MaterialPropertyLib::VariableArray::porosity, MaterialPropertyLib::Phase::property(), ProcessLib::ThermoRichardsMechanics::LiquidDensityData::rho_LR, ProcessLib::ThermoRichardsMechanics::SaturationData::S_L, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::setZero(), MaterialPropertyLib::specific_heat_capacity, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::storage_coefficient_by_water_vapor, ProcessLib::ThermoRichardsMechanics::TemperatureData< DisplacementDim >::T, ProcessLib::ConstitutiveRelations::SpaceTimeData::t, MaterialPropertyLib::VariableArray::temperature, ProcessLib::ThermoRichardsMechanics::TRMVaporDiffusionData< DisplacementDim >::vapor_flux, and ProcessLib::ConstitutiveRelations::SpaceTimeData::x.


The documentation for this struct was generated from the following files: