www.mooseframework.org
RichardsExcavGeom.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "RichardsExcavGeom.h"
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<Function>();
15  params.addRequiredParam<RealVectorValue>(
16  "start_posn",
17  "Start point of the excavation. This is an (x,y,z) point in the middle of the "
18  "coal face at the very beginning of the panel.");
19  params.addRequiredParam<Real>("start_time", "Commencement time of the excavation");
20  params.addRequiredParam<RealVectorValue>("end_posn",
21  "End position of the excavation. This is "
22  "an (x,y,z) point in the middle of the coal "
23  "face at the very end of the panel.");
24  params.addRequiredParam<Real>("end_time", "Time at the completion of the excavation");
25  params.addRequiredParam<Real>("active_length",
26  "This function is only active at a point if the "
27  "distance between the point and the coal face <= "
28  "active_length.");
29  params.addParam<Real>("true_value",
30  1.0,
31  "Return this value if a point is in the active zone. "
32  "This is usually used for controlling "
33  "permeability-changes");
34  params.addParam<Real>(
35  "deactivation_time", 1.0E30, "Time at which this function is totally turned off");
36  params.addClassDescription("This function defines excavation geometry. It can be used to "
37  "enforce pressures at the boundary of excavations, and to record "
38  "fluid fluxes into excavations.");
39  return params;
40 }
41 
42 RichardsExcavGeom::RichardsExcavGeom(const InputParameters & parameters)
43  : Function(parameters),
44  _start_posn(getParam<RealVectorValue>("start_posn")),
45  _start_time(getParam<Real>("start_time")),
46  _end_posn(getParam<RealVectorValue>("end_posn")),
47  _end_time(getParam<Real>("end_time")),
48  _active_length(getParam<Real>("active_length")),
49  _true_value(getParam<Real>("true_value")),
50  _deactivation_time(getParam<Real>("deactivation_time")),
51  _retreat_vel(_end_posn - _start_posn)
52 {
53  if (_start_time >= _end_time)
54  mooseError("Start time for excavation set to ",
56  " but this must be less than the end time, which is ",
57  _end_time);
58  _retreat_vel /= (_end_time - _start_time); // this is now a velocity
60 }
61 
62 Real
63 RichardsExcavGeom::value(Real t, const Point & p)
64 {
65  if (t < _start_time || (p - _start_posn) * _retreat_vel < 0)
66  // point is behind start posn - it'll never be active
67  return 0.0;
68 
69  if (t >= _deactivation_time)
70  return 0.0;
71 
72  RealVectorValue current_posn;
73  if (t >= _end_time)
74  current_posn = _end_posn;
75  else
76  current_posn = _start_posn + (t - _start_time) * _retreat_vel;
77 
78  Real distance_into_goaf = (current_posn - p) * _retreat_vel / _norm_retreat_vel;
79 
80  if (distance_into_goaf < 0)
81  // point is ahead of current_posn
82  return 0.0;
83 
84  if (distance_into_goaf > _active_length)
85  // point is too far into goaf
86  return 0.0;
87 
88  return _true_value;
89 }
Real _deactivation_time
deactivation time
InputParameters validParams< RichardsExcavGeom >()
Real _true_value
true value to return
Real _norm_retreat_vel
norm of retreat velocity
Real _end_time
end time
Real _active_length
active length
Real _start_time
start time
RichardsExcavGeom(const InputParameters &parameters)
RealVectorValue _retreat_vel
retreat velocity
RealVectorValue _start_posn
start position
RealVectorValue _end_posn
end position
virtual Real value(Real t, const Point &p)