https://mooseframework.inl.gov
LaserWeld316LStainlessSteel.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 registerMooseObject("NavierStokesTestApp", LaserWeld316LStainlessSteel);
13 
16 {
18  params.addRequiredCoupledVar("temperature", "The temperature in K");
19 
20  params.addParam<Real>("c_mu0", 2385.2, "mu0 coefficient in exp(m0/T-mu1)");
21  params.addParam<Real>("c_mu1", 0.5958, "mu1 coefficient in exp(m0/T-mu1)");
22 
23  params.addParam<Real>("Tmax", 4000, "The maximum temperature for limiting viscosity");
24  params.addParam<Real>("Tl", 1708, "The liquidus temperature");
25  params.addParam<Real>("Ts", 1675, "The solidus temperature");
26 
27  params.addParam<Real>("c_k0_s", 6.38, "k0 coefficient for the solid in k0+k1*T");
28  params.addParam<Real>("c_k1_s", 1.9E-2, "k1 coefficient for the solid in k0+k1*T");
29  params.addParam<Real>("c_k2_s", -2.45E-6, "k1 coefficient for the solid in k0+k1*T");
30  params.addParam<Real>("c_k0_l", 2.27, "k0 coefficient for the liquid in k0+k1*T");
31  params.addParam<Real>("c_k1_l", 1.76E-2, "k1 coefficien for the liquid in k0+k1*Tt");
32  params.addParam<Real>("c_k2_l", -1.39E-6, "k1 coefficient for the solid in k0+k1*T");
33 
34  params.addParam<Real>("c_cp0_s", 459.29, "cp0 coefficient for the solid in cp0+cp1*T");
35  params.addParam<Real>("c_cp1_s", 0.1329, "cp1 coefficient for the solid in cp0+cp1*T");
36  params.addParam<Real>("c_cp0_l", 795.49, "cp0 coefficient for the liquid in cp0");
37 
38  params.addParam<Real>(
39  "c_rho0_s", 8084.2, "The rho0 density for the solid in rho0+rho1*T+rho2*T*T");
40  params.addParam<Real>(
41  "c_rho1_s", -0.42086, "The rho1 density for the solid in rho0+rho1*T+rho2*T*T");
42  params.addParam<Real>(
43  "c_rho2_s", -3.8942E-5, "The rho2 density for the solid in rho0+rho1*T+rho2*T*T");
44  params.addParam<Real>(
45  "c_rho0_l", 7432.7, "The rho0 density for the liquid in rho0+rho1*T+rho2*T*T");
46  params.addParam<Real>(
47  "c_rho1_l", 0.039338, "The rho1 density for the liquid in rho0+rho1*T+rho2*T*T");
48  params.addParam<Real>(
49  "c_rho2_l", -1.8007E-4, "The rho2 density for the liquid in rho0+rho1*T+rho2*T*T");
50 
51  params.addParam<MaterialPropertyName>(
52  "mu_name", "mu", "The name of the viscosity material property");
53  params.addParam<MaterialPropertyName>("k_name", "k", "The name of the thermal conductivity");
54  params.addParam<MaterialPropertyName>("cp_name", "cp", "The name of the specific heat capacity");
55  params.addParam<MaterialPropertyName>("rho_name", "rho", "The name of the density");
56 
57  params.addParam<bool>("use_constant_density", true, "If a constant density should be used (would discard buoyancy effects)");
58 
59  return params;
60 }
61 
63  const InputParameters & parameters)
64  : Material(parameters),
65  _c_mu0(getParam<Real>("c_mu0")),
66  _c_mu1(getParam<Real>("c_mu1")),
67  _c_k0_s(getParam<Real>("c_k0_s")),
68  _c_k1_s(getParam<Real>("c_k1_s")),
69  _c_k2_s(getParam<Real>("c_k2_s")),
70  _c_k0_l(getParam<Real>("c_k0_l")),
71  _c_k1_l(getParam<Real>("c_k1_l")),
72  _c_k2_l(getParam<Real>("c_k2_l")),
73  _c_cp0_s(getParam<Real>("c_cp0_s")),
74  _c_cp1_s(getParam<Real>("c_cp1_s")),
75  _c_cp0_l(getParam<Real>("c_cp0_l")),
76  _c_rho0_s(getParam<Real>("c_rho0_s")),
77  _c_rho1_s(getParam<Real>("c_rho1_s")),
78  _c_rho2_s(getParam<Real>("c_rho2_s")),
79  _c_rho0_l(getParam<Real>("c_rho0_l")),
80  _c_rho1_l(getParam<Real>("c_rho1_l")),
81  _c_rho2_l(getParam<Real>("c_rho2_l")),
82  _Tmax(getParam<Real>("Tmax")),
83  _Tl(getParam<Real>("Tl")),
84  _Ts(getParam<Real>("Ts")),
85  _temperature(adCoupledValue("temperature")),
86  _grad_temperature(adCoupledGradient("temperature")),
87  _mu(declareADProperty<Real>(getParam<MaterialPropertyName>("mu_name"))),
88  _k(declareADProperty<Real>(getParam<MaterialPropertyName>("k_name"))),
89  _cp(declareADProperty<Real>(getParam<MaterialPropertyName>("cp_name"))),
90  _rho(declareADProperty<Real>(getParam<MaterialPropertyName>("rho_name"))),
91  _grad_k(declareADProperty<RealVectorValue>("grad_" + getParam<MaterialPropertyName>("k_name"))),
92  _use_constant_density(getParam<bool>("use_constant_density"))
93 {
94 }
95 
96 void
98 {
100  // First we check if it is enough to compute the solid properties only
101  if (_temperature[_qp] < _Ts)
102  {
103  // We are using an enormous viscosity for the solid phase to prevent it from moving.
104  // This approach was coined in:
105  // Noble, David R et al, Use of Aria to simulate laser weld pool dynamics for neutron generator production,
106  // 2007, Sandia National Laboratories (SNL), Albuquerque, NM, and Livermore, CA
107  _mu[_qp] = 1e11 * 1e-3 * std::exp(_c_mu0 / That - _c_mu1);
108  _k[_qp] =
114  }
115  else
116  {
117  // This contains an artifically large lower viscosity at this point, to make sure
118  // the fluid simulations are stable. This viscosity is still below the one used in:
119  // Noble, David R et al, Use of Aria to simulate laser weld pool dynamics for neutron generator production,
120  // 2007, Sandia National Laboratories (SNL), Albuquerque, NM, and Livermore, CA
121  const auto mu_l = std::max(0.030, 1e-3 * std::exp(_c_mu0 / That - _c_mu1));
122  const auto k_l =
124  const auto grad_k_l = _c_k1_l * _grad_temperature[_qp];
125  const auto cp_l = _c_cp0_l;
126  const auto rho_l = _c_rho0_l + _c_rho1_l * _temperature[_qp] +
128 
129  // If we are between the solidus and liquidus temperatures we will need the
130  // solid properties too
131  if (_temperature[_qp] < _Tl && _temperature[_qp] > _Ts)
132  {
133  const auto liquid_fraction = (_temperature[_qp] - _Ts) / (_Tl - _Ts);
134 
135  const auto mu_s = 1e11 * 1e-3 * std::exp(_c_mu0 / That - _c_mu1);
136  const auto k_s =
138  const auto grad_k_s = _c_k1_s * _grad_temperature[_qp];
139  const auto cp_s = _c_cp0_s + _c_cp1_s * _temperature[_qp];
140  const auto rho_s = _c_rho0_s + _c_rho1_s * _temperature[_qp] +
142 
143  _mu[_qp] = liquid_fraction * mu_l + (1 - liquid_fraction) * mu_s;
144  _k[_qp] = liquid_fraction * k_l + (1 - liquid_fraction) * k_s;
145  _grad_k[_qp] = liquid_fraction * grad_k_l + (1 - liquid_fraction) * grad_k_s;
146  _cp[_qp] = liquid_fraction * cp_l + (1 - liquid_fraction) * cp_s;
147  _rho[_qp] = liquid_fraction * rho_l + (1 - liquid_fraction) * rho_s;
148  }
149  else
150  {
151  _mu[_qp] = mu_l;
152  _k[_qp] = k_l;
153  _grad_k[_qp] = grad_k_l;
154  _cp[_qp] = cp_l;
155  _rho[_qp] = rho_l;
156  }
157  }
158 
159  // If we use constant density we override it with the density at the liquidus line
161  _rho[_qp] = _c_rho0_l + _c_rho1_l * _Tl +
162  _c_rho2_l * _Tl * _Tl;
163 }
const Real _Tmax
Bounding temperature for the viscosity.
static const std::string cp_s
Definition: NS.h:119
ADMaterialProperty< Real > & _rho
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
ADMaterialProperty< Real > & _mu
Material properties that get updated in this object.
A material that computes 316L volumetric stainless steel properties relevant to doing laser welding m...
static const std::string rho_s
Definition: NS.h:118
const Real _c_cp0_s
An approximate for the speific heat is provided in paper: Kim, C.S., 1975.
const Real _c_mu0
An approximate for the dynamic viscosity is provided in paper: Kim, C.S., 1975.
LaserWeld316LStainlessSteel(const InputParameters &parameters)
static const std::string k_s
Definition: NS.h:120
const ADVariableValue & _temperature
We need to know the temperature and the gradient of the temperature.
unsigned int _qp
const Real _c_rho0_s
An approximate for the density is provided in paper: Kim, C.S., 1975.
registerMooseObject("NavierStokesTestApp", LaserWeld316LStainlessSteel)
const Real _c_k0_s
The thermal conductivity is taken from: Pichler, Peter, et al.
static InputParameters validParams()
ADMaterialProperty< RealVectorValue > & _grad_k
The gradient of the thermal conductivity.
ADMaterialProperty< Real > & _cp
ADMaterialProperty< Real > & _k
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const ADVariableGradient & _grad_temperature
static InputParameters validParams()
const Real _Tl
The liquidus and solidus temperatures, both taken from: Pichler, Peter, et al.
const bool _use_constant_density
If a constant density should be used (would discard buoyancy effects)