https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowPointEnthalpySourceFromPostprocessor.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<PostprocessorName>(
20 "mass_flux",
21 "The postprocessor name holding the mass flux of injected fluid at this point in kg/s "
22 "(please ensure this is positive so that this object acts like a source)");
23 params.addRequiredParam<UserObjectName>(
24 "fp",
25 "The name of the user object used to calculate the fluid properties of the injected fluid");
27 "pressure", "Pressure used to calculate the injected fluid enthalpy (measured in Pa)");
28 params.addRequiredParam<PostprocessorName>(
29 "T_in", "The postprocessor name holding the temperature of injected fluid (measured in K)");
30 params.addRequiredParam<Point>("point", "The x,y,z coordinates of the point source");
31 params.addClassDescription("Point source that adds heat energy corresponding to injection of a "
32 "fluid with specified mass flux rate (specified by a postprocessor) "
33 "at given temperature (specified by a postprocessor)");
34 return params;
35}
36
38 const InputParameters & parameters)
39 : DiracKernel(parameters),
40 _mass_flux(getPostprocessorValue("mass_flux")),
41 _pressure(coupledValue("pressure")),
42 _T_in(getPostprocessorValue("T_in")),
43 _fp(getUserObject<SinglePhaseFluidProperties>("fp")),
44 _p(getParam<Point>("point")),
45 _p_var_num(coupled("pressure"))
46{
47}
48
49void
54
55Real
57{
58 // Negative sign to make a positive mass_flux in the input file a source
59 Real h = _fp.h_from_p_T(_pressure[_qp], _T_in);
60 return -_test[_i][_qp] * _mass_flux * h;
61}
62
63Real
68
69Real
71{
72 if (jvar == _p_var_num)
73 {
74 Real h, dh_dp, dh_dT;
75 _fp.h_from_p_T(_pressure[_qp], _T_in, h, dh_dp, dh_dT);
76 return -_test[_i][_qp] * _phi[_j][_qp] * _mass_flux * dh_dp;
77 }
78 else
79 return 0.;
80}
registerMooseObject("PorousFlowApp", PorousFlowPointEnthalpySourceFromPostprocessor)
unsigned int _i
unsigned int _qp
void addPoint(const Elem *elem, Point p, unsigned id=libMesh::invalid_uint, Real value=1.0)
unsigned int _j
static InputParameters validParams()
const OutputTools< T >::VariablePhiValue & _phi
const OutputTools< T >::VariableTestValue & _test
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Point source that adds heat energy corresponding to adding a fluid with flux rate specified by a post...
const SinglePhaseFluidProperties & _fp
Fluid properties UserObject.
const PostprocessorValue & _mass_flux
The constant mass flux (kg/s)
Common class for single phase fluid properties.