OGS
TRMStorage.cpp
Go to the documentation of this file.
1
11#include "TRMStorage.h"
12
14{
15template <int DisplacementDim>
17 SpaceTimeData const& x_t, BiotData const& biot_data,
18 PorosityData const& poro_data, LiquidDensityData const& rho_L_data,
19 SaturationData const& S_L_data, SaturationDataDeriv const& dS_L_data,
20 PrevState<SaturationData> const& S_L_prev_data,
22 SolidCompressibilityData const& solid_compressibility_data,
23 TRMStorageData& out) const
24{
25 double const p_cap = p_cap_data.p_cap;
26 double const p_cap_prev = p_cap_data.p_cap_prev;
27
28 double const phi = poro_data.phi;
29 double const alphaB_minus_phi = biot_data() - phi;
30
31 double const beta_LR = rho_L_data.drho_LR_dp / rho_L_data.rho_LR;
32
33 double const a0 = alphaB_minus_phi * solid_compressibility_data.beta_SR;
34 double const specific_storage_a_p =
35 S_L_data.S_L * (phi * beta_LR + S_L_data.S_L * a0);
36 double const specific_storage_a_S = phi - p_cap * S_L_data.S_L * a0;
37
38 // Note: d beta_LR/d p is omitted because it is a small value.
39 double const dspecific_storage_a_p_dp_cap =
40 dS_L_data.dS_L_dp_cap * (phi * beta_LR + 2 * S_L_data.S_L * a0);
41 double const dspecific_storage_a_S_dp_cap =
42 -a0 * (S_L_data.S_L + p_cap * dS_L_data.dS_L_dp_cap);
43
44 // secant derivative from time discretization for storage
45 // use tangent, if secant is not available
46 double const DeltaS_L_Deltap_cap =
47 (p_cap == p_cap_prev)
48 ? dS_L_data.dS_L_dp_cap
49 : (S_L_data.S_L - S_L_prev_data->S_L) / (p_cap - p_cap_prev);
50
51 out.storage_p_a_p = rho_L_data.rho_LR * specific_storage_a_p;
53 -rho_L_data.rho_LR * specific_storage_a_S * DeltaS_L_Deltap_cap;
54 out.J_pp_X_NTN = (p_cap - p_cap_prev) / x_t.dt * rho_L_data.rho_LR *
55 dspecific_storage_a_p_dp_cap;
57 -rho_L_data.rho_LR *
58 ((S_L_data.S_L - S_L_prev_data->S_L) * dspecific_storage_a_S_dp_cap +
59 specific_storage_a_S * dS_L_data.dS_L_dp_cap) /
60 x_t.dt;
61}
62
63template struct TRMStorageModel<2>;
64template struct TRMStorageModel<3>;
65} // namespace ProcessLib::ThermoRichardsMechanics
Represents a previous state of type T.
Definition Base.h:21
void eval(SpaceTimeData const &x_t, BiotData const &biot_data, PorosityData const &poro_data, LiquidDensityData const &rho_L_data, SaturationData const &S_L_data, SaturationDataDeriv const &dS_L_data, PrevState< SaturationData > const &S_L_prev_data, CapillaryPressureData< DisplacementDim > const &p_cap_data, SolidCompressibilityData const &solid_compressibility_data, TRMStorageData &out) const