OGS
InternalEnergy.cpp
Go to the documentation of this file.
1
10#include "InternalEnergy.h"
11
12namespace ProcessLib::TH2M
13{
14namespace ConstitutiveRelations
15{
16void InternalEnergyModel::eval(FluidDensityData const& fluid_density_data,
17 PhaseTransitionData const& phase_transition_data,
18 PorosityData const& porosity_data,
19 SaturationData const& S_L_data,
20 SolidDensityData const& solid_density_data,
21 SolidEnthalpyData const& solid_enthalpy_data,
22 InternalEnergyData& internal_energy_data) const
23{
24 auto const phi_L = S_L_data.S_L * porosity_data.phi;
25 auto const phi_G = (1. - S_L_data.S_L) * porosity_data.phi;
26 double const phi_S = 1. - porosity_data.phi;
27
28 auto const u_S = solid_enthalpy_data.h_S;
29
30 internal_energy_data() =
31 phi_G * fluid_density_data.rho_GR * phase_transition_data.uG +
32 phi_L * fluid_density_data.rho_LR * phase_transition_data.uL +
33 phi_S * solid_density_data.rho_SR * u_S;
34}
35
37 FluidDensityData const& fluid_density_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_internal_energy_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 auto const u_S = solid_enthalpy_data.h_S;
54 effective_volumetric_internal_energy_d_data.drho_u_eff_dT =
55 phi_G * phase_transition_data.drho_GR_dT * phase_transition_data.uG +
56 phi_G * fluid_density_data.rho_GR * phase_transition_data.du_G_dT +
57 phi_L * phase_transition_data.drho_LR_dT * phase_transition_data.uL +
58 phi_L * fluid_density_data.rho_LR * phase_transition_data.du_L_dT +
59 phi_S * solid_density_d_data.drho_SR_dT * u_S +
60 phi_S * solid_density_data.rho_SR * solid_heat_capacity_data() -
61 porosity_d_data.dphi_dT * solid_density_data.rho_SR * u_S;
62
63 // From p_LR = p_GR - p_cap it follows for
64 // drho_LR/dp_GR = drho_LR/dp_LR * dp_LR/dp_GR
65 // = drho_LR/dp_LR * (dp_GR/dp_GR - dp_cap/dp_GR)
66 // = drho_LR/dp_LR * (1 - 0)
67 double const drho_LR_dp_GR = phase_transition_data.drho_LR_dp_LR;
68 double const drho_LR_dp_cap = -phase_transition_data.drho_LR_dp_LR;
69 // drho_GR_dp_cap = 0;
70
71 effective_volumetric_internal_energy_d_data.drho_u_eff_dp_GR =
72 /*(dphi_G_dp_GR = 0) * fluid_density_data.rho_GR *
73 phase_transition_data.uG +*/
74 phi_G * phase_transition_data.drho_GR_dp_GR * phase_transition_data.uG +
75 phi_G * fluid_density_data.rho_GR * phase_transition_data.du_G_dp_GR +
76 /*(dphi_L_dp_GR = 0) * fluid_density_data.rho_LR *
77 phase_transition_data.uL +*/
78 phi_L * drho_LR_dp_GR * phase_transition_data.uL +
79 phi_L * fluid_density_data.rho_LR * phase_transition_data.du_L_dp_GR;
80
81 effective_volumetric_internal_energy_d_data.drho_u_eff_dp_cap =
82 -porosity_d_data.dphi_L_dp_cap * fluid_density_data.rho_GR *
83 phase_transition_data.uG +
84 /*phi_G * (drho_GR_dp_cap = 0) * phase_transition_data.uG +*/
85 porosity_d_data.dphi_L_dp_cap * fluid_density_data.rho_LR *
86 phase_transition_data.uL +
87 phi_L * drho_LR_dp_cap * phase_transition_data.uL +
88 phi_L * fluid_density_data.rho_LR * phase_transition_data.du_L_dp_cap;
89}
90} // namespace ConstitutiveRelations
91} // namespace ProcessLib::TH2M
void eval(FluidDensityData const &fluid_density_data, PhaseTransitionData const &phase_transition_data, PorosityData const &porosity_data, SaturationData const &S_L_data, SolidDensityData const &solid_density_data, SolidEnthalpyData const &solid_enthalpy_data, InternalEnergyData &internal_energy_data) const
void dEval(FluidDensityData const &fluid_density_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, EffectiveVolumetricInternalEnergyDerivatives &effective_volumetric_internal_energy_d_data) const