www.mooseframework.org
RichardsExcavGeom.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "RichardsExcavGeom.h"
11 
13 
16 {
19  "start_posn",
20  "Start point of the excavation. This is an (x,y,z) point in the middle of the "
21  "coal face at the very beginning of the panel.");
22  params.addRequiredParam<Real>("start_time", "Commencement time of the excavation");
23  params.addRequiredParam<RealVectorValue>("end_posn",
24  "End position of the excavation. This is "
25  "an (x,y,z) point in the middle of the coal "
26  "face at the very end of the panel.");
27  params.addRequiredParam<Real>("end_time", "Time at the completion of the excavation");
28  params.addRequiredParam<Real>("active_length",
29  "This function is only active at a point if the "
30  "distance between the point and the coal face <= "
31  "active_length.");
32  params.addParam<Real>("true_value",
33  1.0,
34  "Return this value if a point is in the active zone. "
35  "This is usually used for controlling "
36  "permeability-changes");
37  params.addParam<Real>(
38  "deactivation_time", 1.0E30, "Time at which this function is totally turned off");
39  params.addClassDescription("This function defines excavation geometry. It can be used to "
40  "enforce pressures at the boundary of excavations, and to record "
41  "fluid fluxes into excavations.");
42  return params;
43 }
44 
46  : Function(parameters),
47  _start_posn(getParam<RealVectorValue>("start_posn")),
48  _start_time(getParam<Real>("start_time")),
49  _end_posn(getParam<RealVectorValue>("end_posn")),
50  _end_time(getParam<Real>("end_time")),
51  _active_length(getParam<Real>("active_length")),
52  _true_value(getParam<Real>("true_value")),
53  _deactivation_time(getParam<Real>("deactivation_time")),
54  _retreat_vel(_end_posn - _start_posn)
55 {
56  if (_start_time >= _end_time)
57  mooseError("Start time for excavation set to ",
59  " but this must be less than the end time, which is ",
60  _end_time);
61  _retreat_vel /= (_end_time - _start_time); // this is now a velocity
63 }
64 
65 Real
66 RichardsExcavGeom::value(Real t, const Point & p) const
67 {
68  if (t < _start_time || (p - _start_posn) * _retreat_vel < 0)
69  // point is behind start posn - it'll never be active
70  return 0.0;
71 
72  if (t >= _deactivation_time)
73  return 0.0;
74 
75  RealVectorValue current_posn;
76  if (t >= _end_time)
77  current_posn = _end_posn;
78  else
79  current_posn = _start_posn + (t - _start_time) * _retreat_vel;
80 
81  Real distance_into_goaf = (current_posn - p) * _retreat_vel / _norm_retreat_vel;
82 
83  if (distance_into_goaf < 0)
84  // point is ahead of current_posn
85  return 0.0;
86 
87  if (distance_into_goaf > _active_length)
88  // point is too far into goaf
89  return 0.0;
90 
91  return _true_value;
92 }
Real _deactivation_time
deactivation time
auto norm() const -> decltype(std::norm(Real()))
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
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)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RealVectorValue _retreat_vel
retreat velocity
void mooseError(Args &&... args) const
RealVectorValue _start_posn
start position
void addClassDescription(const std::string &doc_string)
Defines excavation geometry.
RealVectorValue _end_posn
end position
registerMooseObject("RichardsApp", RichardsExcavGeom)
static InputParameters validParams()
static InputParameters validParams()