v0.10.0
Public Member Functions | Public Attributes | List of all members
MixTransport::MaterialWithAutomaticDifferentiation Struct Referenceabstract

#include <users_modules/tutorials/other_tutorials/mix_transport/src/MaterialUnsaturatedFlow.hpp>

Inheritance diagram for MixTransport::MaterialWithAutomaticDifferentiation:
[legend]
Collaboration diagram for MixTransport::MaterialWithAutomaticDifferentiation:
[legend]

Public Member Functions

 MaterialWithAutomaticDifferentiation (const CommonMaterialData &data)
 
template<typename TYPE >
TYPE funSe (TYPE &theta)
 
virtual void recordTheta ()=0
 
virtual void recordKr ()=0
 
MoFEMErrorCode calK ()
 
MoFEMErrorCode calDiffK ()
 
MoFEMErrorCode calC ()
 
MoFEMErrorCode calDiffC ()
 
MoFEMErrorCode calTheta ()
 
MoFEMErrorCode calSe ()
 
- Public Member Functions inherited from MixTransport::CommonMaterialData
 CommonMaterialData ()
 
double initialPcEval () const
 Initialize head. More...
 
void addOptions (po::options_description &o, const std::string &prefix)
 
void printMatParameters (const int id, const std::string &prefix) const
 
- Public Member Functions inherited from MixTransport::GenericMaterial
virtual ~GenericMaterial ()
 

Public Attributes

double Kr
 
double diffKr
 
- Public Attributes inherited from MixTransport::CommonMaterialData
int blockId
 Block Id. More...
 
std::string matName
 material name More...
 
double Ks
 Saturated hydraulic conductivity [m/day]. More...
 
double hS
 minimum capillary height [m] More...
 
double thetaS
 saturated water content More...
 
double thetaR
 residual water contents More...
 
double thetaM
 model parameter More...
 
double alpha
 model parameter More...
 
double n
 model parameter More...
 
double Ah
 Initial hydraulic head coefficient. More...
 
double AhZ
 Initial hydraulic head coefficient. More...
 
double AhZZ
 Initial hydraulic head coefficient. More...
 
- Public Attributes inherited from MixTransport::GenericMaterial
double sCale
 Scale time dependent eq. More...
 
double h
 hydraulic head More...
 
double h_t
 rate of hydraulic head More...
 
double K
 Hydraulic conductivity [L/s]. More...
 
double diffK
 Derivative of hydraulic conductivity [L/s * L^2/F]. More...
 
double C
 Capacity [S^2/L^2]. More...
 
double diffC
 Derivative of capacity [S^2/L^2 * L^2/F ]. More...
 
double tHeta
 Water content. More...
 
double Se
 Effective saturation. More...
 
Range tEts
 Elements with this material. More...
 
double x
 
double y
 
double z
 in meters (L) More...
 

Additional Inherited Members

- Public Types inherited from MixTransport::CommonMaterialData
typedef boost::function< boost::shared_ptr< CommonMaterialData > const CommonMaterialData &data)> RegisterHook
 
- Static Public Attributes inherited from MixTransport::GenericMaterial
static double ePsilon0 = 0
 Regularization parameter. More...
 
static double ePsilon1 = 0
 Regularization parameter. More...
 
static double scaleZ = 1
 Scale z direction. More...
 

Detailed Description

Definition at line 148 of file MaterialUnsaturatedFlow.hpp.

Constructor & Destructor Documentation

◆ MaterialWithAutomaticDifferentiation()

MixTransport::MaterialWithAutomaticDifferentiation::MaterialWithAutomaticDifferentiation ( const CommonMaterialData data)

Member Function Documentation

◆ calC()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calC ( )
virtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 194 of file MaterialUnsaturatedFlow.hpp.

194  {
196  if (h < hS) {
197  int r = ::gradient(2 * blockId + 0, 1, &h, &C);
198  if (r < 0) {
199  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
200  "ADOL-C function evaluation with error");
201  }
202  } else {
203  C = 0;
204  }
205  C += ePsilon1;
207  }
double C
Capacity [S^2/L^2].
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
double hS
minimum capillary height [m]
static double ePsilon1
Regularization parameter.
const double r
rate factor

◆ calDiffC()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calDiffC ( )
virtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 209 of file MaterialUnsaturatedFlow.hpp.

209  {
211  if (h < hS) {
212  double v = 1;
213  int r = ::hess_vec(2 * blockId + 0, 1, &h, &v, &diffC);
214  if (r < 0) {
215  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
216  "ADOL-C function evaluation with error");
217  }
218  } else {
219  diffC = 0;
220  }
222  }
double diffC
Derivative of capacity [S^2/L^2 * L^2/F ].
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
double hS
minimum capillary height [m]
const double r
rate factor

◆ calDiffK()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calDiffK ( )
virtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 178 of file MaterialUnsaturatedFlow.hpp.

178  {
180  if (h < hS) {
181  diffK = 0;
182  int r = ::gradient(2 * blockId + 1, 1, &h, &diffKr);
183  if (r < 0) {
184  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
185  "ADOL-C function evaluation with error");
186  }
187  diffK = Ks * diffKr;
188  } else {
189  diffK = 0;
190  }
192  };
double diffK
Derivative of hydraulic conductivity [L/s * L^2/F].
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
double Ks
Saturated hydraulic conductivity [m/day].
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
double hS
minimum capillary height [m]
const double r
rate factor

◆ calK()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calK ( )
virtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 161 of file MaterialUnsaturatedFlow.hpp.

161  {
163  if (h < hS) {
164  int r = ::function(2 * blockId + 1, 1, 1, &h, &Kr);
165  if (r < 0) {
166  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
167  "ADOL-C function evaluation with error");
168  }
169  K = Ks * Kr;
170  } else {
171  K = Ks;
172  }
173  K += Ks * ePsilon0;
175  };
static double ePsilon0
Regularization parameter.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
double Ks
Saturated hydraulic conductivity [m/day].
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
double hS
minimum capillary height [m]
double K
Hydraulic conductivity [L/s].
const double r
rate factor

◆ calSe()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calSe ( )
virtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 238 of file MaterialUnsaturatedFlow.hpp.

238  {
240  if (h < hS) {
241  int r = ::function(2 * blockId + 0, 1, 1, &h, &tHeta);
242  Se = funSe(tHeta);
243  if (r < 0) {
244  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
245  "ADOL-C function evaluation with error");
246  }
247  } else {
248  tHeta = thetaS;
249  }
251  }
double thetaS
saturated water content
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
double hS
minimum capillary height [m]
double Se
Effective saturation.
const double r
rate factor

◆ calTheta()

MoFEMErrorCode MixTransport::MaterialWithAutomaticDifferentiation::calTheta ( )
virtual

Reimplemented from MixTransport::GenericMaterial.

Definition at line 224 of file MaterialUnsaturatedFlow.hpp.

224  {
226  if (h < hS) {
227  int r = ::function(2 * blockId + 0, 1, 1, &h, &tHeta);
228  if (r < 0) {
229  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
230  "ADOL-C function evaluation with error");
231  }
232  } else {
233  tHeta = thetaS;
234  }
236  }
double thetaS
saturated water content
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:509
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
double hS
minimum capillary height [m]
const double r
rate factor

◆ funSe()

template<typename TYPE >
TYPE MixTransport::MaterialWithAutomaticDifferentiation::funSe ( TYPE &  theta)

Definition at line 152 of file MaterialUnsaturatedFlow.hpp.

152  {
153  return (theta - thetaR) / (thetaS - thetaR);
154  }
double thetaS
saturated water content
double thetaR
residual water contents

◆ recordKr()

virtual void MixTransport::MaterialWithAutomaticDifferentiation::recordKr ( )
pure virtual

◆ recordTheta()

virtual void MixTransport::MaterialWithAutomaticDifferentiation::recordTheta ( )
pure virtual

Member Data Documentation

◆ diffKr

double MixTransport::MaterialWithAutomaticDifferentiation::diffKr

Definition at line 175 of file MaterialUnsaturatedFlow.hpp.

◆ Kr

double MixTransport::MaterialWithAutomaticDifferentiation::Kr

Definition at line 160 of file MaterialUnsaturatedFlow.hpp.


The documentation for this struct was generated from the following file: