https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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",
58 true,
59 "If a constant density should be used (would discard buoyancy effects)");
60
61 return params;
62}
63
65 : Material(parameters),
66 _c_mu0(getParam<Real>("c_mu0")),
67 _c_mu1(getParam<Real>("c_mu1")),
68 _c_k0_s(getParam<Real>("c_k0_s")),
69 _c_k1_s(getParam<Real>("c_k1_s")),
70 _c_k2_s(getParam<Real>("c_k2_s")),
71 _c_k0_l(getParam<Real>("c_k0_l")),
72 _c_k1_l(getParam<Real>("c_k1_l")),
73 _c_k2_l(getParam<Real>("c_k2_l")),
74 _c_cp0_s(getParam<Real>("c_cp0_s")),
75 _c_cp1_s(getParam<Real>("c_cp1_s")),
76 _c_cp0_l(getParam<Real>("c_cp0_l")),
77 _c_rho0_s(getParam<Real>("c_rho0_s")),
78 _c_rho1_s(getParam<Real>("c_rho1_s")),
79 _c_rho2_s(getParam<Real>("c_rho2_s")),
80 _c_rho0_l(getParam<Real>("c_rho0_l")),
81 _c_rho1_l(getParam<Real>("c_rho1_l")),
82 _c_rho2_l(getParam<Real>("c_rho2_l")),
83 _Tmax(getParam<Real>("Tmax")),
84 _Tl(getParam<Real>("Tl")),
85 _Ts(getParam<Real>("Ts")),
86 _temperature(adCoupledValue("temperature")),
87 _grad_temperature(adCoupledGradient("temperature")),
88 _mu(declareADProperty<Real>(getParam<MaterialPropertyName>("mu_name"))),
89 _k(declareADProperty<Real>(getParam<MaterialPropertyName>("k_name"))),
90 _cp(declareADProperty<Real>(getParam<MaterialPropertyName>("cp_name"))),
91 _rho(declareADProperty<Real>(getParam<MaterialPropertyName>("rho_name"))),
92 _grad_k(declareADProperty<RealVectorValue>("grad_" + getParam<MaterialPropertyName>("k_name"))),
93 _use_constant_density(getParam<bool>("use_constant_density"))
94{
95}
96
97void
99{
100 using std::exp, std::max;
101
103 // First we check if it is enough to compute the solid properties only
104 if (_temperature[_qp] < _Ts)
105 {
106 // We are using an enormous viscosity for the solid phase to prevent it from moving.
107 // This approach was coined in:
108 // Noble, David R et al, Use of Aria to simulate laser weld pool dynamics for neutron generator
109 // production, 2007, Sandia National Laboratories (SNL), Albuquerque, NM, and Livermore, CA
110 _mu[_qp] = 1e11 * 1e-3 * exp(_c_mu0 / That - _c_mu1);
111 _k[_qp] =
117 }
118 else
119 {
120 // This contains an artifically large lower viscosity at this point, to make sure
121 // the fluid simulations are stable. This viscosity is still below the one used in:
122 // Noble, David R et al, Use of Aria to simulate laser weld pool dynamics for neutron generator
123 // production, 2007, Sandia National Laboratories (SNL), Albuquerque, NM, and Livermore, CA
124 const auto mu_l = max(0.030, 1e-3 * exp(_c_mu0 / That - _c_mu1));
125 const auto k_l =
127 const auto grad_k_l = _c_k1_l * _grad_temperature[_qp];
128 const auto cp_l = _c_cp0_l;
129 const auto rho_l = _c_rho0_l + _c_rho1_l * _temperature[_qp] +
131
132 // If we are between the solidus and liquidus temperatures we will need the
133 // solid properties too
134 if (_temperature[_qp] < _Tl && _temperature[_qp] > _Ts)
135 {
136 const auto liquid_fraction = (_temperature[_qp] - _Ts) / (_Tl - _Ts);
137
138 const auto mu_s = 1e11 * 1e-3 * exp(_c_mu0 / That - _c_mu1);
139 const auto k_s =
141 const auto grad_k_s = _c_k1_s * _grad_temperature[_qp];
142 const auto cp_s = _c_cp0_s + _c_cp1_s * _temperature[_qp];
143 const auto rho_s = _c_rho0_s + _c_rho1_s * _temperature[_qp] +
145
146 _mu[_qp] = liquid_fraction * mu_l + (1 - liquid_fraction) * mu_s;
147 _k[_qp] = liquid_fraction * k_l + (1 - liquid_fraction) * k_s;
148 _grad_k[_qp] = liquid_fraction * grad_k_l + (1 - liquid_fraction) * grad_k_s;
149 _cp[_qp] = liquid_fraction * cp_l + (1 - liquid_fraction) * cp_s;
150 _rho[_qp] = liquid_fraction * rho_l + (1 - liquid_fraction) * rho_s;
151 }
152 else
153 {
154 _mu[_qp] = mu_l;
155 _k[_qp] = k_l;
156 _grad_k[_qp] = grad_k_l;
157 _cp[_qp] = cp_l;
158 _rho[_qp] = rho_l;
159 }
160 }
161
162 // If we use constant density we override it with the density at the liquidus line
165}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("NavierStokesTestApp", LaserWeld316LStainlessSteel)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
A material that computes 316L volumetric stainless steel properties relevant to doing laser welding m...
const ADVariableValue & _temperature
We need to know the temperature and the gradient of the temperature.
const Real _Tl
The liquidus and solidus temperatures, both taken from: Pichler, Peter, et al.
LaserWeld316LStainlessSteel(const InputParameters &parameters)
ADMaterialProperty< RealVectorValue > & _grad_k
The gradient of the thermal conductivity.
const ADVariableGradient & _grad_temperature
const bool _use_constant_density
If a constant density should be used (would discard buoyancy effects)
const Real _c_k0_s
The thermal conductivity is taken from: Pichler, Peter, et al.
const Real _Tmax
Bounding temperature for the viscosity.
ADMaterialProperty< Real > & _rho
ADMaterialProperty< Real > & _k
ADMaterialProperty< Real > & _mu
Material properties that get updated in this object.
ADMaterialProperty< Real > & _cp
const Real _c_mu0
An approximate for the dynamic viscosity is provided in paper: Kim, C.S., 1975.
const Real _c_cp0_s
An approximate for the speific heat is provided in paper: Kim, C.S., 1975.
const Real _c_rho0_s
An approximate for the density is provided in paper: Kim, C.S., 1975.
unsigned int _qp
static InputParameters validParams()