BISICLES AMR ice sheet model  0.9
MarineIBC.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 //
12 // MarineIBC.H
13 // ============
14 //
15 // PhysIBC-derived class for grounding-line testing
16 // An alternative to Dan's VieliPayneIBC class which
17 // imposes the boundary condition through a source
18 // term s = 1/Dx * 0.5 * ri/rw * (ri - rw) * g * H^2
19 // (rather than setting grad(u).n)
20 
21 #ifndef _MARINEIBC_H_
22 #define _MARINEIBC_H_
23 
24 #include "IceThicknessIBC.H"
25 #include "RealFunction.H"
26 #include "BCFunc.H"
27 #include "NamespaceHeader.H"
28 
29 
30 class MISOMIPBedrockElevation : public RealFunction<RealVect>
31 {
32  //shallow parameters
33  Real B0;
34  Real B2;
35  Real B4;
36  Real B6;
37 
38 public:
39  MISOMIPBedrockElevation() : B0(-150.0), B2(-728.8), B4(343.91), B6(-50.57)
40  {;}
41 
42  Real operator()(const RealVect& x)
43  {
44  Real y = x[1] - 40e3;
45  Real topography = Bx(x[0]) + By(y,4.0e+3,5.0e+2,24.0e+3);
46  topography = max(topography, -720.0);
47  return topography;
48  }
49 
50 protected:
51  Real Bx(const Real x)
52  {
53  Real xx = x/300.0e3;
54  Real xx2 = xx*xx;
55  Real xx4 = xx2*xx2;
56  Real xx6 = xx4*xx2;
57  return B0 + B2*xx2 + B4*xx4 + B6*xx6;
58  }
59 
60  Real By(const Real y, const Real fc, const Real dc, const Real wc)
61  {
62  return dc/(1.0+exp(-2.0*(y-wc)/fc)) + dc/(1.0+exp(2.0*(y+wc)/fc));
63  }
64 
65 
66 
67 };
68 
69 
70 class SchoofBedrockElevation : public RealFunction<RealVect>
71 {
72  Real m_lengthScale;
73  Real m_originElevation;
74  Real m_coeff2, m_coeff4, m_coeff6;
75 public:
76 
77  SchoofBedrockElevation(Real a_lengthScale, Real a_originElevation,
78  Real a_coeff2, Real a_coeff4, Real a_coeff6)
79  : m_lengthScale(a_lengthScale),m_originElevation(a_originElevation),
80  m_coeff2(a_coeff2),m_coeff4(a_coeff4),m_coeff6(a_coeff6)
81  {;}
82 
83  Real operator()(const RealVect& x)
84  {
85  Real x2 = x[0]*x[0]/ (0.25*m_lengthScale*m_lengthScale);
86  Real x4 = x2 * x2;
87  Real x6 = x4 * x2;
88 
89  return m_originElevation + m_coeff2 * x2 + m_coeff4 * x4 + m_coeff6*x6;
90 
91  }
92 
93 };
94 
95 class KatzBedrockElevation : public RealFunction<RealVect>
96 {
97  Real m_domainLength, m_domainWidth;
98  // channel width, background slope parameters
99  Real m_originElevation, m_alpha, m_sigma, m_s;
100  // profile in the channel
101  SchoofBedrockElevation m_channelProfile;
102 
103 public:
104 
105  KatzBedrockElevation(Real a_domainLength, Real a_domainWidth,
106  Real a_originElevation, Real a_alpha, Real a_sigma,
107  Real a_lengthScaleFactor,
108  Real a_coeff2, Real a_coeff4, Real a_coeff6)
109  : m_domainLength(a_domainLength), m_domainWidth(a_domainWidth),
110  m_originElevation(a_originElevation), m_alpha(a_alpha), m_sigma(a_sigma),
111  m_channelProfile(a_lengthScaleFactor*a_domainLength,
112  a_originElevation, a_coeff2,
113  a_coeff4, a_coeff6)
114  {
115  m_s =1.0 / ( 2.0 * m_sigma * m_sigma);
116  }
117 
118  Real operator()(const RealVect& x)
119  {
120 
121  Real y = x[1]-m_domainWidth/2.0;
122  Real G = std::exp(-y*y * m_s);
123 
124  return (m_alpha*x[0] + m_originElevation)*(1.0 - G)
125  + m_channelProfile(x) * G;
126 
127  }
128 
129 
130 };
131 
132 
134 
138 {
139 public:
141 
143  MarineIBC();
144 
146 
148  virtual ~MarineIBC();
149 
151 
155  virtual void define(const ProblemDomain& a_domain,
156  const Real& a_dx);
157 
158  void setParameters(RefCountedPtr<RealFunction<RealVect > > a_thicknessFunction,
159  RefCountedPtr<RealFunction<RealVect > > a_bedrockFunction,
160  const Real& a_seaLevel);
161 
162 
163  // Vector of bedrockFunctions allows for simple composition to create geometries
164  void setParameters(RefCountedPtr<RealFunction<RealVect > > a_thicknessFunction,
165  Vector<RefCountedPtr<RealFunction<RealVect > > > a_bedrockFunction,
166  const Real& a_seaLevel);
167 
168  // /// set parameters : inclined plane geomety
169  // void setParameters(const Real& a_thickness,
170  // const Real& a_originElevation,
171  // const RealVect& a_slope,
172  // const Real& a_seaLevel);
173 
174  // //set parameters : katz geometry
175  // void setParametersKatz(const Real& a_thickness,
176  // const Real& a_domainLength,
177  // const Real& a_domainWidth,
178  // const Real& a_originElevation,
179  // const Real& a_alpha,
180  // const Real& a_sigma,
181  // const Real& a_coeff2,
182  // const Real& a_coeff4,
183  // const Real& a_coeff6,
184  // const Real& a_seaLevel);
185 
186 
188 
193  virtual IceThicknessIBC* new_thicknessIBC();
194 
195 #if 0
196  void setBoundaryThickness(Real a_boundaryThickness)
198  { m_boundaryThickness = a_boundaryThickness; }
199 #endif
200 
202 
204  virtual void initialize(LevelData<FArrayBox>& a_U);
205 
206  bool regridIceGeometry(LevelSigmaCS& a_coords,
207  const RealVect& a_dx,
208  const RealVect& a_domainSize,
209  const Real& a_time,
210  const LevelSigmaCS* a_crseCoords,
211  const int a_refRatio);
212 
214 
216  virtual void initializeIceGeometry(LevelSigmaCS& a_coords,
217  const RealVect& a_dx,
218  const RealVect& a_domainSize,
219  const Real& a_time,
220  const LevelSigmaCS* a_crseCoords,
221  const int a_refRatio);
222 
223 
225 
227  virtual void primBC(FArrayBox& a_WGdnv,
228  const FArrayBox& a_Wextrap,
229  const FArrayBox& a_W,
230  const int& a_dir,
231  const Side::LoHiSide& a_side,
232  const Real& a_time);
233 
235 
240  virtual
241  void setBdrySlopes(FArrayBox& a_dW,
242  const FArrayBox& a_W,
243  const int& a_dir,
244  const Real& a_time);
245 
247 
249  virtual
250  void artViscBC(FArrayBox& a_F,
251  const FArrayBox& a_U,
252  const FArrayBox& a_divVel,
253  const int& a_dir,
254  const Real& a_time);
255 
257 
259  virtual RefCountedPtr<CompGridVTOBC> velocitySolveBC();
260 
262 
268  virtual void modifyVelocityRHS(LevelData<FArrayBox>& a_rhs,
269  LevelSigmaCS& a_coords,
270  const ProblemDomain& a_domain,
271  Real a_time, Real a_dt)
272  {;}
273 
274 
276  virtual void setSurfaceHeightBCs(LevelData<FArrayBox>& a_zSurface,
277  LevelSigmaCS& a_coords,
278  const ProblemDomain& a_domain,
279  const RealVect& a_dx,
280  Real a_time, Real a_dt);
282  virtual void setGeometryBCs(LevelSigmaCS& a_coords,
283  const ProblemDomain& a_domain,
284  const RealVect& a_dx,
285  Real a_time, Real a_dt);
286 
287 
289 
293  static RealVect s_edgeThickness;
294 
295 protected:
296 
297  Vector<RefCountedPtr<RealFunction<RealVect> > > m_bedrockFunction;
298  RefCountedPtr<RealFunction<RealVect> > m_thicknessFunction;
299 
300  RealVect m_slope;
301 
304 
307 
308  RealVect m_domainSize;
309 
311 
312  // have bc's been set up?
314 
315  // have parameters been set
317 
319  void setupBCs();
320 
321  RefCountedPtr<CompGridVTOBC> m_velBCs;
322 
323 
324 private:
325  // Disallowed for all the usual reasons
326  void operator=(const MarineIBC& a_input)
327  {
328  MayDay::Error("invalid operator");
329  }
330 
331  // Disallowed for all the usual reasons
332  MarineIBC(const MarineIBC& a_input)
333  {
334  MayDay::Error("invalid operator");
335  }
336 };
337 
338 #include "NamespaceFooter.H"
339 #endif
Real operator()(const RealVect &x)
Definition: MarineIBC.H:42
Real m_seaLevel
Definition: MarineIBC.H:310
MISOMIPBedrockElevation()
Definition: MarineIBC.H:39
RefCountedPtr< CompGridVTOBC > m_velBCs
Definition: MarineIBC.H:321
Real m_originElevation
Definition: MarineIBC.H:303
Real operator()(const RealVect &x)
Definition: MarineIBC.H:118
Real m_thickness
ice sheet thickness (initially constant)
Definition: MarineIBC.H:306
static RealVect s_edgeThickness
ice thickness at edge of domain for use in computing velocity Bc&#39;s
Definition: MarineIBC.H:293
Real Bx(const Real x)
Definition: MarineIBC.H:51
Physical/domain initial and boundary conditions for ice-sheet problems.
Definition: IceThicknessIBC.H:84
Real operator()(const RealVect &x)
Definition: MarineIBC.H:83
Vector< RefCountedPtr< RealFunction< RealVect > > > m_bedrockFunction
Definition: MarineIBC.H:297
RefCountedPtr< RealFunction< RealVect > > m_thicknessFunction
Definition: MarineIBC.H:298
bool m_paramsSet
Definition: MarineIBC.H:316
Real By(const Real y, const Real fc, const Real dc, const Real wc)
Definition: MarineIBC.H:60
Physical/domain initial and boundary conditions.
Definition: MarineIBC.H:137
KatzBedrockElevation(Real a_domainLength, Real a_domainWidth, Real a_originElevation, Real a_alpha, Real a_sigma, Real a_lengthScaleFactor, Real a_coeff2, Real a_coeff4, Real a_coeff6)
Definition: MarineIBC.H:105
bool m_isBCsetUp
Definition: MarineIBC.H:313
Basic Sigma fourth-order coordinate system on an AMR level.
Definition: LevelSigmaCS.H:48
virtual void modifyVelocityRHS(LevelData< FArrayBox > &a_rhs, LevelSigmaCS &a_coords, const ProblemDomain &a_domain, Real a_time, Real a_dt)
if appropriate, modify velocity solve RHS in a problem-dependent way.
Definition: MarineIBC.H:268
SchoofBedrockElevation(Real a_lengthScale, Real a_originElevation, Real a_coeff2, Real a_coeff4, Real a_coeff6)
Definition: MarineIBC.H:77
RealVect m_domainSize
Definition: MarineIBC.H:308
Definition: MarineIBC.H:95
Definition: MarineIBC.H:30
RealVect m_slope
Definition: MarineIBC.H:300
Definition: MarineIBC.H:70
Definition: RealFunction.H:22