56 std::map<
int, std::shared_ptr<MaterialPropertyLib::Medium>>
const& media)
68 media,
"AqueousLiquid",
74 DBUG(
"Create PhaseTransition constitutive model.");
79 "The current implementation of PhaseTransitionModelEvaporation "
80 "requires the specification of exactly two components in the "
86 auto const medium = media.begin()->second;
87 auto const& gas_phase = medium->phase(
"Gas");
88 auto const& liquid_phase = medium->phase(
"AqueousLiquid");
91 std::array
const required_medium_properties = {
93 checkRequiredProperties(*medium, required_medium_properties);
96 std::array
const required_vapour_component_properties = {
102 std::array
const required_dry_air_component_properties = {
106 std::array
const required_solute_component_properties = {
111 std::array
const required_solvent_component_properties = {
116 std::array
const required_liquid_properties = {
119 checkRequiredProperties(
121 required_vapour_component_properties);
122 checkRequiredProperties(
124 required_dry_air_component_properties);
125 checkRequiredProperties(
127 required_solute_component_properties);
128 checkRequiredProperties(
130 required_solvent_component_properties);
131 checkRequiredProperties(gas_phase, required_gas_properties);
132 checkRequiredProperties(liquid_phase, required_liquid_properties);
151 auto const pGR = p_GR.
pG;
152 auto const pCap = p_cap.
pCap;
153 auto const T = T_data.
T;
158 auto const& liquid_phase = media_data.
liquid;
159 auto const& gas_phase = media_data.
gas;
164 auto const& vapour_component =
166 auto const& dry_air_component =
173 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
178 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
186 const auto p_vap_flat =
189 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
191 const auto dp_vap_flat_dT =
194 .template dValue<double>(variables,
196 x_t.
x, x_t.
t, x_t.
dt);
202 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
206 auto const pLR = pGR - pCap;
211 pCap > 0. ? std::exp(-pCap * M_W / rho_W_LR() / R / T) : 1.;
213 pCap > 0. ? pCap * M_W / rho_W_LR() / R / T / T * K : 0;
214 const double dK_dpCap =
215 pCap > 0. ? -M_W / rho_W_LR() / R / T * K
221 vapour_pressure_data.
pWGR = p_vap_flat * K;
222 auto const dpWGR_dT = dp_vap_flat_dT * K + p_vap_flat * dK_dT;
223 auto const dpWGR_dpCap = p_vap_flat * dK_dpCap;
226 auto const xnWG_min =
234 std::clamp(vapour_pressure_data.
pWGR / pGR, xnWG_min, 1. - xnWG_min);
235 mass_mole_fractions_data.
xnCG = 1. - xnWG;
238 auto const dxnWG_dpGR = -vapour_pressure_data.
pWGR / pGR / pGR;
239 auto const dxnWG_dpCap = dpWGR_dpCap / pGR;
240 auto const dxnWG_dT = dpWGR_dT / pGR;
243 auto const MG = mass_mole_fractions_data.
xnCG * M_C + xnWG * M_W;
247 double const xmWG = xnWG * M_W / MG;
248 mass_mole_fractions_data.
xmCG = 1. - xmWG;
250 auto const dxn_dxm_conversion = M_W * M_C / MG / MG;
252 cv.
dxmWG_dpGR = dxnWG_dpGR * dxn_dxm_conversion;
254 cv.
dxmWG_dT = dxnWG_dT * dxn_dxm_conversion;
257 fluid_density_data.
rho_GR =
259 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
262 auto const dMG = M_W - M_C;
263 auto const dMG_dpGR = dxnWG_dpGR * dMG;
274 .template dValue<double>(
276 x_t.
x, x_t.
t, x_t.
dt);
278 auto const dMG_dpCap = dxnWG_dpCap * dMG;
282 .template dValue<double>(
284 x_t.
x, x_t.
t, x_t.
dt);
286 auto const dMG_dT = dxnWG_dT * dMG;
290 .template dValue<double>(variables,
292 x_t.
x, x_t.
t, x_t.
dt);
301 mass_mole_fractions_data.
xmCG * fluid_density_data.
rho_GR;
302 constituent_density_data.
rho_W_GR = xmWG * fluid_density_data.
rho_GR;
324 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
328 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
332 cv.
hWG = cpWG * T + dh_evap;
335 fluid_enthalpy_data.
h_G =
336 mass_mole_fractions_data.
xmCG * cv.
hCG + xmWG * cv.
hWG;
340 cv.
uG = fluid_enthalpy_data.
h_G - pGR / fluid_density_data.
rho_GR;
346 auto const tortuosity = media_data.
tortuosity_prop->template value<double>(
347 variables, x_t.
x, x_t.
t, x_t.
dt);
351 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
353 tortuosity * D_W_G_m;
361 auto const& solute_component =
372 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
377 .template dValue<double>(variables,
379 x_t.
x, x_t.
t, x_t.
dt);
383 .template dValue<double>(
385 x_t.
x, x_t.
t, x_t.
dt);
389 auto const cCL = H * mass_mole_fractions_data.
xnCG * pGR;
392 auto const dxnCG_dpGR = -dxnWG_dpGR;
393 auto const dxnCG_dT = -dxnWG_dT;
395 auto const dcCL_dpGR =
396 (dH_dpGR * mass_mole_fractions_data.
xnCG + H * dxnCG_dpGR) * pGR +
397 H * mass_mole_fractions_data.
xnCG;
399 pGR * (dH_dT * mass_mole_fractions_data.
xnCG + H * dxnCG_dT);
411 fluid_density_data.
rho_LR =
413 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
417 constituent_density_data.
rho_C_LR = fluid_density_data.
rho_LR - rho_W_LR();
420 mass_mole_fractions_data.
xmWL =
421 std::clamp(rho_W_LR() / fluid_density_data.
rho_LR, 0., 1.);
422 auto const xmCL = 1. - mass_mole_fractions_data.
xmWL;
441 auto const rho_ref_betaP =
443 .template dValue<double>(
445 x_t.
x, x_t.
t, x_t.
dt);
447 auto const rho_ref_betaT =
449 .template dValue<double>(variables,
451 x_t.
x, x_t.
t, x_t.
dt);
453 auto const rho_ref_betaC =
455 .template dValue<double>(
460 auto const drhoLR_dpGR = rho_ref_betaP + rho_ref_betaC * dcCL_dpGR;
461 auto const drhoLR_dpCap = -rho_ref_betaP;
462 cv.
drho_LR_dT = rho_ref_betaT + rho_ref_betaC * dcCL_dT;
465 auto const drhoWLR_dpGR = rho_ref_betaP;
466 auto const drhoWLR_dpCap = -rho_ref_betaP;
467 auto const drhoWLR_dT = rho_ref_betaT;
471 1. / fluid_density_data.
rho_LR *
472 (drhoWLR_dpGR - mass_mole_fractions_data.
xmWL * drhoLR_dpGR);
474 1. / fluid_density_data.
rho_LR *
475 (drhoWLR_dpCap - mass_mole_fractions_data.
xmWL * drhoLR_dpCap);
480 mass_mole_fractions_data.
xnWL =
481 mass_mole_fractions_data.
xmWL * M_C /
482 (mass_mole_fractions_data.
xmWL * M_C + xmCL * M_W);
485 auto const& solvent_component =
492 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
496 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
502 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
505 double const hCL = cpCL * T + dh_sol;
506 double const hWL = cpWL * T;
507 fluid_enthalpy_data.
h_L = xmCL * hCL + mass_mole_fractions_data.
xmWL * hWL;
511 cv.
uL = fluid_enthalpy_data.
h_L;
517 .template value<double>(variables, x_t.
x, x_t.
t, x_t.
dt);
519 tortuosity * D_C_L_m;
void eval(SpaceTimeData const &x_t, MediaData const &media_data, GasPressureData const &p_GR, CapillaryPressureData const &p_cap, TemperatureData const &T_data, PureLiquidDensityData const &rho_W_LR, FluidEnthalpyData &fluid_enthalpy_data, MassMoleFractionsData &mass_mole_fractions_data, FluidDensityData &fluid_density_data, VapourPartialPressureData &vapour_pressure_data, ConstituentDensityData &constituent_density_data, PhaseTransitionData &cv) const override