www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PFCEnergyDensity Class Reference

#include <PFCEnergyDensity.h>

Inheritance diagram for PFCEnergyDensity:
[legend]

Public Member Functions

 PFCEnergyDensity (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

std::vector< const VariableValue * > _vals
 
std::vector< const MaterialProperty< Real > * > _coeff
 
unsigned int _order
 
const MaterialProperty< Real > & _a
 
const MaterialProperty< Real > & _b
 

Detailed Description

Definition at line 21 of file PFCEnergyDensity.h.

Constructor & Destructor Documentation

◆ PFCEnergyDensity()

PFCEnergyDensity::PFCEnergyDensity ( const InputParameters &  parameters)

Definition at line 24 of file PFCEnergyDensity.C.

25  : AuxKernel(parameters),
26  _order(coupledComponents("v")),
27  _a(getMaterialProperty<Real>("a")),
28  _b(getMaterialProperty<Real>("b"))
29 {
30  _vals.resize(_order);
31  _coeff.resize(_order);
32 
33  std::string coeff_name_base = "C";
34 
35  for (unsigned int i = 0; i < _order; ++i)
36  {
37  _vals[i] = &coupledValue("v", i);
38  std::string coeff_name = coeff_name_base;
39  std::stringstream out;
40  out << i * 2;
41  coeff_name.append(out.str());
42  _console << coeff_name << std::endl;
43  _coeff[i] = &getMaterialProperty<Real>(coeff_name);
44  }
45 }
const MaterialProperty< Real > & _a
std::vector< const VariableValue * > _vals
const MaterialProperty< Real > & _b
std::vector< const MaterialProperty< Real > * > _coeff
unsigned int _order

Member Function Documentation

◆ computeValue()

Real PFCEnergyDensity::computeValue ( )
protectedvirtual

Definition at line 48 of file PFCEnergyDensity.C.

49 {
50  Real val = Utility::pow<2>((*_vals[0])[_qp]) * (1.0 - (*_coeff[0])[_qp]) / 2.0;
51 
52  // Loop Through Variables
53  // the sign of negative terms have been taken care of by changing the sign of the coefficients;
54  for (unsigned int i = 1; i < _order; ++i)
55  val += (*_coeff[i])[_qp] * (*_vals[0])[_qp] * (*_vals[i])[_qp] / 2.0;
56 
57  val += (_b[_qp] / 12.0 * Utility::pow<4>((*_vals[0])[_qp])) -
58  (_a[_qp] / 6.0 * Utility::pow<3>((*_vals[0])[_qp]));
59 
60  return val;
61 }
const MaterialProperty< Real > & _a
std::vector< const VariableValue * > _vals
const MaterialProperty< Real > & _b
std::vector< const MaterialProperty< Real > * > _coeff
unsigned int _order

Member Data Documentation

◆ _a

const MaterialProperty<Real>& PFCEnergyDensity::_a
protected

Definition at line 33 of file PFCEnergyDensity.h.

Referenced by computeValue().

◆ _b

const MaterialProperty<Real>& PFCEnergyDensity::_b
protected

Definition at line 34 of file PFCEnergyDensity.h.

Referenced by computeValue().

◆ _coeff

std::vector<const MaterialProperty<Real> *> PFCEnergyDensity::_coeff
protected

Definition at line 30 of file PFCEnergyDensity.h.

Referenced by computeValue(), and PFCEnergyDensity().

◆ _order

unsigned int PFCEnergyDensity::_order
protected

Definition at line 32 of file PFCEnergyDensity.h.

Referenced by computeValue(), and PFCEnergyDensity().

◆ _vals

std::vector<const VariableValue *> PFCEnergyDensity::_vals
protected

Definition at line 29 of file PFCEnergyDensity.h.

Referenced by computeValue(), and PFCEnergyDensity().


The documentation for this class was generated from the following files: