https://mooseframework.inl.gov
Loading...
Searching...
No Matches
WallFrictionFunctionMaterial.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
11#include "Function.h"
12
14
17{
19 params.addClassDescription("Defines a Darcy friction factor equal to the value of the function "
20 "at the local coordinates and time");
21 params.addRequiredParam<MaterialPropertyName>("f_D", "Darcy friction factor material property");
22
23 params.addRequiredParam<FunctionName>("function", "Darcy friction factor function");
24
25 params.addCoupledVar("beta", "Volume fraction equation variable: beta");
26 params.addRequiredCoupledVar("arhoA", "Mass equation variable: alpha*rho*A");
27 params.addRequiredCoupledVar("arhouA", "Momentum equation variable: alpha*rho*u*A");
28 params.addRequiredCoupledVar("arhoEA", "Energy equation variable: alpha*rho*E*A");
29
30 return params;
31}
32
35
36 _function(getFunction("function")),
37
38 _f_D_name(getParam<MaterialPropertyName>("f_D")),
39 _f_D(declareProperty<Real>(_f_D_name)),
40 _df_D_dbeta(isCoupled("beta") ? &declarePropertyDerivativeTHM<Real>(_f_D_name, "beta")
41 : nullptr),
42 _df_D_darhoA(declarePropertyDerivativeTHM<Real>(_f_D_name, "arhoA")),
43 _df_D_darhouA(declarePropertyDerivativeTHM<Real>(_f_D_name, "arhouA")),
44 _df_D_darhoEA(declarePropertyDerivativeTHM<Real>(_f_D_name, "arhoEA"))
45{
46}
47
48void
50{
51 _f_D[_qp] = _function.value(_t, _q_point[_qp]);
52
53 _df_D_darhoA[_qp] = 0;
54 _df_D_darhouA[_qp] = 0;
55 _df_D_darhoEA[_qp] = 0;
56 if (isCoupled("beta"))
57 (*_df_D_dbeta)[_qp] = 0;
58}
registerMooseObject("ThermalHydraulicsApp", WallFrictionFunctionMaterial)
virtual Real value(Real t, const Point &p) const
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)
void addCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
Converts Darcy friction factor function into material property.
MaterialProperty< Real > & _df_D_darhouA
MaterialProperty< Real > & _df_D_darhoEA
WallFrictionFunctionMaterial(const InputParameters &parameters)
MaterialProperty< Real > & _df_D_darhoA