BISICLES AMR ice sheet model  0.9
ConstitutiveRelation.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3 * _______ __
4 * / ___/ / ___ __ _ / / ___
5 * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6 * \___/_//_/\___/_/_/_/_.__/\___/
7 * Please refer to Copyright.txt, in Chombo's root directory.
8 */
9 #endif
10 
11 #ifndef _CONSTITUTIVERELATION_H_
12 #define _CONSTITUTIVERELATION_H_
13 
14 #include "LevelData.H"
15 #include "FArrayBox.H"
16 #include "FluxBox.H"
17 #include "LevelSigmaCS.H"
18 #include "CellToEdge.H"
19 #include "NamespaceHeader.H"
20 
21 
22 
24 
34 class
36 {
37 
38 public:
39 
40  static ConstitutiveRelation* parse(const char* a_prefix);
41 
43 
44  virtual ~ConstitutiveRelation() {;}
45 
47 
58  virtual void computeMu(LevelData<FArrayBox>& a_mu,
59  const LevelData<FArrayBox>& a_vel, const Real& a_scale,
60  const LevelData<FArrayBox>* a_crseVel,
61  int a_nRefCrse,
62  const LevelData<FArrayBox>& a_A,
63  const LevelSigmaCS& a_coordSys,
64  const ProblemDomain& a_domain,
65  const IntVect& a_ghostVect = IntVect::Zero) const = 0;
66 
67 
68 
82  virtual void computeDissipation(LevelData<FArrayBox>& a_dissipation,
83  const LevelData<FArrayBox>& a_cellVel,
84  const LevelData<FArrayBox>* a_crseVel,
85  int nRefCrse,
86  const LevelData<FArrayBox>& a_A,
87  const LevelSigmaCS& a_coordSys,
88  const ProblemDomain& a_domain,
89  const IntVect& a_ghostVect = IntVect::Zero) const = 0;
90 
92 
104  virtual void computeFaceMu(LevelData<FluxBox>& a_mu,
105  LevelData<FArrayBox>& a_vel, const Real& a_scale,
106  const LevelData<FArrayBox>* a_crseVel,
107  int a_nRefCrse,
108  const LevelData<FluxBox>& a_A,
109  const LevelSigmaCS& a_coordSys,
110  const ProblemDomain& a_domain,
111  const IntVect& a_ghostVect = IntVect::Zero) const = 0;
112 
113 
116 
118  void computeStrainRateInvariant(LevelData<FArrayBox>& a_epsilonSquared,
119  const LevelData<FArrayBox>& a_velocity,
120  const LevelData<FArrayBox>* a_crseVel,
121  int nRefCrse,
122  const LevelSigmaCS& a_coordSys,
123  const IntVect& a_ghostVect = IntVect::Zero) const;
124 
126  void computeStrainRateInvariantFace(LevelData<FluxBox>& a_epsilonSquared,
127  LevelData<FArrayBox>& a_velocity,
128  const LevelData<FArrayBox>* a_crseVel,
129  int a_nRefCrse,
130  const LevelSigmaCS& a_coordSys,
131  const IntVect& a_ghostVect = IntVect::Zero) const;
132 
134  void computeStrainRateInvariant(LevelData<FArrayBox>& a_epsilonSquared,
135  LevelData<FArrayBox>& a_gradVelocity,
136  const LevelData<FArrayBox>& a_velocity,
137  const LevelData<FArrayBox>* a_crseVel,
138  int a_nRefCrse,
139  const LevelSigmaCS& a_coordSys,
140  const IntVect& a_ghostVect = IntVect::Zero) const;
141 
143  void computeStrainRateInvariantFace(LevelData<FluxBox>& a_epsilonSquared,
144  LevelData<FluxBox>& a_gradVelocity,
145  LevelData<FArrayBox>& a_velocity,
146  const LevelData<FArrayBox>* a_crseVel,
147  int a_nRefCrse,
148  const LevelSigmaCS& a_coordSys,
149  const IntVect& a_ghostVect = IntVect::Zero) const;
150 
151 protected:
152 
153 };
154 
157 {
158 
159 public:
160 
161  virtual ~RateFactor(){;}
162 
163  virtual void computeA(FArrayBox& a_A,
164  const FArrayBox& a_thetaStar,
165  const FArrayBox& a_pressure,
166  const Box& a_box) const = 0;
167 
168  virtual RateFactor* getNewRateFactor() const = 0;
169 
170 
171 } ;
172 
174 
179 {
180  Real m_A; // the constant rate factor
181 public:
182 
183  // ConstantRateFactor(Real a_seconds_per_unit_time)
184  // : m_A(9.2e-18 / a_seconds_per_unit_time ) // A measured in Pa^{n} a^{-1}
185  // {
186  // }
187 
188  ConstantRateFactor(Real a_A) : m_A(a_A)
189  {
190  }
191 
192 
193  void computeA(FArrayBox& a_A,
194  const FArrayBox& a_theta,
195  const FArrayBox& a_pressure,
196  const Box& a_box) const
197  {
198  a_A.setVal(m_A, a_box, 0);
199  }
200 
202  {
203  ConstantRateFactor* newPtr = new ConstantRateFactor(m_A);
204  return static_cast<RateFactor*>(newPtr);
205  }
206 
207 
208 };
209 
211 
216 {
218  Real m_n;
220  Real m_enhance;
222  Real m_B0;
224  Real m_theta_r;
226  Real m_K;
228  Real m_C;
230  Real m_R;
232  // (insert funny comment about lazy creeps here...)
233  Real m_Q;
234 
235 public:
236  ArrheniusRateFactor(Real a_seconds_per_unit_time);
237 
238  void setDefaultParameters(Real a_seconds_per_unit_time);
239 
240 
241  void setParameters(Real a_n,
242  Real a_enhance,
243  Real a_B0,
244  Real a_theta_r,
245  Real a_K,
246  Real a_C,
247  Real a_R,
248  Real a_Q);
249 
250  //compute the (temperature-dependent) rate factor A
251  void computeA(FArrayBox& a_A,
252  const FArrayBox& a_thetaStar,
253  const FArrayBox& a_pressure,
254  const Box& a_box) const;
255 
256  RateFactor* getNewRateFactor() const;
257 
258 
259 };
260 
262 
283 {
284 
285 public:
287  Real m_E;
289  Real m_A0;
291  Real m_T0;
293  Real m_R;
295  // (insert funny comment about two lazy creeps here...)
296  Real m_Qm, m_Qp;
297 
298 public:
299 
300  PatersonRateFactor(Real a_seconds_per_unit_time);
301 
302  void setDefaultParameters(Real a_seconds_per_unit_time);
303 
304  void setA0(Real a_A0)
305  {
306  m_A0 = a_A0;
307  }
308 
309  void setParameters(Real a_E, Real a_A0, Real a_T0, Real a_R,
310  Real a_Qm, Real a_Qp);
311 
312  //compute the (pressure-corrected temperature-
313  //and pressure- dependent) rate factor A
314  void computeA(FArrayBox& a_A,
315  const FArrayBox& a_thetaPC,
316  const FArrayBox& a_pressure,
317  const Box& a_box) const;
318 
319  RateFactor* getNewRateFactor() const;
320 
321 
322 };
323 
324 
326 
350 {
351 
353  Real m_E;
355  Real m_A0;
357  Real m_T0;
359  Real m_R;
361  // (insert funny comment about two lazy creeps here...)
362  Real m_Qm, m_Qp;
363 
364 public:
365 
366  ZwingerRateFactor(Real a_seconds_per_unit_time);
367 
368  void setDefaultParameters(Real a_seconds_per_unit_time);
369 
370 
371  void setParameters(Real a_E, Real a_A0, Real a_T0, Real a_R,
372  Real a_Qm, Real a_Qp);
373 
374  //compute the (pressure-corrected temperature-
375  //and pressure- dependent) rate factor A
376  void computeA(FArrayBox& a_A,
377  const FArrayBox& a_thetaPC,
378  const FArrayBox& a_pressure,
379  const Box& a_box) const;
380 
381  RateFactor* getNewRateFactor() const;
382 
383 
384 };
385 
386 // $\f \tau^2 \tau _ij = 2 A \dot{\epsilon}_{ij} \f$
387 
388 
390 
405 class GlensFlowRelation: public ConstitutiveRelation
406 {
407 public:
408 
409  GlensFlowRelation();
410 
411  virtual ~GlensFlowRelation();
412 
413 
414 
415  virtual void computeMu(LevelData<FArrayBox>& a_mu,
416  const LevelData<FArrayBox>& a_vel, const Real& a_scale,
417  const LevelData<FArrayBox>* a_crseVel,
418  int a_nRefCrse,
419  const LevelData<FArrayBox>& a_A,
420  const LevelSigmaCS& a_coordSys,
421  const ProblemDomain& a_domain,
422  const IntVect& a_ghostVect = IntVect::Zero) const;
423 
424  virtual void computeDissipation(LevelData<FArrayBox>& a_dissipation,
425  const LevelData<FArrayBox>& a_vel,
426  const LevelData<FArrayBox>* a_crseVel,
427  int a_nRefCrse,
428  const LevelData<FArrayBox>& a_A,
429  const LevelSigmaCS& a_coordSys,
430  const ProblemDomain& a_domain,
431  const IntVect& a_ghostVect = IntVect::Zero) const;
432 
433  virtual void computeFaceMu(LevelData<FluxBox>& a_mu,
434  LevelData<FArrayBox>& a_vel, const Real& a_scale,
435  const LevelData<FArrayBox>* a_crseVel,
436  int a_nRefCrse,
437  const LevelData<FluxBox>& a_A,
438  const LevelSigmaCS& a_coordSys,
439  const ProblemDomain& a_domain,
440  const IntVect& a_ghostVect = IntVect::Zero) const;
441 
442 
443  virtual void setDefaultParameters();
444 
445  virtual void setParameters(Real a_n,
446  Real a_epsSqr0,
447  Real a_delta);
448 
451 
453  Real m_n;
454 
455  virtual Real power() const {return m_n;}
456 
458  //RateFactor* m_rateFactor;
459 
462  Real m_epsSqr0, m_delta;
463 
464 protected:
467  void computeMu0(FArrayBox& a_mu0,
468  const FArrayBox& a_A,const Real& a_scale,
469  const Box& a_box) const;
470 
471 
472 };
473 
474 
476 
479 class constMuRelation: public ConstitutiveRelation
480 {
481 public:
483  constMuRelation();
484 
485  virtual ~constMuRelation();
486 
487 
488  virtual void computeMu(LevelData<FArrayBox>& a_mu,
489  const LevelData<FArrayBox>& a_vel, const Real& a_scale,
490  const LevelData<FArrayBox>* a_crseVel,
491  int a_nRefCrse,
492  const LevelData<FArrayBox>& a_A,
493  const LevelSigmaCS& a_coordSys,
494  const ProblemDomain& a_domain,
495  const IntVect& a_ghostVect = IntVect::Zero) const;
496 
497 
498  virtual void computeDissipation(LevelData<FArrayBox>& a_dissipation,
499  const LevelData<FArrayBox>& a_vel,
500  const LevelData<FArrayBox>* a_crseVel,
501  int a_nRefCrse,
502  const LevelData<FArrayBox>& a_A,
503  const LevelSigmaCS& a_coordSys,
504  const ProblemDomain& a_domain,
505  const IntVect& a_ghostVect = IntVect::Zero) const;
506 
507 
508  virtual void computeFaceMu(LevelData<FluxBox>& a_mu,
509  LevelData<FArrayBox>& a_vel, const Real& a_scale,
510  const LevelData<FArrayBox>* a_crseVel,
511  int a_nRefCrse,
512  const LevelData<FluxBox>& a_A,
513  const LevelSigmaCS& a_coordSys,
514  const ProblemDomain& a_domain,
515  const IntVect& a_ghostVect = IntVect::Zero) const;
516 
517 
518 
519  virtual void setDefaultParameters();
520 
521  virtual void setConstVal(Real a_mu) {m_mu = a_mu;}
522 
524 
525  // constant value of mu
526  Real m_mu;
527 
528  virtual Real power() const{return 1.0;}
529 
530 protected:
531 
532 };
533 
534 
535 
536 #include "NamespaceFooter.H"
537 
538 #endif
Real m_R
universal gas constant
Definition: ConstitutiveRelation.H:293
ConstantRateFactor(Real a_A)
Definition: ConstitutiveRelation.H:188
Real m_Qp
Definition: ConstitutiveRelation.H:296
void computeA(FArrayBox &a_A, const FArrayBox &a_theta, const FArrayBox &a_pressure, const Box &a_box) const
Definition: ConstitutiveRelation.H:193
Zwinger Rate Factor.
Definition: ConstitutiveRelation.H:349
Abstract class around the englacial constitutive relations for ice.
Definition: ConstitutiveRelation.H:34
virtual void computeMu(LevelData< FArrayBox > &a_mu, const LevelData< FArrayBox > &a_vel, const Real &a_scale, const LevelData< FArrayBox > *a_crseVel, int a_nRefCrse, const LevelData< FArrayBox > &a_A, const LevelSigmaCS &a_coordSys, const ProblemDomain &a_domain, const IntVect &a_ghostVect=IntVect::Zero) const =0
Compute cell-centered based on the cell-centered velocity.
rate factor A(T) in (e.g) Glen&#39;s law
Definition: ConstitutiveRelation.H:156
static ConstitutiveRelation * parse(const char *a_prefix)
Definition: ConstitutiveRelation.cpp:815
Real m_E
enhancement factor
Definition: ConstitutiveRelation.H:287
void setA0(Real a_A0)
Definition: ConstitutiveRelation.H:304
RateFactor * getNewRateFactor() const
Definition: ConstitutiveRelation.H:201
virtual ConstitutiveRelation * getNewConstitutiveRelation() const =0
creates a new copy of this ConstitutiveRelation object.
Paterson Rate Factor.
Definition: ConstitutiveRelation.H:282
virtual void computeFaceMu(LevelData< FluxBox > &a_mu, LevelData< FArrayBox > &a_vel, const Real &a_scale, const LevelData< FArrayBox > *a_crseVel, int a_nRefCrse, const LevelData< FluxBox > &a_A, const LevelSigmaCS &a_coordSys, const ProblemDomain &a_domain, const IntVect &a_ghostVect=IntVect::Zero) const =0
compute face-centered effective viscosity based on cell-centered velocity
void computeStrainRateInvariant(LevelData< FArrayBox > &a_epsilonSquared, const LevelData< FArrayBox > &a_velocity, const LevelData< FArrayBox > *a_crseVel, int nRefCrse, const LevelSigmaCS &a_coordSys, const IntVect &a_ghostVect=IntVect::Zero) const
compute cell-centered strainrate invariant epsilon^2
Definition: ConstitutiveRelation.cpp:25
Real m_T0
limit temperature in flow-rate factor
Definition: ConstitutiveRelation.H:291
virtual ~RateFactor()
Definition: ConstitutiveRelation.H:161
void computeA(LevelData< FArrayBox > &a_A, const Vector< Real > &a_sigma, const LevelSigmaCS &a_coordSys, const RateFactor *a_rateFactor, const LevelData< FArrayBox > &a_internalEnergy)
compute cell centered rate factor A from the temperature
Definition: IceUtility.cpp:287
Basic Sigma fourth-order coordinate system on an AMR level.
Definition: LevelSigmaCS.H:48
Real m_A0
flow rate factor
Definition: ConstitutiveRelation.H:289
virtual ~ConstitutiveRelation()
Definition: ConstitutiveRelation.H:44
Constant Rate Factor.
Definition: ConstitutiveRelation.H:178
Arrhenius Rate Factor.
Definition: ConstitutiveRelation.H:215
ConstitutiveRelation()
Definition: ConstitutiveRelation.H:42
virtual void computeDissipation(LevelData< FArrayBox > &a_dissipation, const LevelData< FArrayBox > &a_cellVel, const LevelData< FArrayBox > *a_crseVel, int nRefCrse, const LevelData< FArrayBox > &a_A, const LevelSigmaCS &a_coordSys, const ProblemDomain &a_domain, const IntVect &a_ghostVect=IntVect::Zero) const =0
Compute a cell centred bulk dissipation (heat source) at the cell centres. This ought to have the sa...
void computeStrainRateInvariantFace(LevelData< FluxBox > &a_epsilonSquared, LevelData< FArrayBox > &a_velocity, const LevelData< FArrayBox > *a_crseVel, int a_nRefCrse, const LevelSigmaCS &a_coordSys, const IntVect &a_ghostVect=IntVect::Zero) const
compute face-centered strainrate invariant epsilon^2 based on cell-centered velocity ...
Definition: ConstitutiveRelation.cpp:41