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

#include <PFCRFFEnergyDensity.h>

Inheritance diagram for PFCRFFEnergyDensity:
[legend]

Public Member Functions

 PFCRFFEnergyDensity (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeValue ()
 

Protected Attributes

unsigned int _order
 
std::vector< const VariableValue * > _vals
 
Real _a
 
Real _b
 
Real _c
 
unsigned int _num_exp_terms
 
MooseEnum _log_approach
 
Real _tol
 

Detailed Description

Definition at line 21 of file PFCRFFEnergyDensity.h.

Constructor & Destructor Documentation

◆ PFCRFFEnergyDensity()

PFCRFFEnergyDensity::PFCRFFEnergyDensity ( const InputParameters &  parameters)

Definition at line 33 of file PFCRFFEnergyDensity.C.

34  : AuxKernel(parameters),
35  _order(coupledComponents("v")),
36  _a(getParam<Real>("a")),
37  _b(getParam<Real>("b")),
38  _c(getParam<Real>("c")),
39  _num_exp_terms(getParam<unsigned int>("num_exp_terms")),
40  _log_approach(getParam<MooseEnum>("log_approach")),
41  _tol(getParam<Real>("tol"))
42 {
43  _vals.resize(_order);
44  for (unsigned int i = 0; i < _order; ++i)
45  _vals[i] = &coupledValue("v", i);
46 }
std::vector< const VariableValue * > _vals

Member Function Documentation

◆ computeValue()

Real PFCRFFEnergyDensity::computeValue ( )
protectedvirtual

Definition at line 49 of file PFCRFFEnergyDensity.C.

50 {
51  Real val = 0.0;
52  switch (_log_approach)
53  {
54  case 0: // approach using tolerence
55  if (1.0 + (*_vals[0])[_qp] < _tol)
56  val += ((1.0 + _tol) * std::log(1 + _tol)) - _tol;
57  else
58  val += ((1.0 + (*_vals[0])[_qp]) * std::log(1 + (*_vals[0])[_qp])) - (*_vals[0])[_qp];
59  break;
60 
61  case 1: // approach using cancellation
62  val += ((1.0 + (*_vals[0])[_qp]) * std::log(1.0 + (*_vals[0])[_qp])) - (*_vals[0])[_qp];
63  break;
64 
65  case 2: // approach using Taylor Series Expansion
66  Real coef = 1.0;
67 
68  for (unsigned int i = 2; i < (2 + _num_exp_terms); i++)
69  {
70  if (i == 2)
71  coef = _c;
72  else if (i == 3)
73  coef = _a;
74  else if (i == 4)
75  coef = _b;
76  else
77  coef = 1.0;
78 
79  val +=
80  coef * (std::pow(-1.0, Real(i)) / (i * (i - 1))) * std::pow((*_vals[0])[_qp], Real(i));
81  }
82  break;
83  }
84 
85  // Loop Through Variables
86  Real sumL = 0.0;
87  for (unsigned int i = 1; i < _order; ++i)
88  sumL += (*_vals[i])[_qp] * 0.5;
89 
90  val -= ((*_vals[0])[_qp] * sumL);
91 
92  return val;
93 }
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
std::vector< const VariableValue * > _vals

Member Data Documentation

◆ _a

Real PFCRFFEnergyDensity::_a
protected

Definition at line 32 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

◆ _b

Real PFCRFFEnergyDensity::_b
protected

Definition at line 33 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

◆ _c

Real PFCRFFEnergyDensity::_c
protected

Definition at line 34 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

◆ _log_approach

MooseEnum PFCRFFEnergyDensity::_log_approach
protected

Definition at line 36 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

◆ _num_exp_terms

unsigned int PFCRFFEnergyDensity::_num_exp_terms
protected

Definition at line 35 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

◆ _order

unsigned int PFCRFFEnergyDensity::_order
protected

Definition at line 29 of file PFCRFFEnergyDensity.h.

Referenced by computeValue(), and PFCRFFEnergyDensity().

◆ _tol

Real PFCRFFEnergyDensity::_tol
protected

Definition at line 37 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

◆ _vals

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

Definition at line 30 of file PFCRFFEnergyDensity.h.

Referenced by computeValue(), and PFCRFFEnergyDensity().


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