https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADMathFreeEnergy.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 "ADMathFreeEnergy.h"
11
13
16{
18 params.addClassDescription("Material that implements the math free energy and its derivatives: "
19 "\n$F = 1/4(1 + c)^2(1 - c)^2$");
20 params.addParam<MaterialPropertyName>("f_name", "F", "function property name");
21 params.addRequiredCoupledVar("c", "Concentration variable");
22 return params;
23}
24
26 : Material(parameters),
27 _c(adCoupledValue("c")),
28 _f_name(getParam<MaterialPropertyName>("f_name")),
29 _prop_F(declareADProperty<Real>(_f_name)),
30 _prop_dFdc(
31 declareADProperty<Real>(derivativePropertyNameFirst(_f_name, this->coupledName("c", 0))))
32{
33}
34
35void
37{
38 _prop_F[_qp] = 1.0 / 4.0 * (1.0 + _c[_qp]) * (1.0 + _c[_qp]) * (1.0 - _c[_qp]) * (1.0 - _c[_qp]);
39 _prop_dFdc[_qp] = _c[_qp] * (_c[_qp] * _c[_qp] - 1.0);
40}
registerMooseObject("PhaseFieldApp", ADMathFreeEnergy)
Material class that creates the math free energy and its derivatives for use with ADSplitCHParsed.
ADMathFreeEnergy(const InputParameters &parameters)
const ADVariableValue & _c
Coupled variable value for the concentration .
virtual void computeQpProperties()
ADMaterialProperty< Real > & _prop_F
function value
ADMaterialProperty< Real > & _prop_dFdc
function value derivative
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
static InputParameters validParams()