https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConvectiveFluxBC.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
10#include "ConvectiveFluxBC.h"
11
13
16{
18 params.set<Real>("rate") = 7500;
19 params.set<Real>("initial") = 500;
20 params.set<Real>("final") = 500;
21 params.set<Real>("duration") = 0.0;
23 "Determines boundary values via the initial and final values, flux, and exposure duration");
24 return params;
25}
26
28 : IntegratedBC(parameters),
29 _initial(getParam<Real>("initial")),
30 _final(getParam<Real>("final")),
31 _rate(getParam<Real>("rate")),
32 _duration(getParam<Real>("duration"))
33{
34}
35
36Real
38{
39 Real value;
40
41 if (_t < _duration)
42 value = _initial + (_final - _initial) * std::sin((0.5 / _duration) * libMesh::pi * _t);
43 else
44 value = _final;
45
46 return -(_test[_i][_qp] * _rate * (value - _u[_qp]));
47}
48
49Real
51{
52 return -(_test[_i][_qp] * _rate * (-_phi[_j][_qp]));
53}
registerMooseObject("MooseApp", ConvectiveFluxBC)
ConvectiveFluxBC(const InputParameters &parameters)
virtual Real computeQpJacobian() override
Method for computing the diagonal Jacobian at quadrature points.
static InputParameters validParams()
Factory constructor, takes parameters so that all derived classes can be built using the same constru...
Real _initial
Ratio of u to du/dn.
virtual Real computeQpResidual() override
Method for computing the residual at quadrature points.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
unsigned int _qp
quadrature point index
unsigned int _i
i-th, j-th index for enumerating test and shape functions
Base class for deriving any boundary condition of a integrated type.
const VariableValue & _u
the values of the unknown variable this BC is acting on
static InputParameters validParams()
const VariablePhiValue & _phi
shape function values (in QPs)
const VariableTestValue & _test
test function values (in QPs)
virtual const OutputTools< Real >::VariableValue & value()
The value of the variable this object is operating on.
const Real pi