OGS
DiffusionVelocity.cpp
Go to the documentation of this file.
1
10#include "DiffusionVelocity.h"
11
12namespace ProcessLib::TH2M
13{
14namespace ConstitutiveRelations
15{
16template <int DisplacementDim>
20 MassMoleFractionsData const& mass_mole_fractions_data,
21 PhaseTransitionData const& phase_transition_data,
22 PorosityData const& porosity_data,
23 SaturationData const& S_L_data,
25 DiffusionVelocityData<DisplacementDim>& diffusion_velocity_data) const
26{
27 auto const gradxmWG = phase_transition_data.dxmWG_dpGR * grad_p_GR() +
28 phase_transition_data.dxmWG_dpCap * grad_p_cap() +
29 phase_transition_data.dxmWG_dT * grad_T();
30 auto const gradxmCG = -gradxmWG;
31
32 auto const gradxmWL = phase_transition_data.dxmWL_dpGR * grad_p_GR() +
33 phase_transition_data.dxmWL_dpCap * grad_p_cap() +
34 phase_transition_data.dxmWL_dT * grad_T();
35 auto const gradxmCL = -gradxmWL;
36
37 double const phi_L = S_L_data.S_L * porosity_data.phi;
38 double const phi_G = (1. - S_L_data.S_L) * porosity_data.phi;
39
40 double const phi_G_D_vapour =
41 phi_G * phase_transition_data.diffusion_coefficient_vapour;
42 double const phi_L_D_solute =
43 phi_L * phase_transition_data.diffusion_coefficient_solute;
44
45 if (mass_mole_fractions_data.xmCG == 0)
46 {
47 diffusion_velocity_data.d_CG = GlobalDimVector<DisplacementDim>::Zero();
48 }
49 else
50 {
51 diffusion_velocity_data.d_CG =
52 -phi_G_D_vapour / mass_mole_fractions_data.xmCG * gradxmCG;
53 }
54
55 if (mass_mole_fractions_data.xmCG == 1)
56 {
57 diffusion_velocity_data.d_WG = GlobalDimVector<DisplacementDim>::Zero();
58 }
59 else
60 {
61 diffusion_velocity_data.d_WG =
62 -phi_G_D_vapour / (1 - mass_mole_fractions_data.xmCG) * gradxmWG;
63 }
64
65 if (mass_mole_fractions_data.xmWL == 1)
66
67 {
68 diffusion_velocity_data.d_CL = GlobalDimVector<DisplacementDim>::Zero();
69 }
70 else
71 {
72 diffusion_velocity_data.d_CL =
73 -phi_L_D_solute / (1. - mass_mole_fractions_data.xmWL) * gradxmCL;
74 }
75
76 if (mass_mole_fractions_data.xmWL == 0)
77 {
78 diffusion_velocity_data.d_WL = GlobalDimVector<DisplacementDim>::Zero();
79 }
80 else
81 {
82 diffusion_velocity_data.d_WL =
83 -phi_L_D_solute / mass_mole_fractions_data.xmWL * gradxmWL;
84 }
85}
86
87template struct DiffusionVelocityModel<2>;
88template struct DiffusionVelocityModel<3>;
89} // namespace ConstitutiveRelations
90} // namespace ProcessLib::TH2M
Eigen::Vector< double, DisplacementDim > GlobalDimVector
Definition Base.h:36
void eval(CapillaryPressureGradientData< DisplacementDim > const &grad_p_cap, GasPressureGradientData< DisplacementDim > const &grad_p_GR, MassMoleFractionsData const &mass_mole_fractions_data, PhaseTransitionData const &phase_transition_data, PorosityData const &porosity_data, SaturationData const &S_L_data, TemperatureGradientData< DisplacementDim > const &grad_T, DiffusionVelocityData< DisplacementDim > &diffusion_velocity_data) const