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 19 of file PFCRFFEnergyDensity.h.

Constructor & Destructor Documentation

PFCRFFEnergyDensity::PFCRFFEnergyDensity ( const InputParameters &  parameters)

Definition at line 29 of file PFCRFFEnergyDensity.C.

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

Member Function Documentation

Real PFCRFFEnergyDensity::computeValue ( )
protectedvirtual

Definition at line 45 of file PFCRFFEnergyDensity.C.

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

Member Data Documentation

Real PFCRFFEnergyDensity::_a
protected

Definition at line 30 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

Real PFCRFFEnergyDensity::_b
protected

Definition at line 31 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

Real PFCRFFEnergyDensity::_c
protected

Definition at line 32 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

MooseEnum PFCRFFEnergyDensity::_log_approach
protected

Definition at line 34 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

unsigned int PFCRFFEnergyDensity::_num_exp_terms
protected

Definition at line 33 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

unsigned int PFCRFFEnergyDensity::_order
protected

Definition at line 27 of file PFCRFFEnergyDensity.h.

Referenced by computeValue(), and PFCRFFEnergyDensity().

Real PFCRFFEnergyDensity::_tol
protected

Definition at line 35 of file PFCRFFEnergyDensity.h.

Referenced by computeValue().

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

Definition at line 28 of file PFCRFFEnergyDensity.h.

Referenced by computeValue(), and PFCRFFEnergyDensity().


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