Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify heating source usage. #21

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file added test/tests/thermal-legacy/dagmc.h5m
Binary file not shown.
4 changes: 4 additions & 0 deletions test/tests/thermal-legacy/geometry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<dagmc_universe auto_mat_ids="true" filename="dagmc.h5m" id="1" />
</geometry>
Binary file added test/tests/thermal-legacy/gold/main_out.e
Binary file not shown.
133 changes: 133 additions & 0 deletions test/tests/thermal-legacy/main.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
[Mesh]
type = FileMesh
file = copper_air_bcs_tetmesh.e
[]

[Problem]
type = FEProblem
[]

[Executioner]
type = Transient
num_steps = 5
dt = 1
solve_type = NEWTON
abort_on_solve_fail=True
[]

[Variables]
[temperature]
order = FIRST
family = LAGRANGE
initial_condition = 300 # Start at room temperature
[]
[]

[AuxVariables]
[heating-local]
order = CONSTANT
family = MONOMIAL
[]
[heating-local-err]
order = CONSTANT
family = MONOMIAL
[]
[flux]
order = CONSTANT
family = MONOMIAL
[]
[flux-err]
order = CONSTANT
family = MONOMIAL
[]
[]

[BCs]
[air-outer]
type = DirichletBC
variable = temperature
boundary = 'top-outer bottom-outer left-outer right-outer front-outer back-outer'
value = 300 # (K)
[]
[]

[UserObjects]
[uo-heating-function]
type = FunctionUserObject
variable = heating-local
execute_on = "initial"
[]
[]

[Functions]
[heating-function]
type = VariableFunction
uoname = "uo-heating-function"
[]
[]

[Materials]
[copper_props]
type = ADGenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '3.97 0.385 8.920' # W/cm*K, J/g-K, g/cm^3
block = 1
[]
[air_props]
type = ADGenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '0.26 1 0.001'
block = 2
[]
[heating]
type = ADGenericFunctionMaterial
prop_names = 'volumetric_heat'
prop_values = 'heating-function'
block = '1 2'
constant_on = 'ELEMENT'
output_properties = 'volumetric_heat'
outputs = exodus
[]
[]

[Kernels]
[heat_conduction]
type = ADHeatConduction
variable = temperature
[]
[heat_conduction_time_derivative]
type = ADHeatConductionTimeDerivative
variable = temperature
[]
[heat-source]
type = ADMatHeatSource
material_property = volumetric_heat
variable = temperature
block = '1 2'
[]
[]

[MultiApps]
[openmc]
type = FullSolveMultiApp
app_type = OpenMCApp
execute_on = "timestep_begin"
input_files = "openmc.i"
positions = '0 0 0'
library_path = ../../../openmc/lib
[]
[]

[Transfers]
[./to_openmc]
type = MoabMeshTransfer
to_multi_app = openmc
moabname = "moab"
[../]
[]

[Outputs]
exodus = true
execute_on = 'timestep_end'

[]
18 changes: 18 additions & 0 deletions test/tests/thermal-legacy/materials.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material id="1" name="air">
<density units="g/cc" value="0.001205" />
<nuclide ao="0.781557629247" name="N14" />
<nuclide ao="0.002873370753" name="N15" />
<nuclide ao="0.210668126508" name="O16" />
<nuclide ao="7.9873492e-05" name="O17" />
<nuclide ao="1.53456e-05" name="Ar36" />
<nuclide ao="2.8934e-06" name="Ar38" />
<nuclide ao="0.004581761" name="Ar40" />
</material>
<material id="2" name="copper" temperature="300">
<density units="g/cm3" value="8.96" />
<nuclide ao="0.6915" name="Cu63" />
<nuclide ao="0.3085" name="Cu65" />
</material>
</materials>
30 changes: 30 additions & 0 deletions test/tests/thermal-legacy/openmc.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
[]

[Problem]
type = OpenMCProblem
[]

[Executioner]
type = OpenMCExecutioner
variables = 'heating-local flux'
score_names = 'heating-local flux'
tally_ids = '1 1'
err_variables = 'heating-local-err flux-err'
neutron_source = 1.0e18
launch_threads=false
[]

[UserObjects]
[moab]
type = MoabUserObject
bin_varname = "temperature"
material_names = 'copper_props air_props'
material_openmc_names = 'copper air'
output_skins = false
length_scale = 1.0
[]
[]
20 changes: 20 additions & 0 deletions test/tests/thermal-legacy/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>1000</particles>
<batches>10</batches>
<source strength="1.0">
<space type="point">
<parameters>0 0 0</parameters>
</space>
</source>
<output>
<summary>false</summary>
<tallies>false</tallies>
</output>
<state_point>
<batches />
</state_point>
<photon_transport>false</photon_transport>
<temperature_method>interpolation</temperature_method>
</settings>
7 changes: 7 additions & 0 deletions test/tests/thermal-legacy/tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Tests]
[./test]
type = 'Exodiff'
input = 'main.i'
exodiff = 'main_out.e'
[../]
[]
1 change: 1 addition & 0 deletions test/tests/thermal-mech-legacy/copper_air_bcs_tetmesh.e
1 change: 1 addition & 0 deletions test/tests/thermal-mech-legacy/dagmc.h5m
4 changes: 4 additions & 0 deletions test/tests/thermal-mech-legacy/geometry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<dagmc_universe auto_mat_ids="true" filename="dagmc.h5m" id="1" />
</geometry>
Binary file not shown.
Loading