www.mooseframework.org
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
RichardsSUPGstandard Class Reference

standard SUPG relationships valid for the Richards equation. More...

#include <RichardsSUPGstandard.h>

Inheritance diagram for RichardsSUPGstandard:
[legend]

Public Member Functions

 RichardsSUPGstandard (const InputParameters &parameters)
 
RealVectorValue velSUPG (RealTensorValue perm, RealVectorValue gradp, Real density, RealVectorValue gravity) const
 SUPG velocity = -perm*(gradp - density*gravity) This points in direction of information propagation. More...
 
RealTensorValue dvelSUPG_dgradp (RealTensorValue perm) const
 derivative of SUPG velocity wrt gradient of porepressure More...
 
RealVectorValue dvelSUPG_dp (RealTensorValue perm, Real density_prime, RealVectorValue gravity) const
 derivative of SUPG velocity wrt porepressure (keeping gradp fixed) More...
 
RealVectorValue bb (RealVectorValue vel, int dimen, RealVectorValue xi_prime, RealVectorValue eta_prime, RealVectorValue zeta_prime) const
 |bb| ~ 2*velocity/element_length More...
 
RealVectorValue dbb2_dgradp (RealVectorValue vel, RealTensorValue dvel_dgradp, RealVectorValue xi_prime, RealVectorValue eta_prime, RealVectorValue zeta_prime) const
 derivative of bb*bb wrt gradient of porepressure More...
 
Real dbb2_dp (RealVectorValue vel, RealVectorValue dvel_dp, RealVectorValue xi_prime, RealVectorValue eta_prime, RealVectorValue zeta_prime) const
 derivative of bb*bb wrt porepressure More...
 
Real tauSUPG (RealVectorValue vel, Real traceperm, RealVectorValue b) const
 The SUPG tau parameter. More...
 
RealVectorValue dtauSUPG_dgradp (RealVectorValue vel, RealTensorValue dvel_dgradp, Real traceperm, RealVectorValue b, RealVectorValue db2_dgradp) const
 derivative of tau wrt gradient of porepressure More...
 
Real dtauSUPG_dp (RealVectorValue vel, RealVectorValue dvel_dp, Real traceperm, RealVectorValue b, Real db2_dp) const
 derivative of tau wrt porepressure (keeping gradp fixed) More...
 
bool SUPG_trivial () const
 returns false in this case since everything is trivial More...
 
void initialize ()
 
void execute ()
 
void finalize ()
 

Protected Attributes

Real _p_SUPG
 the SUPG pressure parameter This dictates how strong the SUPG is _p_SUPG large means only a little SUPG _p_SUPG small means close to fully-upwind More...
 

Private Member Functions

Real cosh_relation (Real alpha) const
 cosh(alpha)/sinh(alpha) - 1/alpha, modified at extreme values of alpha to prevent overflows More...
 
Real cosh_relation_prime (Real alpha) const
 derivative of cosh_relation wrt alpha More...
 

Detailed Description

standard SUPG relationships valid for the Richards equation.

here i use a formula for "tau" presented in Appendix A of TJR Hughes, M Mallet and A Mizukami `‘A new finite element formulation for computational fluid dynamics:: II. Behond SUPG’' Computer Methods in Applied Mechanics and Engineering 54 (1986) 341–355

Definition at line 28 of file RichardsSUPGstandard.h.

Constructor & Destructor Documentation

◆ RichardsSUPGstandard()

RichardsSUPGstandard::RichardsSUPGstandard ( const InputParameters &  parameters)

Definition at line 37 of file RichardsSUPGstandard.C.

38  : RichardsSUPG(parameters), _p_SUPG(getParam<Real>("p_SUPG"))
39 {
40 }
Real _p_SUPG
the SUPG pressure parameter This dictates how strong the SUPG is _p_SUPG large means only a little SU...
RichardsSUPG(const InputParameters &parameters)
Definition: RichardsSUPG.C:23

Member Function Documentation

◆ bb()

RealVectorValue RichardsSUPGstandard::bb ( RealVectorValue  vel,
int  dimen,
RealVectorValue  xi_prime,
RealVectorValue  eta_prime,
RealVectorValue  zeta_prime 
) const
virtual

|bb| ~ 2*velocity/element_length

Parameters
velSUPG velocity
dimendimension of problem
xi_primespatial gradient of the isoparametric coordinate xi
eta_primespatial gradient of the isoparametric coordinate eta
zeta_primespatial gradient of the isoparametric coordinate zeta

Implements RichardsSUPG.

Definition at line 87 of file RichardsSUPGstandard.C.

92 {
93  RealVectorValue b;
94  b(0) = xi_prime * vel;
95  if (dimen >= 2)
96  b(1) = eta_prime * vel;
97  if (dimen == 3)
98  b(2) = zeta_prime * vel;
99  return b;
100 }

◆ cosh_relation()

Real RichardsSUPGstandard::cosh_relation ( Real  alpha) const
private

cosh(alpha)/sinh(alpha) - 1/alpha, modified at extreme values of alpha to prevent overflows

Definition at line 66 of file RichardsSUPGstandard.C.

Referenced by dtauSUPG_dgradp(), dtauSUPG_dp(), and tauSUPG().

67 {
68  if (alpha >= 5.0 || alpha <= -5.0)
69  return ((alpha > 0.0) ? 1.0 : -1.0) - 1.0 / alpha; // prevents overflows
70  else if (alpha == 0)
71  return 0.0;
72  return 1.0 / std::tanh(alpha) - 1.0 / alpha;
73 }

◆ cosh_relation_prime()

Real RichardsSUPGstandard::cosh_relation_prime ( Real  alpha) const
private

derivative of cosh_relation wrt alpha

Definition at line 76 of file RichardsSUPGstandard.C.

Referenced by dtauSUPG_dgradp(), and dtauSUPG_dp().

77 {
78  if (alpha >= 5.0 || alpha <= -5.0)
79  return 1.0 / (alpha * alpha); // prevents overflows
80  else if (alpha == 0)
81  return 1.0 / 3.0;
82  return 1.0 - Utility::pow<2>(std::cosh(alpha) / std::sinh(alpha)) + 1.0 / (alpha * alpha);
83 }

◆ dbb2_dgradp()

RealVectorValue RichardsSUPGstandard::dbb2_dgradp ( RealVectorValue  vel,
RealTensorValue  dvel_dgradp,
RealVectorValue  xi_prime,
RealVectorValue  eta_prime,
RealVectorValue  zeta_prime 
) const
virtual

derivative of bb*bb wrt gradient of porepressure

Parameters
velSUPG velocity
dvel_dgradpderivative of velocity wrt gradient of porepressure
xi_primespatial gradient of the isoparametric coordinate xi
eta_primespatial gradient of the isoparametric coordinate eta
zeta_primespatial gradient of the isoparametric coordinate zeta

Implements RichardsSUPG.

Definition at line 104 of file RichardsSUPGstandard.C.

109 {
110  // if dvel_dgradp is symmetric so transpose is probably a waste of time
111  return 2.0 * ((xi_prime * vel) * (dvel_dgradp.transpose() * xi_prime) +
112  (eta_prime * vel) * (dvel_dgradp.transpose() * eta_prime) +
113  (zeta_prime * vel) * (dvel_dgradp.transpose() * zeta_prime));
114 }

◆ dbb2_dp()

Real RichardsSUPGstandard::dbb2_dp ( RealVectorValue  vel,
RealVectorValue  dvel_dp,
RealVectorValue  xi_prime,
RealVectorValue  eta_prime,
RealVectorValue  zeta_prime 
) const
virtual

derivative of bb*bb wrt porepressure

Parameters
velSUPG velocity
dvel_dpderivative of velocity wrt porepressure
xi_primespatial gradient of the isoparametric coordinate xi
eta_primespatial gradient of the isoparametric coordinate eta
zeta_primespatial gradient of the isoparametric coordinate zeta

Implements RichardsSUPG.

Definition at line 118 of file RichardsSUPGstandard.C.

123 {
124  return 2.0 *
125  ((xi_prime * vel) * (dvel_dp * xi_prime) + (eta_prime * vel) * (dvel_dp * eta_prime) +
126  (zeta_prime * vel) * (dvel_dp * zeta_prime));
127 }

◆ dtauSUPG_dgradp()

RealVectorValue RichardsSUPGstandard::dtauSUPG_dgradp ( RealVectorValue  vel,
RealTensorValue  dvel_dgradp,
Real  traceperm,
RealVectorValue  b,
RealVectorValue  db2_dgradp 
) const
virtual

derivative of tau wrt gradient of porepressure

Parameters
velSUPG velocity
dvel_dgradpderivative of the SUPG velocity wrt gradient of porepressure
tracepermtrace of the permeability tensor for the material
bthe b parameter: |b| ~ 2*SUPGvelocity/element_length
db2_dgradpderivative of b*b wrt gradient of porepressure

Implements RichardsSUPG.

Definition at line 150 of file RichardsSUPGstandard.C.

155 {
156  Real norm_vel = vel.norm();
157  if (norm_vel == 0)
158  return RealVectorValue();
159 
160  RealVectorValue norm_vel_dgradp(dvel_dgradp * vel / norm_vel);
161 
162  Real norm_b = b.norm();
163  if (norm_b == 0)
164  return RealVectorValue();
165  RealVectorValue norm_b_dgradp = db2_dgradp / 2.0 / norm_b;
166 
167  Real h = 2 * norm_vel / norm_b; // h is a measure of the element length in the "a" direction
168  RealVectorValue h_dgradp(2 * norm_vel_dgradp / norm_b -
169  2.0 * norm_vel * norm_b_dgradp / norm_b / norm_b);
170 
171  Real alpha = 0.5 * norm_vel * h / traceperm / _p_SUPG; // this is the Peclet number
172  RealVectorValue alpha_dgradp =
173  0.5 * (norm_vel_dgradp * h + norm_vel * h_dgradp) / traceperm / _p_SUPG;
174 
175  Real xi_tilde = RichardsSUPGstandard::cosh_relation(alpha);
176  Real xi_tilde_prime = RichardsSUPGstandard::cosh_relation_prime(alpha);
177  RealVectorValue xi_tilde_dgradp = xi_tilde_prime * alpha_dgradp;
178 
179  RealVectorValue tau_dgradp =
180  xi_tilde_dgradp / norm_b - xi_tilde * norm_b_dgradp / (norm_b * norm_b);
181 
182  return tau_dgradp;
183 }
Real _p_SUPG
the SUPG pressure parameter This dictates how strong the SUPG is _p_SUPG large means only a little SU...
Real cosh_relation_prime(Real alpha) const
derivative of cosh_relation wrt alpha
Real cosh_relation(Real alpha) const
cosh(alpha)/sinh(alpha) - 1/alpha, modified at extreme values of alpha to prevent overflows ...

◆ dtauSUPG_dp()

Real RichardsSUPGstandard::dtauSUPG_dp ( RealVectorValue  vel,
RealVectorValue  dvel_dp,
Real  traceperm,
RealVectorValue  b,
Real  db2_dp 
) const
virtual

derivative of tau wrt porepressure (keeping gradp fixed)

Parameters
velSUPG velocity
dvel_dpderivative of the SUPG velocity wrt porepressure
tracepermtrace of the permeability tensor for the material
bthe b parameter: |b| ~ 2*SUPGvelocity/element_length
db2_dpderivative of b*b wrt porepressure

Implements RichardsSUPG.

Definition at line 186 of file RichardsSUPGstandard.C.

191 {
192  Real norm_vel = vel.norm();
193  if (norm_vel == 0.0)
194  return 0.0; // this deriv is not necessarily correct, but i can't see a better thing to do
195 
196  Real norm_vel_dp = dvel_dp * vel / norm_vel;
197 
198  Real norm_b = b.norm();
199  if (norm_b == 0)
200  return 0.0; // this deriv is not necessarily correct, but i can't see a better thing to do
201  Real norm_b_dp = db2_dp / (2.0 * norm_b);
202 
203  Real h = 2.0 * norm_vel / norm_b; // h is a measure of the element length in the "a" direction
204  Real h_dp = 2.0 * norm_vel_dp / norm_b - 2.0 * norm_vel * norm_b_dp / (norm_b * norm_b);
205 
206  Real alpha = 0.5 * norm_vel * h / (traceperm * _p_SUPG); // this is the Peclet number
207  Real alpha_dp = 0.5 * (norm_vel_dp * h + norm_vel * h_dp) / (traceperm * _p_SUPG);
208 
209  Real xi_tilde = RichardsSUPGstandard::cosh_relation(alpha);
210  Real xi_tilde_prime = RichardsSUPGstandard::cosh_relation_prime(alpha);
211  Real xi_tilde_dp = xi_tilde_prime * alpha_dp;
212 
213  // Real tau = xi_tilde/norm_b;
214  const Real tau_dp = xi_tilde_dp / norm_b - xi_tilde * norm_b_dp / (norm_b * norm_b);
215 
216  return tau_dp;
217 }
Real _p_SUPG
the SUPG pressure parameter This dictates how strong the SUPG is _p_SUPG large means only a little SU...
Real cosh_relation_prime(Real alpha) const
derivative of cosh_relation wrt alpha
Real cosh_relation(Real alpha) const
cosh(alpha)/sinh(alpha) - 1/alpha, modified at extreme values of alpha to prevent overflows ...

◆ dvelSUPG_dgradp()

RealTensorValue RichardsSUPGstandard::dvelSUPG_dgradp ( RealTensorValue  perm) const
virtual

derivative of SUPG velocity wrt gradient of porepressure

Parameters
permpermeability tensor

Implements RichardsSUPG.

Definition at line 52 of file RichardsSUPGstandard.C.

53 {
54  return -perm;
55 }

◆ dvelSUPG_dp()

RealVectorValue RichardsSUPGstandard::dvelSUPG_dp ( RealTensorValue  perm,
Real  density_prime,
RealVectorValue  gravity 
) const
virtual

derivative of SUPG velocity wrt porepressure (keeping gradp fixed)

Parameters
permpermeability tensor
density_primederivative of fluid density wrt porepressure
gravitygravitational acceleration vector

Implements RichardsSUPG.

Definition at line 58 of file RichardsSUPGstandard.C.

61 {
62  return perm * density_prime * gravity;
63 }

◆ execute()

void RichardsSUPG::execute ( )
inherited

Definition at line 31 of file RichardsSUPG.C.

32 {
33 }

◆ finalize()

void RichardsSUPG::finalize ( )
inherited

Definition at line 36 of file RichardsSUPG.C.

37 {
38 }

◆ initialize()

void RichardsSUPG::initialize ( )
inherited

Definition at line 26 of file RichardsSUPG.C.

27 {
28 }

◆ SUPG_trivial()

bool RichardsSUPGstandard::SUPG_trivial ( ) const
virtual

returns false in this case since everything is trivial

Implements RichardsSUPG.

Definition at line 220 of file RichardsSUPGstandard.C.

221 {
222  return false;
223 }

◆ tauSUPG()

Real RichardsSUPGstandard::tauSUPG ( RealVectorValue  vel,
Real  traceperm,
RealVectorValue  b 
) const
virtual

The SUPG tau parameter.

This dictates how strong the SUPG is

Parameters
velSUPG velocity
tracepermtrace of the permeability tensor for the material
bthe b parameter: |b| ~ 2*SUPGvelocity/element_length

Implements RichardsSUPG.

Definition at line 130 of file RichardsSUPGstandard.C.

131 {
132  // vel = velocity, b = bb
133  Real norm_v = vel.norm();
134  Real norm_b = b.norm(); // Hughes et al investigate infinity-norm and 2-norm. i just use 2-norm
135  // here. norm_b ~ 2|a|/ele_length_in_direction_of_a
136 
137  if (norm_b == 0)
138  return 0.0; // Only way for norm_b=0 is for zero ele size, or vel=0. Either way we don't have
139  // to upwind.
140 
141  Real h = 2.0 * norm_v / norm_b; // h is a measure of the element length in the "a" direction
142  Real alpha = 0.5 * norm_v * h / (traceperm * _p_SUPG); // this is the Peclet number
143 
144  const Real xi_tilde = RichardsSUPGstandard::cosh_relation(alpha);
145 
146  return xi_tilde / norm_b;
147 }
Real _p_SUPG
the SUPG pressure parameter This dictates how strong the SUPG is _p_SUPG large means only a little SU...
Real cosh_relation(Real alpha) const
cosh(alpha)/sinh(alpha) - 1/alpha, modified at extreme values of alpha to prevent overflows ...

◆ velSUPG()

RealVectorValue RichardsSUPGstandard::velSUPG ( RealTensorValue  perm,
RealVectorValue  gradp,
Real  density,
RealVectorValue  gravity 
) const
virtual

SUPG velocity = -perm*(gradp - density*gravity) This points in direction of information propagation.

Parameters
permpermeability tensor
gradpgradient of porepressure
densityfluid density
gravitygravitational acceleration vector

Implements RichardsSUPG.

Definition at line 43 of file RichardsSUPGstandard.C.

47 {
48  return -perm * (gradp - density * gravity); // points in direction of info propagation
49 }
const std::string density
Definition: NS.h:17

Member Data Documentation

◆ _p_SUPG

Real RichardsSUPGstandard::_p_SUPG
protected

the SUPG pressure parameter This dictates how strong the SUPG is _p_SUPG large means only a little SUPG _p_SUPG small means close to fully-upwind

Definition at line 148 of file RichardsSUPGstandard.h.

Referenced by dtauSUPG_dgradp(), dtauSUPG_dp(), and tauSUPG().


The documentation for this class was generated from the following files: