https://mooseframework.inl.gov
Loading...
Searching...
No Matches
phase_field
src
postprocessors
PFCElementEnergyIntegral.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 "
PFCElementEnergyIntegral.h
"
11
12
// MOOSE includes
13
#include "
MooseVariable.h
"
14
15
registerMooseObject
(
"PhaseFieldApp"
,
PFCElementEnergyIntegral
);
16
17
InputParameters
18
PFCElementEnergyIntegral::validParams
()
19
{
20
InputParameters
params =
ElementIntegralPostprocessor::validParams
();
21
params.
addClassDescription
(
"Computes the integral of the energy from the temperature. Note that "
22
"the kb factor is missing."
);
23
params.
addRequiredParam
<VariableName>(
"variable"
,
24
"The name of the variable that this object operates on"
);
25
params.
addParam
<Real>(
"temp"
, 1833.0,
"Temperature of simulation"
);
26
return
params;
27
}
28
29
PFCElementEnergyIntegral::PFCElementEnergyIntegral
(
const
InputParameters
& parameters)
30
:
ElementIntegralPostprocessor
(parameters),
31
MooseVariableInterface
<Real>(this,
32
false,
33
"variable"
,
34
Moose
::VarKindType::VAR_ANY,
35
Moose
::VarFieldType::VAR_FIELD_STANDARD),
36
_var(_subproblem.getStandardVariable(_tid, parameters.get<VariableName>(
"variable"
))),
37
_u(_var.sln()),
38
_grad_u(_var.gradSln()),
39
_u_dot(_var.uDot()),
40
_temp(getParam<Real>(
"temp"
))
// K
41
{
42
// TODO: error on unused parameters
43
addMooseVariableDependency
(&
mooseVariableField
());
44
}
45
46
Real
47
PFCElementEnergyIntegral::computeQpIntegral
()
48
{
49
// const Real kb = 1.3806488e-23; // A^2 kg s^-2 K^-1
50
// const Real p0 = 0.0801; // A^-3
51
52
return
_u
[
_qp
];
// * (kb * _temp);
53
}
MooseVariable.h
registerMooseObject
registerMooseObject("PhaseFieldApp", PFCElementEnergyIntegral)
PFCElementEnergyIntegral.h
ElementIntegralPostprocessor
ElementIntegralPostprocessor::_qp
unsigned int _qp
ElementIntegralPostprocessor::validParams
static InputParameters validParams()
InputParameters::addRequiredParam
void addRequiredParam(const std::string &name, const std::string &doc_string)
InputParameters::addParam
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
InputParameters::addClassDescription
void addClassDescription(const std::string &doc_string)
ElementIntegralPostprocessor::addMooseVariableDependency
void addMooseVariableDependency(MooseVariableFieldBase *var)
MooseVariableInterface
MooseVariableInterface< Real >::mooseVariableField
MooseVariableField< T > & mooseVariableField()
PFCElementEnergyIntegral
Compute a volume integral of the specified variable.
Definition
PFCElementEnergyIntegral.h:25
PFCElementEnergyIntegral::PFCElementEnergyIntegral
PFCElementEnergyIntegral(const InputParameters ¶meters)
Definition
PFCElementEnergyIntegral.C:29
PFCElementEnergyIntegral::computeQpIntegral
virtual Real computeQpIntegral()
Definition
PFCElementEnergyIntegral.C:47
PFCElementEnergyIntegral::validParams
static InputParameters validParams()
Definition
PFCElementEnergyIntegral.C:18
PFCElementEnergyIntegral::_u
const VariableValue & _u
Holds the solution at current quadrature points.
Definition
PFCElementEnergyIntegral.h:37
Moose
InputParameters
Generated on Fri Aug 21 2026 13:41:26 for https://mooseframework.inl.gov by
1.9.8