OGS
Enthalpy.cpp
Go to the documentation of this file.
1
10#include "InternalEnergy.h"
11
12namespace ProcessLib::TH2M
13{
14namespace ConstitutiveRelations
15{
17 FluidDensityData const& fluid_density_data,
18 FluidEnthalpyData const& fluid_enthalpy_data,
19 PorosityData const& porosity_data,
20 SaturationData const& S_L_data,
21 SolidDensityData const& solid_density_data,
22 SolidEnthalpyData const& solid_enthalpy_data,
23 EffectiveVolumetricEnthalpy& effective_volumetric_enthalpy_data) const
24{
25 auto const phi_L = S_L_data.S_L * porosity_data.phi;
26 auto const phi_G = (1. - S_L_data.S_L) * porosity_data.phi;
27 double const phi_S = 1. - porosity_data.phi;
28
29 effective_volumetric_enthalpy_data.rho_h_eff =
30 phi_G * fluid_density_data.rho_GR * fluid_enthalpy_data.h_G +
31 phi_L * fluid_density_data.rho_LR * fluid_enthalpy_data.h_L +
32 phi_S * solid_density_data.rho_SR * solid_enthalpy_data.h_S;
33}
34
36 FluidDensityData const& fluid_density_data,
37 FluidEnthalpyData const& fluid_enthalpy_data,
38 PhaseTransitionData const& phase_transition_data,
39 PorosityData const& porosity_data,
40 PorosityDerivativeData const& porosity_d_data,
41 SaturationData const& S_L_data,
42 SolidDensityData const& solid_density_data,
43 SolidDensityDerivativeData const& solid_density_d_data,
44 SolidEnthalpyData const& solid_enthalpy_data,
45 SolidHeatCapacityData const& solid_heat_capacity_data,
47 effective_volumetric_enthalpy_d_data) const
48{
49 auto const phi_L = S_L_data.S_L * porosity_data.phi;
50 auto const phi_G = (1. - S_L_data.S_L) * porosity_data.phi;
51 double const phi_S = 1. - porosity_data.phi;
52
53 // From p_LR = p_GR - p_cap it follows for
54 // drho_LR/dp_GR = drho_LR/dp_LR * dp_LR/dp_GR
55 // = drho_LR/dp_LR * (dp_GR/dp_GR - dp_cap/dp_GR)
56 // = drho_LR/dp_LR * (1 - 0)
57 double const drho_LR_dp_GR = phase_transition_data.drho_LR_dp_LR;
58 double const drho_LR_dp_cap = -phase_transition_data.drho_LR_dp_LR;
59 // drho_GR_dp_cap = 0;
60
61 effective_volumetric_enthalpy_d_data.drho_h_eff_dp_GR =
62 /*(dphi_G_dp_GR = 0) * fluid_density_data.rho_GR *
63 fluid_enthalpy_data.h_G +*/
64 phi_G * phase_transition_data.drho_GR_dp_GR * fluid_enthalpy_data.h_G +
65 /*(dphi_L_dp_GR = 0) * fluid_density_data.rho_LR *
66 fluid_enthalpy_data.h_L +*/
67 phi_L * drho_LR_dp_GR * fluid_enthalpy_data.h_L;
68 effective_volumetric_enthalpy_d_data.drho_h_eff_dp_cap =
69 porosity_d_data.dphi_L_dp_cap * fluid_density_data.rho_GR *
70 fluid_enthalpy_data.h_G +
71 /*phi_G * (drho_GR_dp_cap = 0) * fluid_enthalpy_data.h_G +*/
72 porosity_d_data.dphi_L_dp_cap * fluid_density_data.rho_LR *
73 fluid_enthalpy_data.h_L +
74 phi_L * drho_LR_dp_cap * fluid_enthalpy_data.h_L;
75
76 // TODO (naumov) Extend for temperature dependent porosities.
77 constexpr double dphi_G_dT = 0;
78 constexpr double dphi_L_dT = 0;
79 effective_volumetric_enthalpy_d_data.drho_h_eff_dT =
80 dphi_G_dT * fluid_density_data.rho_GR * fluid_enthalpy_data.h_G +
81 phi_G * phase_transition_data.drho_GR_dT * fluid_enthalpy_data.h_G +
82 phi_G * fluid_density_data.rho_GR * phase_transition_data.dh_G_dT +
83 dphi_L_dT * fluid_density_data.rho_LR * fluid_enthalpy_data.h_L +
84 phi_L * phase_transition_data.drho_LR_dT * fluid_enthalpy_data.h_L +
85 phi_L * fluid_density_data.rho_LR * phase_transition_data.dh_L_dT -
86 porosity_d_data.dphi_dT * solid_density_data.rho_SR *
87 solid_enthalpy_data.h_S +
88 phi_S * solid_density_d_data.drho_SR_dT * solid_enthalpy_data.h_S +
89 phi_S * solid_density_data.rho_SR * solid_heat_capacity_data();
90}
91
93 SolidHeatCapacityData const& solid_heat_capacity_data,
94 TemperatureData const& T_data,
95 SolidEnthalpyData& solid_enthalpy_data) const
96{
97 solid_enthalpy_data.h_S = solid_heat_capacity_data() * T_data.T;
98}
99
100} // namespace ConstitutiveRelations
101} // namespace ProcessLib::TH2M
void dEval(FluidDensityData const &fluid_density_data, FluidEnthalpyData const &fluid_enthalpy_data, PhaseTransitionData const &phase_transition_data, PorosityData const &porosity_data, PorosityDerivativeData const &porosity_d_data, SaturationData const &S_L_data, SolidDensityData const &solid_density_data, SolidDensityDerivativeData const &solid_density_d_data, SolidEnthalpyData const &solid_enthalpy_data, SolidHeatCapacityData const &solid_heat_capacity_data, EffectiveVolumetricEnthalpyDerivatives &effective_volumetric_enthalpy_d_data) const
Definition Enthalpy.cpp:35
void eval(FluidDensityData const &fluid_density_data, FluidEnthalpyData const &fluid_enthalpy_data, PorosityData const &porosity_data, SaturationData const &S_L_data, SolidDensityData const &solid_density_data, SolidEnthalpyData const &solid_enthalpy_data, EffectiveVolumetricEnthalpy &effective_volumetric_enthalpy_data) const
Definition Enthalpy.cpp:16
void eval(SolidHeatCapacityData const &solid_heat_capacity_data, TemperatureData const &T_data, SolidEnthalpyData &solid_enthalpy_data) const
Definition Enthalpy.cpp:92