OGS
PhaseTransitionModel.h
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include <map>
13 
14 #include "MaterialLib/MPL/Medium.h"
15 
16 namespace ProcessLib
17 {
18 namespace TH2M
19 {
21 {
22  // gas phase density
23  double rhoGR = 0.;
24  double rhoCGR = 0.;
25  double rhoWGR = 0.;
26 
27  double drho_GR_dp_GR = 0.;
28  double drho_GR_dT = 0.;
29  double drho_C_GR_dp_GR = 0.;
30  double drho_C_GR_dT = 0.;
31  double drho_LR_dp_GR = 0.;
32  double drho_LR_dp_LR = 0.;
33  double drho_C_LR_dp_GR = 0.;
34  double drho_C_LR_dp_LR = 0.;
35  double drho_C_LR_dT = 0.;
36 
37  double drho_W_LR_dp_LR = 0.;
38  double drho_W_LR_dp_GR = 0.;
39  double drho_W_GR_dT = 0.;
40  double drho_W_LR_dT = 0.;
41  double drho_W_GR_dp_GR = 0.;
42  double drho_W_GR_dp_cap = 0.;
43 
44  // liquid phase density
45  double rhoLR = 0.;
46  double rhoWLR = 0.;
47  double rhoCLR = 0.;
48 
49  // water partial pressure in gas phase
50  double pWGR = 0;
51 
52  // constituent mass and molar fractions
53  double xnCG = 0.;
54  double xnWG = 0.;
55  double xmCG = 0.;
56  double xmWG = 0.;
57  double xmCL = 0.;
58  double xmWL = 0.;
59 
60  // molar fraction derivatives
61  double dxnCG_dpGR = 0.;
62  double dxnCG_dpCap = 0.;
63  double dxnCG_dT = 0.;
64 
65  // mass fraction derivatives
66  double dxmCG_dpGR = 0.;
67  double dxmWG_dpGR = 0.;
68  double dxmCL_dpLR = 0.;
69  double dxmWL_dpLR = 0.;
70  double dxmCG_dT = 0.;
71  double dxmWG_dT = 0.;
72  double dxmCL_dT = 0.;
73  double dxmWL_dT = 0.;
74 
75  // viscosities
76  double muGR = 0.;
77  double muLR = 0.;
78  // thermal conductivities
79  double lambdaGR = 0.;
80  double lambdaLR = 0.;
81 
84 
85  // specific enthalpies
86  double hG = 0;
87  double hCG = 0;
88  double hWG = 0;
89  double hL = 0;
90 
91  double dh_G_dT = 0;
92  double dh_L_dT = 0;
93 
94  // specific inner energies
95  double uG = 0;
96  double uL = 0;
97 
98  double du_G_dT = 0;
99  double du_L_dT = 0;
100  double du_G_dp_GR = 0;
101  double du_L_dp_GR = 0;
102  double du_L_dp_cap = 0;
103 };
104 
106 {
108  std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const&
109  media)
110  {
111  DBUG("Create phase transition models...");
112 
113  // check for minimum requirement definitions in media object
114  std::array const required_gas_properties = {
117  std::array const required_liquid_properties = {
120 
121  for (auto const& m : media)
122  {
123  checkRequiredProperties(m.second->phase("Gas"),
124  required_gas_properties);
125  checkRequiredProperties(m.second->phase("AqueousLiquid"),
126  required_liquid_properties);
127  }
128  }
129 
130  virtual ~PhaseTransitionModel() = default;
131 
133  const MaterialPropertyLib::Medium* medium,
135  ParameterLib::SpatialPosition pos, double const t, double const dt)
136  {
137  cv = updateConstitutiveVariables(cv, medium, variables, pos, t, dt);
138  }
139 
141  PhaseTransitionModelVariables const& phase_transition_model_variables,
142  const MaterialPropertyLib::Medium* medium,
144  ParameterLib::SpatialPosition pos, double const t,
145  double const dt) const = 0;
146 
147  // constitutive variables
149 };
150 
152  std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media,
153  std::string phase_name);
154 
156  std::map<int, std::shared_ptr<MaterialPropertyLib::Medium>> const& media,
157  std::string phase_name, MaterialPropertyLib::PropertyType property_type);
158 
159 } // namespace TH2M
160 } // namespace ProcessLib
void DBUG(char const *fmt, Args const &... args)
Definition: Logging.h:27
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
Definition: VariableType.h:108
void checkRequiredProperties(Component const &c, Container const &required_properties)
Definition: Component.h:96
int numberOfComponents(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media, std::string phase_name)
int findComponentIndex(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media, std::string phase_name, MaterialPropertyLib::PropertyType property_type)
virtual PhaseTransitionModelVariables updateConstitutiveVariables(PhaseTransitionModelVariables const &phase_transition_model_variables, const MaterialPropertyLib::Medium *medium, MaterialPropertyLib::VariableArray variables, ParameterLib::SpatialPosition pos, double const t, double const dt) const =0
virtual void computeConstitutiveVariables(const MaterialPropertyLib::Medium *medium, MaterialPropertyLib::VariableArray variables, ParameterLib::SpatialPosition pos, double const t, double const dt)
PhaseTransitionModel(std::map< int, std::shared_ptr< MaterialPropertyLib::Medium >> const &media)