BISICLES AMR ice sheet model  0.9
L1L2ConstitutiveRelation.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 _L1L2CONSTITUTIVERELATION_H_
12 #define _L1L2CONSTITUTIVERELATION_H_
13 
14 #include "ConstitutiveRelation.H"
15 #include "IceThicknessIBC.H"
16 #include "NamespaceHeader.H"
17 
18 
19 #if BISICLES_Z == BISICLES_LAYERED
20 
37 {
38 
39  GlensFlowRelation glensFlowRelation;
40 
41 public:
44  :m_solverTol(1.0e-6),
45  m_additionalVelocitySIAGradSLimit(1.0e-2),
46  m_effectiveViscositySIAGradSLimit(1.0e+10),
47  m_additionalVelocitySIAOnly(true),
48  m_startFromAnalyticMu(false),
49  m_layerCoarsening(0)
50  {;}
52 
53  void parseParameters();
54 
56 
57  GlensFlowRelation* getGlensFlowRelationPtr()
58  { return &glensFlowRelation;}
59  GlensFlowRelation& getGlensFlowRelation()
60  { return glensFlowRelation;}
61 
62  virtual Real power() const
63  { return glensFlowRelation.power(); }
64 
67 
69 
80  virtual void computeMu(LevelData<FArrayBox>& a_mu,
81  const LevelData<FArrayBox>& a_vel, const Real& a_scale,
82  const LevelData<FArrayBox>* a_crseVelPtr,
83  int a_nRefCrse,
84  const LevelData<FArrayBox>& a_A,
85  const LevelSigmaCS& a_coordSys,
86  const ProblemDomain& a_domain,
87  const IntVect& a_ghostVect = IntVect::Zero) const;
88 
89 
93 
103  virtual void computeDissipation(LevelData<FArrayBox>& a_dissipation,
104  const LevelData<FArrayBox>& a_vel,
105  const LevelData<FArrayBox>* a_crseVel,
106  int a_nRefCrse,
107  const LevelData<FArrayBox>& a_A,
108  const LevelSigmaCS& a_coordSys,
109  const ProblemDomain& a_domain,
110  const IntVect& a_ghostVect = IntVect::Zero) const;
111 
113 
123  virtual void computeFaceMu(LevelData<FluxBox>& a_mu,
124  LevelData<FArrayBox>& a_vel, const Real& a_scale,
125  const LevelData<FArrayBox>* a_crseVelPtr,
126  int nRefCrse,
127  const LevelData<FluxBox>& a_A,
128  const LevelSigmaCS& a_coordSys,
129  const ProblemDomain& a_domain,
130  const IntVect& a_ghostVect = IntVect::Zero) const;
131 
132 
133 
135 
153  virtual void modifyTransportCoefficients
154  (const LevelData<FArrayBox>& a_cellVel,
155  const LevelData<FArrayBox>* a_crseVelPtr,
156  const LevelData<FArrayBox>* a_crseDiffusivityPtr,
157  int a_nRefCrse,
158  const LevelSigmaCS& a_coordSys,
159  const DisjointBoxLayout& a_grids,
160  const ProblemDomain& a_domain,
161  const LevelData<FArrayBox>& a_A,
162  const LevelData<FArrayBox>& a_sA,
163  const LevelData<FArrayBox>& a_bA,
164  LevelData<FluxBox>& a_faceVelAdvection,
165  LevelData<FluxBox>& a_faceVelTotal,
166  LevelData<FluxBox>& a_faceDiffusivity,
167  LevelData<FArrayBox>& a_cellDiffusivity,
168  LevelData<FluxBox>& a_layerXYFaceXYVel,
169  LevelData<FArrayBox>& a_layerSFaceXYVel) const;
170 
171 
173  void solverTolerance(Real a_solverTol)
174  { m_solverTol = a_solverTol; }
175 
176 
177 private:
182  virtual void computeMuZ(LevelData<FArrayBox>& a_mu,
183  LevelData<FArrayBox>& a_gradVel,
184  LevelData<FArrayBox>& a_epsSqr,
185  const Vector<Real>& a_sigma,
186  const LevelData<FArrayBox>& a_vel, const Real& a_scale,
187  const LevelData<FArrayBox>* a_crseVelPtr,
188  int a_nRefCrse,
189  const LevelData<FArrayBox>& a_A,
190  const LevelSigmaCS& a_coordSys,
191  const ProblemDomain& a_domain,
192  const IntVect& a_ghostVect = IntVect::Unit) const;
193 
194 
195 
196  //compute mu for given sigma at a_faceDir cell faces
200  virtual void computeFaceMuZ(LevelData<FluxBox>& a_mu,
201  LevelData<FluxBox>& a_gradVel,
202  LevelData<FluxBox>& a_epsSqr,
203  const Vector<Real>& a_sigma,
204  LevelData<FArrayBox>& a_vel, const Real& a_scale,
205  const LevelData<FArrayBox>* a_crseVelPtr,
206  int a_nRefCrse,
207  const LevelData<FluxBox>& a_A,
208  const LevelSigmaCS& a_coordSys,
209  const ProblemDomain& a_domain,
210  const IntVect& a_ghostVect) const;
211 
212 
217  virtual void computeEitherMuZ(FArrayBox& a_mu,
218  const Vector<Real>& a_sigma,
219  const FArrayBox& a_grads,
220  const FArrayBox& a_epsSqr,
221  const FArrayBox& a_A,const Real& a_scale,
222  const FArrayBox& a_H,
223  const Real& a_rhog,
224  const Box& a_box,
225  int a_layerCoarsen) const;
226 
229 
243  virtual void computeFaceFluxVelocity(LevelData<FArrayBox>& a_vel,
244  const LevelData<FArrayBox>* a_crseVelPtr,
245  int a_nRefCrse,
246  const LevelData<FArrayBox>& a_A,
247  const LevelData<FArrayBox>& a_thickness,
248  const RealVect& a_dx,
249  LevelData<FluxBox>& a_fluxVel,
250  LevelData<FluxBox>& a_layerXYFaceXYVel,
251  LevelData<FArrayBox>& a_layerSFaceXYVel,
252  const LevelSigmaCS& a_coordSys,
253  const ProblemDomain& a_domain,
254  const IntVect& a_cellGhost = IntVect::Zero) const;
255 
256 
257  // tolerance for the secant solve when computing mu
258  Real m_solverTol;
259  // if > 0, limit the magnitude of grad(s) when computing the SIA part of u(z) - u(z=base)
260  Real m_additionalVelocitySIAGradSLimit;
261  // if > 0, limit the magnitude of grad(s) when computing the effective viscosity
262  Real m_effectiveViscositySIAGradSLimit;
263  // neglect non SIA contribution to u(z) - u(z=base)
264  bool m_additionalVelocitySIAOnly;
265 
266  // for n = 3, there is an analytic solution to f(mu) = 0; sometimes
267  // it is preferable to start from that value
268  bool m_startFromAnalyticMu;
269 
270  // Set m_layerCoarsening > 0 to skip layers in expensive calculations and interpolate instead
271  int m_layerCoarsening;
272 
273 
274 };
275 #endif
276 #include "NamespaceFooter.H"
277 #endif
virtual void modifyTransportCoefficients(const LevelData< FArrayBox > &a_cellVel, const LevelData< FArrayBox > *a_crseVelPtr, const LevelData< FArrayBox > *a_crseDiffusivityPtr, int a_nRefCrse, const LevelSigmaCS &a_coordSys, const DisjointBoxLayout &a_grids, const ProblemDomain &a_domain, const LevelData< FArrayBox > &a_A, const LevelData< FArrayBox > &a_sA, const LevelData< FArrayBox > &a_bA, LevelData< FluxBox > &a_faceVelAdvection, LevelData< FluxBox > &a_faceVelTotal, LevelData< FluxBox > &a_faceDiffusivity, LevelData< FArrayBox > &a_cellDiffusivity, LevelData< FluxBox > &a_layerXYFaceXYVel, LevelData< FArrayBox > &a_layerSFaceXYVel) const
modify 2D thickness advection velocity and diffusion coefficients, also 3D ice velocity ...
Definition: L1L2ConstitutiveRelation.cpp:784
virtual ConstitutiveRelation * getNewConstitutiveRelation() const
creates a new copy of this ConstitutiveRelation object.
Definition: L1L2ConstitutiveRelation.cpp:31
Implemnets ConstitutiveRelation to give the effective viscosity in the L1L2 stress model...
Definition: L1L2ConstitutiveRelation.H:36
virtual void computeFaceMu(LevelData< FluxBox > &a_mu, LevelData< FArrayBox > &a_vel, const Real &a_scale, const LevelData< FArrayBox > *a_crseVelPtr, int nRefCrse, const LevelData< FluxBox > &a_A, const LevelSigmaCS &a_coordSys, const ProblemDomain &a_domain, const IntVect &a_ghostVect=IntVect::Zero) const
computes face-centered based on cell-centered velocity
Definition: L1L2ConstitutiveRelation.cpp:168
virtual void computeMu(LevelData< FArrayBox > &a_mu, const LevelData< FArrayBox > &a_vel, const Real &a_scale, const LevelData< FArrayBox > *a_crseVelPtr, int a_nRefCrse, const LevelData< FArrayBox > &a_A, const LevelSigmaCS &a_coordSys, const ProblemDomain &a_domain, const IntVect &a_ghostVect=IntVect::Zero) const
computes cell-centered based on the cell-centered velocity
Definition: L1L2ConstitutiveRelation.cpp:80
void solverTolerance(Real a_solverTol)
sets tolerance for secant solve
Definition: L1L2ConstitutiveRelation.H:173
Abstract class around the englacial constitutive relations for ice.
Definition: ConstitutiveRelation.H:34
GlensFlowRelation & getGlensFlowRelation()
Definition: L1L2ConstitutiveRelation.H:59
GlensFlowRelation * getGlensFlowRelationPtr()
Definition: L1L2ConstitutiveRelation.H:57
virtual void computeDissipation(LevelData< FArrayBox > &a_dissipation, const LevelData< FArrayBox > &a_vel, 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
Definition: L1L2ConstitutiveRelation.cpp:130
virtual ~L1L2ConstitutiveRelation()
Definition: L1L2ConstitutiveRelation.H:55
Basic Sigma fourth-order coordinate system on an AMR level.
Definition: LevelSigmaCS.H:48
void parseParameters()
Definition: L1L2ConstitutiveRelation.cpp:51
L1L2ConstitutiveRelation()
Definition: L1L2ConstitutiveRelation.H:43
virtual Real power() const
Definition: L1L2ConstitutiveRelation.H:62