https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowPlotPointFluxQuantity.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
12
14
17{
19 params.addRequiredParam<UserObjectName>(
20 "uo", "PorousFlowPointFluxQuantity user object name that holds the required information");
22 "Extracts the flux, and the coordinates, at each point of a line sink or Peaceman "
23 "borehole from a PorousFlowPointFluxQuantity UserObject. Note that the reported flux at "
24 "each point is summed over the test functions of the element containing that point, so "
25 "when nodal multiplicative factors (such as use_mobility) are active, it represents a "
26 "test-function-weighted combination of those nodal values rather than a single nodal "
27 "value.");
28 return params;
29}
30
32 : GeneralVectorPostprocessor(parameters),
33 _point_fluxes(getUserObject<PorousFlowPointFluxQuantity>("uo")),
34 _point_id(declareVector("point_id")),
35 _x(declareVector("x")),
36 _y(declareVector("y")),
37 _z(declareVector("z")),
38 _flux(declareVector("flux"))
39{
40}
41
42void
44{
45 _point_id.clear();
46 _x.clear();
47 _y.clear();
48 _z.clear();
49 _flux.clear();
50}
51
52void
54{
55 const std::vector<Real> & xs = _point_fluxes.getX();
56 const std::vector<Real> & ys = _point_fluxes.getY();
57 const std::vector<Real> & zs = _point_fluxes.getZ();
58 const std::vector<Real> & fluxes = _point_fluxes.getFluxes();
59
60 for (const auto i : index_range(fluxes))
61 {
62 _point_id.push_back(i);
63 _x.push_back(xs[i]);
64 _y.push_back(ys[i]);
65 _z.push_back(zs[i]);
66 _flux.push_back(fluxes[i]);
67 }
68}
registerMooseObject("PorousFlowApp", PorousFlowPlotPointFluxQuantity)
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Extracts the per-point flux, and the coordinates of each point, from a PorousFlowPointFluxQuantity us...
VectorPostprocessorValue & _x
Coordinates of each point.
VectorPostprocessorValue & _flux
Flux recorded at each point.
const PorousFlowPointFluxQuantity & _point_fluxes
The PorousFlowPointFluxQuantity userobject.
VectorPostprocessorValue & _point_id
Dirac point ID (0, 1, 2, ...) of each row.
PorousFlowPlotPointFluxQuantity(const InputParameters &parameters)
Records the instantaneous flux at each Dirac point of a PorousFlow line sink (such as PorousFlowPeace...
const std::vector< Real > & getY() const
const std::vector< Real > & getFluxes() const
Returns the flux recorded at each point.
const std::vector< Real > & getZ() const
const std::vector< Real > & getX() const
Returns the coordinates of each point.