BISICLES AMR ice sheet model  0.9
DamageConstitutiveRelation.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 _DAMAGECONSTITUTIVERELATION_H_
12 #define _DAMAGECONSTITUTIVERELATION_H_
13 
14 #include "ConstitutiveRelation.H"
15 #include "AMRDamage.H"
16 #include "NamespaceHeader.H"
18 
30 {
31  friend class AMRDamage;
32 
33  ConstitutiveRelation* m_undamagedConstitutiveRelation;
34  AMRDamage* m_damageModel;
35 
36 public:
37 
39  {
40  m_undamagedConstitutiveRelation = a_ptr->getNewConstitutiveRelation();
41  m_damageModel = a_damage;
42  }
43 
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;
66 
71 
81  virtual void computeDissipation(LevelData<FArrayBox>& a_dissipation,
82  const LevelData<FArrayBox>& a_vel,
83  const LevelData<FArrayBox>* a_crseVel,
84  int a_nRefCrse,
85  const LevelData<FArrayBox>& a_A,
86  const LevelSigmaCS& a_coordSys,
87  const ProblemDomain& a_domain,
88  const IntVect& a_ghostVect = IntVect::Zero) const;
89 
90  // computes face-centered \f$\mu_{AS}\f$ based on cell-centered velocity
101  virtual void computeFaceMu(LevelData<FluxBox>& a_mu,
102  LevelData<FArrayBox>& a_vel, const Real& a_scale,
103  const LevelData<FArrayBox>* a_crseVel,
104  int a_nRefCrse,
105  const LevelData<FluxBox>& a_A,
106  const LevelSigmaCS& a_coordSys,
107  const ProblemDomain& a_domain,
108  const IntVect& a_ghostVect = IntVect::Zero) const;
109 
110 
111 
112 
113 
116 
117 private:
118 
119  DamageConstitutiveRelation() : m_undamagedConstitutiveRelation(NULL)
120 
121  {;}
122 
123 
124 
125  int level(const ProblemDomain& a_domain) const
126  {
127  CH_assert(m_damageModel != NULL); // for now, we will say there *has* to be a damage model
128  //FIXME this is a bit klugey... we need to work out access various levels from
129  // m_damageModel but we typically don't know which level that we are (no level argument), so for
130  //now (maybe we will change the ConstitutiveRelation interface later)
131  //work it out by comparing domain boxes
132  int lev = 0;
133  while ( a_domain.domainBox() !=
134  m_damageModel->damage(lev)->disjointBoxLayout().physDomain().domainBox())
135  {
136  lev++;
137  CH_assert( lev <= m_damageModel->finestLevel());
138  }
139  return lev;
140  }
141 
143  static void modifyMu
144  (FArrayBox& a_damage,
145  FArrayBox& a_mu,
146  const FArrayBox& a_transportedDamage,
147  const FArrayBox& a_thck,
148  const Box& a_box) ;
149 
151  static void computeLocalDamage
152  (FArrayBox& a_damage,
153  const FArrayBox& a_mu,
154  const FArrayBox& a_gradU,
155  const FArrayBox& a_thck,
156  const FArrayBox& a_topg,
157  const FArrayBox& a_water,
158  const Real& a_rhoi,
159  const Real& a_rhow,
160  const Real& a_gravity,
161  const Real& a_sealevel,
162  const Box& a_box);
163 
165  static void computeLocalDamageVT
166  (FArrayBox& a_damage,
167  const FArrayBox& a_vt,
168  const FArrayBox& a_thck,
169  const FArrayBox& a_topg,
170  const FArrayBox& a_water,
171  const Real& a_rhoi,
172  const Real& a_rhow,
173  const Real& a_gravity,
174  const Real& a_sealevel,
175  const Box& a_box);
176 
177 
178  // computes face-centered effective viscoity and a damage coeffcient based on cell-centered velocity
192  virtual void computeFaceMuDamage(LevelData<FluxBox>& a_mu,
193  LevelData<FluxBox>& a_damage,
194  LevelData<FArrayBox>& a_vel, const Real& a_scale,
195  const LevelData<FArrayBox>* a_crseVel,
196  int a_nRefCrse,
197  const LevelData<FluxBox>& a_A,
198  const LevelSigmaCS& a_coordSys,
199  const ProblemDomain& a_domain,
200  const IntVect& a_ghostVect = IntVect::Zero) const;
201 
202 
203 };
204 
205 #include "NamespaceFooter.H"
206 #endif
Continuum damage model.
Definition: AMRDamage.H:30
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
computes cell-centered based on the cell-centered velocity
Definition: DamageConstitutiveRelation.cpp:38
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: DamageConstitutiveRelation.cpp:53
virtual ConstitutiveRelation * getNewConstitutiveRelation() const =0
creates a new copy of this ConstitutiveRelation object.
Computes the effective viscosity including a factor due to crevassing.
Definition: DamageConstitutiveRelation.H:29
const LevelData< FArrayBox > * damage(int a_level) const
Definition: AMRDamage.cpp:129
friend class DamageConstitutiveRelation
Definition: AMRDamage.H:33
int finestLevel() const
Definition: AMRDamage.H:60
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
Definition: DamageConstitutiveRelation.cpp:290
Basic Sigma fourth-order coordinate system on an AMR level.
Definition: LevelSigmaCS.H:48
virtual ConstitutiveRelation * getNewConstitutiveRelation() const
creates a new copy of this ConstitutiveRelation object.
Definition: DamageConstitutiveRelation.cpp:29
DamageConstitutiveRelation(ConstitutiveRelation *a_ptr, AMRDamage *a_damage)
Definition: DamageConstitutiveRelation.H:38
virtual ~DamageConstitutiveRelation()
Definition: DamageConstitutiveRelation.cpp:19