Skip to content

Commit

Permalink
Merge pull request #26692 from joshuahansel/hs-solid-properties
Browse files Browse the repository at this point in the history
Enabled use of solid properties in heat structures
  • Loading branch information
joshuahansel authored Jan 31, 2024
2 parents 9e71a48 + 1e1aa93 commit 431e678
Show file tree
Hide file tree
Showing 104 changed files with 667 additions and 549 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ The parameters
[!param](/Components/{{name}}/widths), and
[!param](/Components/{{name}}/n_part_elems) are discussed in [#mesh_radial].

The parameter [!param](/Components/{{name}}/materials) specifies the names of
[HeatStructureMaterials](HeatStructureMaterials/index.md) objects to use in
each region. Each entry in this parameter corresponds to the entries in the parameters
[!param](/Components/{{name}}/names), [!param](/Components/{{name}}/widths),
and [!param](/Components/{{name}}/n_part_elems).
Note that this parameter is optional; if omitted, the user must
create [Materials](Materials/index.md) supplying the following material properties
on all blocks (see [#mesh_blocks]) of the heat structure mesh:
There are two options for specification of the thermal properties on the heat structure:

| Material Property | Symbol | Description |
| :- | :- | :- |
| `density` | $\rho$ | Density \[kg/m$^3$\] |
| `specific_heat` | $c_p$ | Specific heat capacity \[J/(kg-K)\] |
| `thermal_conductivity` | $k$ | Thermal conductivity \[W/(m-K)\] |
- Create a [SolidProperties](syntax/SolidProperties/index.md) object for each unique heat structure material,
and then provide [!param](/Components/{{name}}/solid_properties) which corresponds
to the `SolidProperties` object to use in each transverse region (each entry corresponds
to the equally indexed entry in [!param](/Components/{{name}}/names))
and [!param](/Components/{{name}}/solid_properties_T_ref), which provides
the temperatures at which to evaluate the densities, since a constant density
is to be used in each region, due to heat structures having a non-deformable
mesh.
- Create [Materials](Materials/index.md) object(s) supplying the following material properties
on all blocks (see [#mesh_blocks]) of the heat structure mesh:

| Material Property | Symbol | Description |
| :- | :- | :- |
| `density` | $\rho$ | Density \[kg/m$^3$\] |
| `specific_heat` | $c_p$ | Specific heat capacity \[J/(kg-K)\] |
| `thermal_conductivity` | $k$ | Thermal conductivity \[W/(m-K)\] |
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ tot_power = 2000 # W
```


## Heat Structure Materials
## Solid Properties

To set up a heat conduction, we will need to define a solid material used in the block with
heat conduction.
To do that, we put the following block into a top-level [HeatStructureMaterials](HeatStructureMaterials/index.md) block:
To do that, we put the following block into a top-level [SolidProperties](syntax/SolidProperties/index.md) block:

!listing thermal_hydraulics/tutorials/single_phase_flow/02_core.i
block=HeatStructureMaterials/steel
block=SolidProperties/steel
link=False

where `rho`, `k`, and `cp` are density, thermal conductivity, and specific heat, respectively.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ To accomplish this, we define the Prandtl number using an [ADPrandtlNumberMateri

!listing thermal_hydraulics/tutorials/single_phase_flow/06_custom_closures.i
start=Pr_mat
end=HeatStructureMaterials
end=SolidProperties
link=False

!content pagination previous=tutorials/single_phase_flow/step05.md
Expand Down
11 changes: 11 additions & 0 deletions modules/thermal_hydraulics/include/components/HeatStructureBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ class HeatStructureBase : public Component2D, public HeatStructureInterface
void
loadMaterial(InputParameters & pars, const std::string & par, const std::string & material_name);

/**
* Adds a ADConstantDensityThermalSolidPropertiesMaterial for a heat structure region
*
* @param[in] sp_name Solid properties object name
* @param[in] T_ref Constant density reference temperature
* @param[in] i_region Heat structure region index
*/
void addConstantDensitySolidPropertiesMaterial(const UserObjectName & sp_name,
const Real & T_ref,
unsigned int i_region) const;

/// Map from block name to block index
std::map<std::string, unsigned int> _name_index;
/// Material names
Expand Down
26 changes: 26 additions & 0 deletions modules/thermal_hydraulics/src/components/HeatStructureBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,30 @@ HeatStructureBase::addMooseObjects()
comp->connectObject(rho_fn->parameters(), rho_fn->name(), "rho", "value");
}
}

if (isParamValid("solid_properties"))
{
const auto sp_names = getParam<std::vector<UserObjectName>>("solid_properties");
const auto T_ref = getParam<std::vector<Real>>("solid_properties_T_ref");
for (unsigned int i = 0; i < sp_names.size(); i++)
addConstantDensitySolidPropertiesMaterial(sp_names[i], T_ref[i], i);
}
}

void
HeatStructureBase::addConstantDensitySolidPropertiesMaterial(const UserObjectName & sp_name,
const Real & T_ref,
unsigned int i_region) const
{
const auto blocks = getSubdomainNames();
const auto region_names = getNames();

const std::string class_name = "ADConstantDensityThermalSolidPropertiesMaterial";
InputParameters params = _factory.getValidParams(class_name);
params.set<std::vector<SubdomainName>>("block") = {blocks[i_region]};
params.set<std::vector<VariableName>>("temperature") = {HeatConductionModel::TEMPERATURE};
params.set<UserObjectName>("sp") = sp_name;
params.set<Real>("T_ref") = T_ref;
getTHMProblem().addMaterial(
class_name, genName(name(), class_name, region_names[i_region]), params);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ HeatStructureCylindrical::validParams()
params.addRequiredParam<std::vector<Real>>("widths", "Width of each radial region [m]");
params.addRequiredParam<std::vector<unsigned int>>("n_part_elems",
"Number of elements of each radial region");
params.addParam<std::vector<std::string>>("materials", "Material name for each radial region");
params.addDeprecatedParam<std::vector<std::string>>(
"materials",
"Material name for each transverse region",
"HeatStructureMaterials are deprecated. Please make corresponding SolidProperties objects "
"and replace the heat structure parameter 'materials' with the parameters 'solid_properties' "
"and 'solid_properties_T_ref'. See heat structure documentation for more information.");
params.addParam<std::vector<UserObjectName>>(
"solid_properties", "Solid properties object name for each radial region");
params.addParam<std::vector<Real>>(
"solid_properties_T_ref",
{},
"Density reference temperatures for each radial region. This is required if "
"'solid_properties' is provided. The density in each region will be a constant value "
"computed by evaluating the density function at the reference temperature.");
params.addParam<Real>("num_rods", 1.0, "Number of rods represented by this heat structure");
params.addParam<Real>("inner_radius", 0., "Inner radius of the heat structure [m]");

Expand Down Expand Up @@ -71,4 +84,10 @@ HeatStructureCylindrical::check() const
checkEqualSize<std::string, Real>("names", "widths");
if (isParamValid("materials"))
checkEqualSize<std::string, std::string>("names", "materials");
if (isParamValid("solid_properties"))
{
checkEqualSize<UserObjectName, std::string>("solid_properties", "names");
checkEqualSize<UserObjectName, Real>("solid_properties", "solid_properties_T_ref");
}
checkMutuallyExclusiveParameters({"materials", "solid_properties"}, false);
}
22 changes: 20 additions & 2 deletions modules/thermal_hydraulics/src/components/HeatStructurePlate.C
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@ HeatStructurePlate::validParams()
params.addRequiredParam<std::vector<Real>>("widths", "Width of each transverse region [m]");
params.addRequiredParam<std::vector<unsigned int>>(
"n_part_elems", "Number of elements of each transverse region");
params.addParam<std::vector<std::string>>("materials",
"Material name for each transverse region");
params.addDeprecatedParam<std::vector<std::string>>(
"materials",
"Material name for each transverse region",
"HeatStructureMaterials are deprecated. Please make corresponding SolidProperties objects "
"and replace the heat structure parameter 'materials' with the parameters 'solid_properties' "
"and 'solid_properties_T_ref'. See heat structure documentation for more information.");
params.addParam<std::vector<UserObjectName>>(
"solid_properties", "Solid properties object name for each radial region");
params.addParam<std::vector<Real>>(
"solid_properties_T_ref",
{},
"Density reference temperatures for each radial region. This is required if "
"'solid_properties' is provided. The density in each region will be a constant value "
"computed by evaluating the density function at the reference temperature.");
params.addParam<Real>("num_rods", 1.0, "Number of rods represented by this heat structure");
params.addRequiredParam<Real>("depth", "Dimension of plate fuel in the third direction [m]");

Expand Down Expand Up @@ -66,6 +78,12 @@ HeatStructurePlate::check() const
checkEqualSize<std::string, Real>("names", "widths");
if (isParamValid("materials"))
checkEqualSize<std::string, std::string>("names", "materials");
if (isParamValid("solid_properties"))
{
checkEqualSize<UserObjectName, std::string>("solid_properties", "names");
checkEqualSize<UserObjectName, Real>("solid_properties", "solid_properties_T_ref");
}
checkMutuallyExclusiveParameters({"materials", "solid_properties"}, false);
}

Real
Expand Down
5 changes: 4 additions & 1 deletion modules/thermal_hydraulics/src/materials/ADSolidMaterial.C
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "ADSolidMaterial.h"
#include "HeatConductionModel.h"

registerMooseObject("ThermalHydraulicsApp", ADSolidMaterial);
registerMooseObjectDeprecated("ThermalHydraulicsApp", ADSolidMaterial, "04/31/2024 24:00");

InputParameters
ADSolidMaterial::validParams()
Expand All @@ -33,6 +33,9 @@ ADSolidMaterial::ADSolidMaterial(const InputParameters & parameters)
_temp(adCoupledValue("T")),
_props(getUserObject<SolidMaterialProperties>("properties"))
{
mooseDeprecated(
"Heat structure materials are deprecated in favor of SolidProperties objects, so this "
"Material should no longer be used. See heat structure documentation for more information.");
}

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "SolidMaterialProperties.h"

registerMooseObject("ThermalHydraulicsApp", SolidMaterialProperties);
registerMooseObjectDeprecated("ThermalHydraulicsApp", SolidMaterialProperties, "04/31/2024 24:00");

InputParameters
SolidMaterialProperties::validParams()
Expand Down Expand Up @@ -41,6 +41,8 @@ SolidMaterialProperties::SolidMaterialProperties(const InputParameters & paramet
_cp(isParamValid("Cp") ? getFunction("Cp") : getFunction("cp")),
_rho(getFunction("rho"))
{
mooseDeprecated("Heat structure materials are deprecated in favor of SolidProperties objects. "
"See heat structure documentation for more information.");
}

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
[]
[]

[HeatStructureMaterials]
[SolidProperties]
[hx:wall]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 1
cp = 1
rho = 1
Expand Down Expand Up @@ -63,7 +63,8 @@
type = HeatStructurePlate
position = '0 0 0'
orientation = '1 0 0'
materials = hx:wall
solid_properties = 'hx:wall'
solid_properties_T_ref = '300'
n_elems = ${n_elems}
length = ${length}
n_part_elems = 1
Expand Down
7 changes: 4 additions & 3 deletions modules/thermal_hydraulics/test/tests/base/logger/test.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[HeatStructureMaterials]
[SolidProperties]
[a]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
rho = 1
cp = 1
k = 1
Expand All @@ -19,7 +19,8 @@
length = 1
names = '0'
widths = '0.1'
materials = 'a'
solid_properties = 'a'
solid_properties_T_ref = '300'
n_elems = 1
n_part_elems = 1
initial_T = 300
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
[]
[]

[HeatStructureMaterials]
[SolidProperties]
[hx:wall]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 1
cp = 1
rho = 1
Expand Down Expand Up @@ -134,7 +134,8 @@
orientation = '1 0 0'
length = 1
n_elems = 1
materials = hx:wall
solid_properties = hx:wall
solid_properties_T_ref = '300'
n_part_elems = 1
names = 0
widths = 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[HeatStructureMaterials]
[SolidProperties]
[fuel-mat]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 2.5
cp = 300.
rho = 1.032e4
Expand All @@ -18,7 +18,8 @@
names = 'fuel'
widths = '0.004096'
n_part_elems = '1'
materials = 'fuel-mat'
solid_properties = 'fuel-mat'
solid_properties_T_ref = '300'

initial_T = 559.15
[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ p_outlet = 0
[]
[]

[Materials]
[FunctorMaterials]
[const_functor]
type = ADGenericFunctorMaterial
prop_names = 'rho mu'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
[]
[]

[HeatStructureMaterials]
[SolidProperties]
[hs-mat]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 1
cp = 1
rho = 1
Expand All @@ -36,7 +36,8 @@
names = 'blk'
widths = '1'
n_part_elems = '2'
materials = 'hs-mat'
solid_properties = 'hs-mat'
solid_properties_T_ref = '300'

initial_T = 350
[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
[]
[]

[HeatStructureMaterials]
[SolidProperties]
[fuel-mat]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 2.5
cp = 300.
rho = 1.032e4
Expand All @@ -35,7 +35,8 @@
names = 'fuel'
widths = '0.004096'
n_part_elems = '1'
materials = 'fuel-mat'
solid_properties = 'fuel-mat'
solid_properties_T_ref = '300'

initial_T = 559.15
[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@
[]
[]

[HeatStructureMaterials]
[SolidProperties]
[fuel-mat]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 16
cp = 191.67
rho = 1.4583e4
[]
[gap-mat]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 64
cp = 1272
rho = 865
[]
[clad-mat]
type = SolidMaterialProperties
type = ThermalFunctionSolidProperties
k = 26
cp = 638
rho = 7.646e3
Expand Down Expand Up @@ -65,7 +65,8 @@
names = 'fuel gap clad'
widths = '0.003015 0.000465 0.00052'
n_part_elems = '20 2 2'
materials = 'fuel-mat gap-mat clad-mat'
solid_properties = 'fuel-mat gap-mat clad-mat'
solid_properties_T_ref = '300 300 300'
[]

[CH1:hgen]
Expand Down
Loading

0 comments on commit 431e678

Please sign in to comment.