Example #1
0
PyrolysisGasSource::PyrolysisGasSource(const InputParameters & parameters) :
     Kernel(parameters),
     _rho_dt(coupledDot("rho")),
	 _rhoDot_dRho(coupledDotDu("rho")),
     _rho_num(coupled("rho"))
{
}
Example #2
0
NSSUPGBase::NSSUPGBase(const InputParameters & parameters) :
    NSKernel(parameters),

    // Material properties
    _viscous_stress_tensor(getMaterialProperty<RealTensorValue>("viscous_stress_tensor")),
    _dynamic_viscosity(getMaterialProperty<Real>("dynamic_viscosity")),
    _thermal_conductivity(getMaterialProperty<Real>("thermal_conductivity")),

    // SUPG-related material properties
    _hsupg(getMaterialProperty<Real>("hsupg")),
    _tauc(getMaterialProperty<Real>("tauc")),
    _taum(getMaterialProperty<Real>("taum")),
    _taue(getMaterialProperty<Real>("taue")),
    _strong_residuals(getMaterialProperty<std::vector<Real> >("strong_residuals")),

    // Momentum equation inviscid flux matrices
    _calA(getMaterialProperty<std::vector<RealTensorValue> >("calA")),

    // "velocity column" matrices
    _calC(getMaterialProperty<std::vector<RealTensorValue> >("calC")),

    // energy inviscid flux matrices
    _calE(getMaterialProperty<std::vector<std::vector<RealTensorValue> > >("calE")),

    // Old coupled variable values
    // _rho_old(coupledValueOld("rho")),
    // _rho_u_old(coupledValueOld("rhou")),
    // _rho_v_old(_mesh.dimension() >= 2 ? coupledValueOld("rhov") : _zero),
    // _rho_w_old(_mesh.dimension() == 3 ? coupledValueOld("rhow") : _zero),
    // _rho_E_old(coupledValueOld("rhoE")),

    // Time derivative derivatives (no, that's not a typo).  You can
    // just think of these as 1/dt for simplicity, they usually are...
    _d_rhodot_du(coupledDotDu("rho")),
    _d_rhoudot_du(coupledDotDu("rhou")),
    _d_rhovdot_du(_mesh.dimension() >= 2 ? coupledDotDu("rhov") : _zero),
    _d_rhowdot_du(_mesh.dimension() == 3 ? coupledDotDu("rhow") : _zero),
    _d_rhoEdot_du(coupledDotDu("rhoE")),

    // Coupled aux variables
    _temperature(coupledValue("temperature")),
    _enthalpy(coupledValue("enthalpy"))
{
}
OptionallyCoupledForce::OptionallyCoupledForce(const InputParameters & parameters)
  : Kernel(parameters),
    _v_var(coupled("v")),
    _v(coupledValue("v")),
    _grad_v(coupledGradient("v")),
    _second_v(coupledSecond("v")),
    _v_dot(_is_transient ? coupledDot("v") : _zero),
    _v_dot_du(_is_transient ? coupledDotDu("v") : _zero),
    _v_coupled(isCoupled("v"))
{
  if (!_v_coupled && _v_var < 64)
    mooseError("Something is wrong with the coupling system.  It should be producing really huge "
               "numbers for coupled('v') But instead it generated: ",
               _v_var);
}
Example #4
0
DotCouplingKernel::DotCouplingKernel(const InputParameters & parameters)
  : Kernel(parameters), _v_dot(coupledDot("v")), _dv_dot_dv(coupledDotDu("v"))
{
}
Example #5
0
DotCouplingKernel::DotCouplingKernel(const std::string & name, InputParameters parameters) :
    Kernel(name, parameters),
    _v_dot(coupledDot("v")),
    _dv_dot_dv(coupledDotDu("v"))
{
}
Example #6
0
InertialForceBeam::InertialForceBeam(const InputParameters & parameters)
  : TimeKernel(parameters),
    _density(getMaterialProperty<Real>("density")),
    _nrot(coupledComponents("rotations")),
    _ndisp(coupledComponents("displacements")),
    _rot_num(_nrot),
    _disp_num(_ndisp),
    _vel_num(_ndisp),
    _accel_num(_ndisp),
    _rot_vel_num(_nrot),
    _rot_accel_num(_nrot),
    _area(coupledValue("area")),
    _Ay(coupledValue("Ay")),
    _Az(coupledValue("Az")),
    _Ix(isParamValid("Ix") ? coupledValue("Ix") : _zero),
    _Iy(coupledValue("Iy")),
    _Iz(coupledValue("Iz")),
    _beta(isParamValid("beta") ? getParam<Real>("beta") : 0.1),
    _gamma(isParamValid("gamma") ? getParam<Real>("gamma") : 0.1),
    _eta(getMaterialProperty<Real>("eta")),
    _alpha(getParam<Real>("alpha")),
    _original_local_config(getMaterialPropertyByName<RankTwoTensor>("initial_rotation")),
    _original_length(getMaterialPropertyByName<Real>("original_length")),
    _component(getParam<unsigned int>("component")),
    _local_force(2),
    _local_moment(2)
{
  // Checking for consistency between the length of the provided rotations and displacements vector
  if (_ndisp != _nrot)
    mooseError("InertialForceBeam: The number of variables supplied in 'displacements' and "
               "'rotations' must match.");

  if (isParamValid("beta") && isParamValid("gamma") && isParamValid("velocities") &&
      isParamValid("accelerations") && isParamValid("rotational_velocities") &&
      isParamValid("rotational_accelerations"))
  {
    if ((coupledComponents("velocities") != _ndisp) ||
        (coupledComponents("accelerations") != _ndisp) ||
        (coupledComponents("rotational_velocities") != _ndisp) ||
        (coupledComponents("rotational_accelerations") != _ndisp))
      mooseError(
          "InertialForceBeam: The number of variables supplied in 'velocities', "
          "'accelerations', 'rotational_velocities' and 'rotational_accelerations' must match "
          "the number of displacement variables.");

    // fetch coupled velocities and accelerations
    for (unsigned int i = 0; i < _ndisp; ++i)
    {
      MooseVariable * vel_variable = getVar("velocities", i);
      _vel_num[i] = vel_variable->number();

      MooseVariable * accel_variable = getVar("accelerations", i);
      _accel_num[i] = accel_variable->number();

      MooseVariable * rot_vel_variable = getVar("rotational_velocities", i);
      _rot_vel_num[i] = rot_vel_variable->number();

      MooseVariable * rot_accel_variable = getVar("rotational_accelerations", i);
      _rot_accel_num[i] = rot_accel_variable->number();
    }
  }
  else if (!isParamValid("beta") && !isParamValid("gamma") && !isParamValid("velocities") &&
           !isParamValid("accelerations") && !isParamValid("rotational_velocities") &&
           !isParamValid("rotational_accelerations"))
  {
    _du_dot_du = &coupledDotDu("displacements", 0);
    _du_dotdot_du = &coupledDotDotDu("displacements", 0);
  }
  else
    mooseError("InertialForceBeam: Either all or none of `beta`, `gamma`, `velocities`, "
               "`accelerations`, `rotational_velocities` and `rotational_accelerations` should be "
               "provided as input.");

  // fetch coupled displacements and rotations
  for (unsigned int i = 0; i < _ndisp; ++i)
  {
    MooseVariable * disp_variable = getVar("displacements", i);
    _disp_num[i] = disp_variable->number();

    MooseVariable * rot_variable = getVar("rotations", i);
    _rot_num[i] = rot_variable->number();
  }
}
Example #7
0
CoupledImplicitEuler::CoupledImplicitEuler(const std::string & name, InputParameters parameters)
  :Kernel(name, parameters),
   _v_dot(coupledDot("v")),
   _dv_dot(coupledDotDu("v")),
   _v_var(coupled("v"))
{}