OGS
TEquation.cpp
Go to the documentation of this file.
1
10#include "TEquation.h"
11
12namespace ProcessLib::TH2M
13{
14namespace ConstitutiveRelations
15{
17 double const dt,
18 InternalEnergyData const& internal_energy_data,
19 PrevState<InternalEnergyData> const& internal_energy_data_prev,
20 FT1Data& fT_1) const
21{
22 if (dt == 0)
23 {
24 fT_1.m = 0;
25 return;
26 }
27
28 auto const rho_u_eff_dot =
29 (internal_energy_data() - **internal_energy_data_prev) / dt;
30 fT_1.m = rho_u_eff_dot;
31}
32
33void FT1Model::dEval(double const dt,
35 effective_volumetric_internal_energy_d_data,
36 FT1DerivativeData& dfT_1) const
37{
38 if (dt == 0)
39 {
40 dfT_1.dp_GR = 0;
41 dfT_1.dp_cap = 0;
42 dfT_1.dT = 0;
43 return;
44 }
45
46 dfT_1.dp_GR =
47 effective_volumetric_internal_energy_d_data.drho_u_eff_dp_GR / dt;
48
49 dfT_1.dp_cap =
50 effective_volumetric_internal_energy_d_data.drho_u_eff_dp_cap / dt;
51
52 dfT_1.dT = effective_volumetric_internal_energy_d_data.drho_u_eff_dT / dt;
53}
54
55template <int DisplacementDim>
57 DarcyVelocityData<DisplacementDim> const& darcy_velocity_data,
58 FluidDensityData const& fluid_density_data,
59 FluidEnthalpyData const& fluid_enthalpy_data,
60 FT2Data<DisplacementDim>& fT_2) const
61{
62 fT_2.A.noalias() = fluid_density_data.rho_GR * fluid_enthalpy_data.h_G *
63 darcy_velocity_data.w_GS +
64 fluid_density_data.rho_LR * fluid_enthalpy_data.h_L *
65 darcy_velocity_data.w_LS;
66}
67
68template <int DisplacementDim>
70 DarcyVelocityData<DisplacementDim> const& darcy_velocity_data,
71 FluidDensityData const& fluid_density_data,
72 FluidEnthalpyData const& fluid_enthalpy_data,
73 PermeabilityData<DisplacementDim> const& permeability_data,
74 PhaseTransitionData const& phase_transition_data,
75 SpecificBodyForceData<DisplacementDim> const& specific_body_force,
76 ViscosityData const& viscosity_data,
78{
79 auto const k_over_mu_G =
80 permeability_data.Ki * permeability_data.k_rel_G / viscosity_data.mu_GR;
81 auto const k_over_mu_L =
82 permeability_data.Ki * permeability_data.k_rel_L / viscosity_data.mu_LR;
83
84 dfT_2.dp_GR_Npart = phase_transition_data.drho_GR_dp_GR *
85 fluid_enthalpy_data.h_G * darcy_velocity_data.w_GS +
86 fluid_density_data.rho_GR * fluid_enthalpy_data.h_G *
87 k_over_mu_G * phase_transition_data.drho_GR_dp_GR *
88 specific_body_force();
89 dfT_2.dp_GR_gradNpart =
90 fluid_density_data.rho_GR * fluid_enthalpy_data.h_G * k_over_mu_G -
91 fluid_density_data.rho_LR * fluid_enthalpy_data.h_L * k_over_mu_L;
92
93 // From p_LR = p_GR - p_cap it follows for
94 // drho_LR/dp_GR = drho_LR/dp_LR * dp_LR/dp_GR
95 // = drho_LR/dp_LR * (dp_GR/dp_GR - dp_cap/dp_GR)
96 // = drho_LR/dp_LR * (1 - 0)
97 double const drho_LR_dp_cap = -phase_transition_data.drho_LR_dp_LR;
98
99 dfT_2.dp_cap_Npart =
100 -drho_LR_dp_cap * fluid_enthalpy_data.h_L * darcy_velocity_data.w_LS -
101 fluid_density_data.rho_LR * fluid_enthalpy_data.h_L * k_over_mu_L *
102 drho_LR_dp_cap * specific_body_force();
103 dfT_2.dp_cap_gradNpart =
104 fluid_density_data.rho_LR * fluid_enthalpy_data.h_L * k_over_mu_L;
105
106 dfT_2.dT = phase_transition_data.drho_GR_dT * fluid_enthalpy_data.h_G *
107 darcy_velocity_data.w_GS +
108 fluid_density_data.rho_GR * phase_transition_data.dh_G_dT *
109 darcy_velocity_data.w_GS +
110 phase_transition_data.drho_LR_dT * fluid_enthalpy_data.h_L *
111 darcy_velocity_data.w_LS +
112 fluid_density_data.rho_LR * phase_transition_data.dh_L_dT *
113 darcy_velocity_data.w_LS;
114 // TODO (naumov) + k_over_mu_G * drho_GR_dT * b + k_over_mu_L *
115 // drho_LR_dT * b
116}
117
118template struct FT2Model<2>;
119template struct FT2Model<3>;
120
121template <int DisplacementDim>
123 ConstituentDensityData const& constituent_density_data,
124 DarcyVelocityData<DisplacementDim> const& darcy_velocity_data,
125 DiffusionVelocityData<DisplacementDim> const& diffusion_velocity_data,
126 FluidDensityData const& fluid_density_data,
127 PhaseTransitionData const& phase_transition_data,
128 SpecificBodyForceData<DisplacementDim> const& specific_body_force,
129 FT3Data<DisplacementDim>& fT_3) const
130{
131 fT_3.N =
132 (fluid_density_data.rho_GR * darcy_velocity_data.w_GS.transpose() +
133 fluid_density_data.rho_LR * darcy_velocity_data.w_LS.transpose()) *
134 specific_body_force();
135
136 fT_3.gradN.noalias() =
137 constituent_density_data.rho_C_GR * phase_transition_data.hCG *
138 diffusion_velocity_data.d_CG +
139 constituent_density_data.rho_W_GR * phase_transition_data.hWG *
140 diffusion_velocity_data.d_WG;
141}
142
143template struct FT3Model<2>;
144template struct FT3Model<3>;
145
146} // namespace ConstitutiveRelations
147} // namespace ProcessLib::TH2M
Represents a previous state of type T.
Definition Base.h:21
void dEval(double const dt, EffectiveVolumetricInternalEnergyDerivatives const &effective_volumetric_internal_energy_d_data, FT1DerivativeData &dfT_1) const
Definition TEquation.cpp:33
void eval(double const dt, InternalEnergyData const &internal_energy_data, PrevState< InternalEnergyData > const &internal_energy_data_prev, FT1Data &fT_1) const
Definition TEquation.cpp:16
GlobalDimVector< DisplacementDim > A
Definition TEquation.h:54
GlobalDimMatrix< DisplacementDim > dp_cap_gradNpart
Definition TEquation.h:63
GlobalDimMatrix< DisplacementDim > dp_GR_gradNpart
Definition TEquation.h:61
GlobalDimVector< DisplacementDim > dp_cap_Npart
Definition TEquation.h:62
GlobalDimVector< DisplacementDim > dp_GR_Npart
Definition TEquation.h:60
void eval(DarcyVelocityData< DisplacementDim > const &darcy_velocity_data, FluidDensityData const &fluid_density_data, FluidEnthalpyData const &fluid_enthalpy_data, FT2Data< DisplacementDim > &fT_2) const
Definition TEquation.cpp:56
void dEval(DarcyVelocityData< DisplacementDim > const &darcy_velocity_data, FluidDensityData const &fluid_density_data, FluidEnthalpyData const &fluid_enthalpy_data, PermeabilityData< DisplacementDim > const &permeability_data, PhaseTransitionData const &phase_transition_data, SpecificBodyForceData< DisplacementDim > const &specific_body_force, ViscosityData const &viscosity_data, FT2DerivativeData< DisplacementDim > &dfT_2) const
Definition TEquation.cpp:69
GlobalDimVector< DisplacementDim > gradN
Definition TEquation.h:93
void eval(ConstituentDensityData const &constituent_density_data, DarcyVelocityData< DisplacementDim > const &darcy_velocity_data, DiffusionVelocityData< DisplacementDim > const &diffusion_velocity_data, FluidDensityData const &fluid_density_data, PhaseTransitionData const &phase_transition_data, SpecificBodyForceData< DisplacementDim > const &specific_body_force, FT3Data< DisplacementDim > &fT_3) const