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

This class allows us to have a section of the input file like the following which automatically adds initial conditions for all the required nonlinear and auxiliary variables. More...

#include <AddNavierStokesICsAction.h>

Inheritance diagram for AddNavierStokesICsAction:
[legend]

Public Member Functions

 AddNavierStokesICsAction (InputParameters parameters)
 
virtual ~AddNavierStokesICsAction ()
 
virtual void act ()
 

Protected Types

typedef std::vector< VariableName > CoupledName
 

Protected Member Functions

void addICs (std::vector< std::string > &names)
 

Protected Attributes

Real _initial_pressure
 
Real _initial_temperature
 
RealVectorValue _initial_velocity
 
UserObjectName _fp_name
 
std::vector< std::string > _vars
 
std::vector< std::string > _auxs
 
unsigned int _dim
 

Detailed Description

This class allows us to have a section of the input file like the following which automatically adds initial conditions for all the required nonlinear and auxiliary variables.

[NavierStokes] [./ICs] initial_pressure = 101325. initial_temperature = 300. initial_velocity = '173.594354746921 0 0' fluid_properties = ideal_gas [../] []

Definition at line 34 of file AddNavierStokesICsAction.h.

Member Typedef Documentation

◆ CoupledName

typedef std::vector<VariableName> NSAction::CoupledName
protectedinherited

Definition at line 43 of file NSAction.h.

Constructor & Destructor Documentation

◆ AddNavierStokesICsAction()

AddNavierStokesICsAction::AddNavierStokesICsAction ( InputParameters  parameters)

Definition at line 46 of file AddNavierStokesICsAction.C.

47  : NSAction(parameters),
48  _initial_pressure(getParam<Real>("initial_pressure")),
49  _initial_temperature(getParam<Real>("initial_temperature")),
50  _initial_velocity(getParam<RealVectorValue>("initial_velocity")),
51  _fp_name(getParam<UserObjectName>("fluid_properties"))
52 {
53 }
NSAction(InputParameters parameters)
Definition: NSAction.C:30

◆ ~AddNavierStokesICsAction()

AddNavierStokesICsAction::~AddNavierStokesICsAction ( )
virtual

Definition at line 55 of file AddNavierStokesICsAction.C.

55 {}

Member Function Documentation

◆ act()

void AddNavierStokesICsAction::act ( )
virtual

Reimplemented from NSAction.

Definition at line 58 of file AddNavierStokesICsAction.C.

59 {
60  // Call the base class's act() function to initialize the _vars and _auxs names.
61  NSAction::act();
62 
63  // Now add the ICs for the nonlinear and auxiliary variables
64  addICs(_vars);
65  addICs(_auxs);
66 }
void addICs(std::vector< std::string > &names)
std::vector< std::string > _auxs
Definition: NSAction.h:36
std::vector< std::string > _vars
Definition: NSAction.h:35
virtual void act()
Definition: NSAction.C:35

◆ addICs()

void AddNavierStokesICsAction::addICs ( std::vector< std::string > &  names)
protected

Definition at line 69 of file AddNavierStokesICsAction.C.

Referenced by act().

70 {
71  for (const auto & name : names)
72  {
73  InputParameters params = _factory.getValidParams("NSInitialCondition");
74  params.set<VariableName>("variable") = name;
75  params.set<Real>("initial_pressure") = _initial_pressure;
76  params.set<Real>("initial_temperature") = _initial_temperature;
77  params.set<RealVectorValue>("initial_velocity") = _initial_velocity;
78  params.set<UserObjectName>("fluid_properties") = _fp_name;
79  _problem->addInitialCondition("NSInitialCondition", name + std::string("_ic"), params);
80  }
81 }
const std::string name
Definition: Setup.h:22

Member Data Documentation

◆ _auxs

std::vector<std::string> NSAction::_auxs
protectedinherited

Definition at line 36 of file NSAction.h.

Referenced by NSAction::act(), act(), and AddNavierStokesVariablesAction::act().

◆ _dim

unsigned int NSAction::_dim
protectedinherited

◆ _fp_name

UserObjectName AddNavierStokesICsAction::_fp_name
protected

Definition at line 49 of file AddNavierStokesICsAction.h.

Referenced by addICs().

◆ _initial_pressure

Real AddNavierStokesICsAction::_initial_pressure
protected

Definition at line 46 of file AddNavierStokesICsAction.h.

Referenced by addICs().

◆ _initial_temperature

Real AddNavierStokesICsAction::_initial_temperature
protected

Definition at line 47 of file AddNavierStokesICsAction.h.

Referenced by addICs().

◆ _initial_velocity

RealVectorValue AddNavierStokesICsAction::_initial_velocity
protected

Definition at line 48 of file AddNavierStokesICsAction.h.

Referenced by addICs().

◆ _vars

std::vector<std::string> NSAction::_vars
protectedinherited

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