-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add time average temperature and time average heat flux to simulation…
… output (#1395) Description Time averaged temperature can now be attached to the vtus using a new parameter in the post-processing subsection. A new object AverageScalarInTime has been created. It can be used to calculate the time average temperature from a certain point in time. This object is greatly inspired by the AverageVelocity object in postprocessing_velocity.h. The average heat transfer is then computed using the computed average temperature and the HeatFluxPostProcessor object. Testing Two new tests have been added. heat_transfer_average_temperature -> Launch an application test to verify no problem using the object. Segfaults, parameter name, etc. average_scalar_01.release -> to verify the computed average actually corresponds to the average of a scalar. Documentation Post processing subsection has been modified ta take into account the new parameter. The two new parameters are calculate average temperature and average heat flux = true initial time for average temperature and average heat flux = 0.0
- Loading branch information
Showing
51 changed files
with
1,149 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
applications_tests/lethe-fluid/heat_transfer_average_temperature.mpirun=1.output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Running on 1 MPI rank(s)... | ||
Number of active cells: 1 | ||
Number of degrees of freedom: 12 | ||
Volume of triangulation: 0.001 | ||
Number of thermal degrees of freedom: 4 | ||
************************ | ||
---> Simulation Restart | ||
************************ | ||
Number of active cells: 1408 | ||
Number of degrees of freedom: 4623 | ||
Volume of triangulation: 0.001 | ||
Number of thermal degrees of freedom: 1541 | ||
Reading heat transfer checkpoint | ||
|
||
******************************************************************************* | ||
Transient iteration: 3 Time: 0.03 Time step: 0.01 CFL: 0 | ||
******************************************************************************* | ||
L2 error velocity: 0 | ||
L2 error temperature : 1.00274e-06 | ||
|
||
******************************************************************************* | ||
Transient iteration: 4 Time: 0.04 Time step: 0.01 CFL: 0 | ||
******************************************************************************* | ||
Number of active cells: 1792 | ||
Number of degrees of freedom: 5979 | ||
Volume of triangulation: 0.001 | ||
Number of thermal degrees of freedom: 1993 | ||
L2 error velocity: 0 | ||
L2 error temperature : 2.32585e-08 | ||
|
||
******************************************************************************* | ||
Transient iteration: 5 Time: 0.05 Time step: 0.01 CFL: 0 | ||
******************************************************************************* | ||
L2 error velocity: 0 | ||
L2 error temperature : 5.39828e-10 | ||
time error_velocity | ||
0.0100 0.000000e+00 | ||
0.0200 0.000000e+00 | ||
0.0300 0.000000e+00 | ||
0.0400 0.000000e+00 | ||
0.0500 0.000000e+00 | ||
cells error_temperature | ||
1024 1.964712e-03 | ||
1408 4.344287e-05 | ||
1408 1.002740e-06 | ||
1792 2.325845e-08 | ||
1792 5.398281e-10 |
221 changes: 221 additions & 0 deletions
221
applications_tests/lethe-fluid/heat_transfer_average_temperature.prm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,221 @@ | ||
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 The Lethe Authors | ||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later | ||
|
||
# Verify if the time average temperature calculation leads to a segfault. It contains some . The validity of the temperature average is tested in tests/solvers. This is the heat_transfer_conduction in solid test. The subsections post-processing, mesh refinement have and restart have been added. | ||
|
||
# Listing of Parameters | ||
#---------------------- | ||
|
||
set dimension = 2 | ||
|
||
#--------------------------------------------------- | ||
# Simulation Control | ||
#--------------------------------------------------- | ||
|
||
subsection simulation control | ||
set method = bdf1 | ||
set time end = 0.05 | ||
set time step = 0.01 | ||
set number mesh adapt = 0 | ||
set output name = conduction | ||
set output frequency = 0 | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Multiphysics | ||
#--------------------------------------------------- | ||
|
||
subsection multiphysics | ||
set heat transfer = true | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Initial condition | ||
#--------------------------------------------------- | ||
|
||
subsection initial conditions | ||
set type = nodal | ||
subsection uvwp | ||
set Function expression = 0; 0; 0 | ||
end | ||
subsection temperature | ||
set Function expression = 30 | ||
end | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Physical Properties | ||
#--------------------------------------------------- | ||
|
||
subsection physical properties | ||
set number of fluids = 1 | ||
subsection fluid 0 | ||
set thermal conductivity model = constant | ||
set thermal conductivity = 60 | ||
set specific heat model = constant | ||
set specific heat = 20 | ||
set density = 2000 | ||
set kinematic viscosity = 0.01 | ||
end | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Mesh | ||
#--------------------------------------------------- | ||
|
||
subsection mesh | ||
set type = dealii | ||
set grid type = subdivided_hyper_rectangle | ||
set grid arguments = 1, 1: 0, 0 : 0.01, 0.1 : true | ||
set initial refinement = 5 | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Mesh adaptation | ||
#--------------------------------------------------- | ||
|
||
subsection mesh adaptation | ||
set type = kelly | ||
set variable = temperature | ||
set frequency = 2 | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Boundary Conditions | ||
#--------------------------------------------------- | ||
|
||
subsection boundary conditions | ||
set number = 4 | ||
subsection bc 0 | ||
set id = 0 | ||
set type = noslip | ||
end | ||
subsection bc 1 | ||
set id = 1 | ||
set type = noslip | ||
end | ||
subsection bc 2 | ||
set id = 2 | ||
set type = noslip | ||
end | ||
subsection bc 3 | ||
set id = 3 | ||
set type = noslip | ||
end | ||
end | ||
|
||
subsection boundary conditions heat transfer | ||
set number = 4 | ||
subsection bc 0 | ||
set id = 0 | ||
set type = temperature | ||
subsection value | ||
set Function expression = 50 | ||
end | ||
end | ||
subsection bc 1 | ||
set id = 1 | ||
set type = temperature | ||
subsection value | ||
set Function expression = 10 | ||
end | ||
end | ||
subsection bc 2 | ||
set id = 2 | ||
set type = noflux | ||
end | ||
subsection bc 3 | ||
set id = 3 | ||
set type = noflux | ||
end | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Analytical Solution | ||
#--------------------------------------------------- | ||
|
||
subsection analytical solution | ||
set enable = true | ||
set verbosity = verbose | ||
subsection uvwp | ||
set Function expression = 0 ; 0 ; 0 | ||
end | ||
subsection temperature | ||
set Function expression = 50 - (40/0.01) * x | ||
end | ||
set filename = L2Error #heat_transfer_average_temperature_restart_files/L2Error | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Subsection post-processing | ||
#--------------------------------------------------- | ||
|
||
subsection post-processing | ||
set calculate average temperature and heat flux = true | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Subsection restart | ||
#--------------------------------------------------- | ||
|
||
subsection restart | ||
set checkpoint = false | ||
set frequency = 1 | ||
set filename = restart #heat_transfer_average_temperature_restart_files/restart | ||
set restart = true | ||
end | ||
|
||
#--------------------------------------------------- | ||
# FEM | ||
#--------------------------------------------------- | ||
|
||
subsection FEM | ||
set velocity order = 1 | ||
set pressure order = 1 | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Non-Linear Solver Control | ||
#--------------------------------------------------- | ||
|
||
subsection non-linear solver | ||
subsection heat transfer | ||
set tolerance = 1e-8 | ||
set max iterations = 100 | ||
set verbosity = quiet | ||
end | ||
subsection fluid dynamics | ||
set tolerance = 1e-8 | ||
set max iterations = 100 | ||
set verbosity = quiet | ||
end | ||
end | ||
|
||
#--------------------------------------------------- | ||
# Linear Solver Control | ||
#--------------------------------------------------- | ||
|
||
subsection linear solver | ||
subsection fluid dynamics | ||
set verbosity = quiet | ||
set method = gmres | ||
set relative residual = 1e-3 | ||
set minimum residual = 1e-8 | ||
set preconditioner = ilu | ||
set ilu preconditioner fill = 0 | ||
set ilu preconditioner absolute tolerance = 1e-12 | ||
set ilu preconditioner relative tolerance = 1.00 | ||
set max krylov vectors = 200 | ||
end | ||
subsection heat transfer | ||
set verbosity = quiet | ||
set method = gmres | ||
set relative residual = 1e-3 | ||
set minimum residual = 1e-8 | ||
set preconditioner = ilu | ||
set ilu preconditioner fill = 0 | ||
set ilu preconditioner absolute tolerance = 1e-12 | ||
set ilu preconditioner relative tolerance = 1.00 | ||
set max krylov vectors = 200 | ||
end | ||
end |
1 change: 1 addition & 0 deletions
1
...s_tests/lethe-fluid/heat_transfer_average_temperature_restart_files/L2Error_FD.checkpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 0 0 0 2 0 4 time 14 error_velocity 0 0 2 0 0 0 14 error_velocity 0 0 0 0 2 0 0 0 100 0.00000000000000000e+00 100 0.00000000000000000e+00 14 error_velocity 1 c 4 0 0 6 4 time 2 0 100 1.00000000000000002e-02 100 2.00000000000000004e-02 4 time 1 c 4 0 0 6 0 0 0 0 0 0 0 0 0 0 0 |
1 change: 1 addition & 0 deletions
1
...s_tests/lethe-fluid/heat_transfer_average_temperature_restart_files/L2Error_HT.checkpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0 0 0 0 2 0 5 cells 17 error_temperature 0 0 2 0 0 0 5 cells 0 0 0 0 2 0 0 0 117 1024 117 1408 5 cells 1 c 4 0 0 4 17 error_temperature 2 0 100 1.96471158322590730e-03 100 4.34428660130723653e-05 17 error_temperature 1 c 4 0 0 6 0 0 0 0 0 0 0 0 0 0 0 |
4 changes: 4 additions & 0 deletions
4
...s_tests/lethe-fluid/heat_transfer_average_temperature_restart_files/restart.averagescalar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Average scalar | ||
dt_0 0.01 | ||
Average_calculation_boolean 1 | ||
Real_initial_time 0.01 |
5 changes: 5 additions & 0 deletions
5
...ions_tests/lethe-fluid/heat_transfer_average_temperature_restart_files/restart.pvdhandler
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
3 | ||
Time File | ||
0 conduction.00000.pvtu | ||
0.01 conduction.00001.pvtu | ||
0.02 conduction.00002.pvtu |
8 changes: 8 additions & 0 deletions
8
...sts/lethe-fluid/heat_transfer_average_temperature_restart_files/restart.simulationcontrol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Simulation control | ||
dt_0 0.01 | ||
dt_1 0.01 | ||
dt_2 0.01 | ||
dt_3 0.01 | ||
CFL 0 | ||
Time 0.02 | ||
Iter 2 |
Binary file added
BIN
+16.8 KB
...s_tests/lethe-fluid/heat_transfer_average_temperature_restart_files/restart.triangulation
Binary file not shown.
2 changes: 2 additions & 0 deletions
2
...ts/lethe-fluid/heat_transfer_average_temperature_restart_files/restart.triangulation.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
version nproc n_attached_fixed_size_objs n_attached_variable_size_objs n_coarse_cells | ||
5 1 2 0 1 |
Binary file added
BIN
+754 KB
...he-fluid/heat_transfer_average_temperature_restart_files/restart.triangulation_fixed.data
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.