Go to the documentation of this file.
20 InputParameters params = validParams<DiracKernel>();
21 params.addRequiredParam<std::vector<Real>>(
22 "pressures",
"Tuple of pressure values. Must be monotonically increasing.");
23 params.addRequiredParam<std::vector<Real>>(
25 "Tuple of flux values (measured in kg.m^-3.s^-1). A piecewise-linear fit is "
26 "performed to the (pressure,flux) pairs to obtain the flux at any arbitrary "
27 "pressure. If a quad-point pressure is less than the first pressure value, the "
28 "first flux value is used. If quad-point pressure exceeds the final pressure "
29 "value, the final flux value is used. This flux is OUT of the medium: hence "
30 "positive values of flux means this will be a SINK, while negative values indicate "
31 "this flux will be a SOURCE.");
32 params.addRequiredParam<FileName>(
34 "The file containing the coordinates of the point sinks that will approximate "
35 "the polyline. Each line in the file must contain a space-separated "
36 "coordinate. Note that you will get segementation faults if your points do "
37 "not lie within your mesh!");
38 params.addRequiredParam<UserObjectName>(
40 "User Object of type=RichardsSumQuantity in which to place the total "
41 "outflow from the polylinesink for each time step.");
42 params.addRequiredParam<UserObjectName>(
43 "richardsVarNames_UO",
"The UserObject that holds the list of Richards variable names.");
44 params.addClassDescription(
"Approximates a polyline sink in the mesh by using a number of point "
45 "sinks whose positions are read from a file");
50 : DiracKernel(parameters),
53 _sink_func(getParam<std::vector<Real>>(
"pressures"), getParam<std::vector<Real>>(
"fluxes")),
54 _point_file(getParam<FileName>(
"point_file")),
56 _pvar(_richards_name_UO.richards_var_num(_var.number())),
57 _pp(getMaterialProperty<std::vector<Real>>(
"porepressure")),
58 _dpp_dv(getMaterialProperty<std::vector<std::vector<Real>>>(
"dporepressure_dv"))
63 mooseError(
"Error opening file '" +
_point_file +
"' from RichardsPolyLineSink.");
65 std::vector<Real> scratch;
68 if (scratch.size() >= 1)
70 _xs.push_back(scratch[0]);
71 if (scratch.size() >= 2)
72 _ys.push_back(scratch[1]);
76 if (scratch.size() >= 3)
77 _zs.push_back(scratch[2]);
87 const std::vector<MooseVariableFEBase *> & coupled_vars =
_richards_name_UO.getCoupledMooseVars();
88 for (
unsigned int i = 0; i < coupled_vars.size(); i++)
89 addMooseVariableDependency(coupled_vars[i]);
99 if (getline(ifs, line))
104 std::istringstream iss(line);
122 for (
unsigned int i = 0; i <
_zs.size(); i++)
123 addPoint(Point(
_xs[i],
_ys[i],
_zs[i]), i);
129 Real test_fcn = _test[_i][_qp];
138 Real test_fcn = _test[_i][_qp];
149 Real test_fcn = _test[_i][_qp];
virtual Real computeQpResidual()
bool parseNextLineReals(std::ifstream &ifs, std::vector< Real > &myvec)
reads a space-separated line of floats from ifs and puts in myvec
void zero()
sets _total = 0
std::string _point_file
contains rows of the form x y z (space separated)
unsigned int richards_var_num(unsigned int moose_var_num) const
the richards variable number
unsigned int _pvar
The moose internal variable number of the richards variable of this Dirac Kernel.
const MaterialProperty< std::vector< Real > > & _pp
fluid porepressure (or porepressures in case of multiphase)
This holds maps between pressure_var or pressure_var, sat_var used in RichardsMaterial and kernels,...
std::vector< Real > _ys
vector of Dirac Points' y positions
RichardsPolyLineSink(const InputParameters ¶meters)
RichardsSumQuantity & _total_outflow_mass
This is used to hold the total fluid flowing into the sink Hence, it is positive for sinks where flui...
Approximates a polyline by a sequence of Dirac Points the mass flux from each Dirac Point is _sink_fu...
std::vector< Real > _zs
vector of Dirac Points' z positions
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
Computes the off-diagonal part of the jacobian Note: at March2014 this is never called since moose do...
InputParameters validParams< RichardsPolyLineSink >()
registerMooseObject("RichardsApp", RichardsPolyLineSink)
std::vector< Real > _xs
vector of Dirac Points' x positions
void add(Real contrib)
adds contrib to _total
const MaterialProperty< std::vector< std::vector< Real > > > & _dpp_dv
d(porepressure_i)/d(variable_j)
const RichardsVarNames & _richards_name_UO
Defines the richards variables in the simulation.
bool not_richards_var(unsigned int moose_var_num) const
returns true if moose_var_num is not a richards var
Sums into _total This is used, for instance, to record the total mass flowing into a borehole.
virtual Real computeQpJacobian()
LinearInterpolation _sink_func
mass flux = _sink_func as a function of porepressure