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

#include <NSThermalBC.h>

Inheritance diagram for NSThermalBC:
[legend]

Public Member Functions

 NSThermalBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 

Protected Attributes

unsigned int _rho_var
 
const VariableValue & _rho
 
Real _initial
 
Real _final
 
Real _duration
 
const IdealGasFluidProperties_fp
 

Detailed Description

Definition at line 22 of file NSThermalBC.h.

Constructor & Destructor Documentation

◆ NSThermalBC()

NSThermalBC::NSThermalBC ( const InputParameters &  parameters)

Definition at line 35 of file NSThermalBC.C.

36  : NodalBC(parameters),
37  _rho_var(coupled(NS::density)),
38  _rho(coupledValue(NS::density)),
39  _initial(getParam<Real>("initial")),
40  _final(getParam<Real>("final")),
41  _duration(getParam<Real>("duration")),
42  _fp(getUserObject<IdealGasFluidProperties>("fluid_properties"))
43 {
44 }
Real _initial
Definition: NSThermalBC.h:35
const std::string density
Definition: NS.h:17
Real _duration
Definition: NSThermalBC.h:37
const VariableValue & _rho
Definition: NSThermalBC.h:33
const IdealGasFluidProperties & _fp
Definition: NSThermalBC.h:40
unsigned int _rho_var
Definition: NSThermalBC.h:32

Member Function Documentation

◆ computeQpResidual()

Real NSThermalBC::computeQpResidual ( )
protectedvirtual

Definition at line 47 of file NSThermalBC.C.

48 {
49  Real value;
50 
51  // For constant temperature, set _initial = _final, or set _duration=0 and set _final.
52  //
53  // T(t) = T_i + (T_f - T_i) * sin (pi/2 * t/t_d)
54  if (_t < _duration)
55  value = _initial + (_final - _initial) * std::sin((0.5 * libMesh::pi) * _t / _duration);
56  else
57  value = _final;
58 
59  // For the total energy, the essential BC is:
60  // rho*E = rho*(c_v*T + |u|^2/2)
61  //
62  // or, in residual form, (In general, this BC is coupled to the velocity variables.)
63  // rho*E - rho*(c_v*T + |u|^2/2) = 0
64  //
65  // ***at a no-slip wall*** this further reduces to (no coupling to velocity variables):
66  // rho*E - rho*cv*T = 0
67 
68  // std::ios_base::fmtflags flags = Moose::out.flags();
69  // Moose::out << std::scientific << std::setprecision(16);
70  // Moose::out << "rho*E =" << _u[_qp] << std::endl;
71  // Moose::out << "(_p[_qp] * _c_v[_qp] * value)=" << (_p[_qp] * _c_v[_qp] * value) << std::endl;
72  // //Moose::out << "_c_v[_qp] =" << _c_v[_qp] << std::endl;
73  // Moose::out.flags(flags);
74  return _u[_qp] - (_rho[_qp] * _fp.cv() * value);
75 }
Real _initial
Definition: NSThermalBC.h:35
Real _duration
Definition: NSThermalBC.h:37
const VariableValue & _rho
Definition: NSThermalBC.h:33
const IdealGasFluidProperties & _fp
Definition: NSThermalBC.h:40

Member Data Documentation

◆ _duration

Real NSThermalBC::_duration
protected

Definition at line 37 of file NSThermalBC.h.

Referenced by computeQpResidual().

◆ _final

Real NSThermalBC::_final
protected

Definition at line 36 of file NSThermalBC.h.

Referenced by computeQpResidual().

◆ _fp

const IdealGasFluidProperties& NSThermalBC::_fp
protected

Definition at line 40 of file NSThermalBC.h.

Referenced by computeQpResidual().

◆ _initial

Real NSThermalBC::_initial
protected

Definition at line 35 of file NSThermalBC.h.

Referenced by computeQpResidual().

◆ _rho

const VariableValue& NSThermalBC::_rho
protected

Definition at line 33 of file NSThermalBC.h.

Referenced by computeQpResidual().

◆ _rho_var

unsigned int NSThermalBC::_rho_var
protected

Definition at line 32 of file NSThermalBC.h.


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