https://mooseframework.inl.gov
Loading...
Searching...
No Matches
InterfaceQpValueUserObject.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
13
16{
18 params.addRequiredCoupledVar("var", "The variable name");
19 params.addCoupledVar("var_neighbor", "The neighbor variable name");
21 "Computes the variable value, rate or increment across an "
22 "interface. The value, rate or increment is computed according to the provided "
23 "interface_value_type parameter");
24 return params;
25}
26
28 : InterfaceQpUserObjectBase(parameters),
29 _u(_value_type > 0 ? coupledDot("var") : coupledValue("var")),
30 _u_neighbor(
31 parameters.isParamSetByUser("var_neighbor")
32 ? (_value_type > 0 ? coupledNeighborValueDot("var_neighbor")
33 : coupledNeighborValue("var_neighbor"))
34 : (_value_type > 0 ? coupledNeighborValueDot("var") : coupledNeighborValue("var")))
35
36{
37}
38
39Real
41{
42 /* civet complains about fall through, let's fix this using some extra code */
43 switch (_value_type)
44 {
45 case 0: /*value*/
47 case 1: /*rate*/
49 case 2: /*increment*/
50 return computeInterfaceValueType(_u[qp] * _dt, _u_neighbor[qp] * _dt);
51 default:
52 mooseError("InterfaceQpValueUserObject::computeRealValue the supplied "
53 "value type has not been implemented");
54 }
55 mooseError("InterfaceQpValueUserObject::computeRealValue if we are here something is wrong");
56}
registerMooseObject("MooseApp", InterfaceQpValueUserObject)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
void addCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
This is a base class for userobjects collecting values of variables or material properites across an ...
static InputParameters validParams()
const MooseEnum _value_type
moose enum deciding this userobject reture value type
Specialization of InterfaceQpUserObjectBase for scalar variables.
virtual Real computeRealValue(const unsigned int qp) override
method to overrid in child classes returnig a real value
const VariableValue & _u
the variable and neighbor variable values or rate
static InputParameters validParams()
InterfaceQpValueUserObject(const InputParameters &parameters)
virtual Real computeInterfaceValueType(const Real, const Real)
method computing an interface value give two Real quantities
Real & _dt
Time step size.