Skip to content

Commit 314ee6b

Browse files
authored
Merge pull request #138 from KratosMultiphysics/adding_CHT_CoSim_Example
CHT example with CoSim
2 parents de55239 + 16f9f6d commit 314ee6b

12 files changed

+45705
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Cylinder cooling Re = 100 and Pr = 2
2+
3+
**Author:** [Ihar Antonau](https://github.com/Igarizza)
4+
5+
**Kratos version:** 9.5
6+
7+
**Source files:** [Cylinder cooling Re = 100 and Pr = 2](https://github.com/KratosMultiphysics/Examples/tree/master/co_simulation/validation/cylinder_cooling/source)
8+
9+
## Case Specification
10+
11+
#### The test case is implemented based on the [CHT example](https://github.com/KratosMultiphysics/Examples/tree/master/conjugate_heat_transfer/validation/cylinder_cooling_Re100_Pr2) using CoSimulationApplication.
12+
13+
This is a 2D Conjugate Heat Transfer (CHT) simulation of a cylinder cooling procedure. The flow and material parameters are set such that the Reynolds number is 100 while the Prandtl one is 2.
14+
15+
The geometry consists in a 5 x 2 m channel inside which the cylinder is placed. The center of the cylinder is placed in (0.9375,1.0) coordinates and its radius is 0.0625 m. For the CFD problem, the cylinder is considered to be no-slip while the top and bottom walls are slip. The pressure is fixed along the right edge. A constant inlet equal to 1.0 m/s, is set in the left edge. Concerning the thermal problem, the temperature is fixed to 0 K in the CFD domain left edge while an initial temperature of 1 K is set in the entire cylinder (solid) domain.
16+
17+
Concerning the material properties, a Newtonian constitutive law is used in the CFD problem. Considering that the cylinder diameter is 0.125 m and the mean velocity is 1 m/s, the fluid characteristic parameters to obtain a 100 Re flow are:
18+
* Density (&rho;): 1.0 _Kg/m<sup>3</sup>_
19+
* Kinematic viscosity (&mu;): 1.25E-03 _Kg/ms_
20+
21+
For the coupled thermal problem, the properties are set such that the difusivity as well as the volumetric heat capacity of both materials is the same. This is achieved by setting the fluid values to
22+
* Conductivity (&kappa;): 6.25E-01 _W/m<sup>2</sup>K_
23+
* Specific heat (c<inf>p</inf>): 1.0E+03 _J/Kg·K_
24+
25+
and the solid values to
26+
* Density (&rho;): 4.0 _Kg/m<sub>3</sub>_
27+
* Conductivity (&kappa;): 2.0E+03 _W/m<sup>2</sup>K_
28+
* Specific heat (c<sub>p</sub>): 2.5E+02 _J/Kg·K_
29+
30+
The time step is 0.1 seconds, while the total simulation time is 15.0 seconds.
31+
32+
## Results
33+
The obtained velocity, pressure and temperature fields are shown in the animations below. As can be observed, the expected 100 Re Von Karman vortex street is developed in the downstream region of the cylinder. The affectation of the velocity solution periodicity can be also observed in the fluid temperature field. Furthermore, the correctness of the thermal coupling is also proved since no temperature discontinuities can be noted in the fluid-solid interface.
34+
35+
<p align="center">
36+
<img src="data/cylinder_cooling_Re100_Pr2_v.gif" alt="Cylinder cooling Re = 100 and Pr = 2 velocity field [m/s]." style="width: 600px;"/>
37+
</p>
38+
39+
<p align="center">
40+
<img src="data/cylinder_cooling_Re100_Pr2_p.gif" alt="Cylinder cooling Re = 100 and Pr = 2 pressure field [Pa]." style="width: 600px;"/>
41+
</p>
42+
43+
<p align="center">
44+
<img src="data/cylinder_cooling_Re100_Pr2_t.gif" alt="Cylinder cooling Re = 100 and Pr = 2 temperature field [K]." style="width: 600px;"/>
45+
</p>
46+
47+
## References
48+
Wang, Zimeng & Colin, Fabrice & Le, Guigao & Zhang, Junfeng. (2017). Counter-Extrapolation Method for Conjugate Heat and Mass Transfer with Interfacial Discontinuity. International Journal of Numerical Methods for Heat and Fluid Flow. 27. 2231-2258. 10.1108/HFF-10-2016-0422. [Link to the publication](https://www.researchgate.net/publication/311681538_Counter-Extrapolation_Method_for_Conjugate_Heat_and_Mass_Transfer_with_Interfacial_Discontinuity)
3.87 MB
Loading
5.5 MB
Loading
4.88 MB
Loading
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"properties" : [{
3+
"model_part_name" : "FluidModelPart.Parts_Fluid",
4+
"properties_id" : 1,
5+
"Material" : {
6+
"Variables" : {
7+
"DENSITY" : 1.0,
8+
"DYNAMIC_VISCOSITY" : 0.00125,
9+
"CONDUCTIVITY" : 0.625,
10+
"SPECIFIC_HEAT" : 1000.0
11+
},
12+
"Tables" : {}
13+
}
14+
}]
15+
}
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"problem_data": {
3+
"start_time": 0.0,
4+
"end_time": 15.0,
5+
"echo_level": 0,
6+
"print_colors": true,
7+
"parallel_type": "OpenMP"
8+
},
9+
"solver_settings": {
10+
"type": "coupled_solvers.gauss_seidel_strong",
11+
"echo_level": 3,
12+
"predictors": [],
13+
"data_transfer_operators": {
14+
"mapper": {
15+
"type": "kratos_mapping",
16+
"mapper_settings": {
17+
"mapper_type": "nearest_neighbor"
18+
}
19+
}
20+
},
21+
"num_coupling_iterations": 10,
22+
"convergence_accelerators": [],
23+
"coupling_operations" : {
24+
"distribute_point_values" : {
25+
"type" : "distribute_point_values",
26+
"redistribution_iterations" : 100,
27+
"redistribution_tolerance" : 1e-6,
28+
"solver" : "solid",
29+
"data_point_values" : "reaction",
30+
"data_distributed_values" : "flux",
31+
"entities" : "conditions"
32+
}
33+
},
34+
"convergence_criteria": [
35+
{
36+
"type": "relative_norm_previous_residual",
37+
"solver": "fluid",
38+
"data_name": "temp",
39+
"abs_tolerance": 1e-3,
40+
"rel_tolerance": 1e-3
41+
}
42+
],
43+
"coupling_sequence": [
44+
{
45+
"name": "solid",
46+
"input_data_list": [
47+
{
48+
"data": "reaction",
49+
"from_solver": "fluid",
50+
"from_solver_data": "reaction",
51+
"data_transfer_operator": "mapper",
52+
"data_transfer_operator_options": [
53+
"swap_sign"
54+
],
55+
"after_data_transfer_operations":["distribute_point_values"]
56+
}
57+
],
58+
"output_data_list": [
59+
{
60+
"data": "temp",
61+
"to_solver": "fluid",
62+
"to_solver_data": "temp",
63+
"data_transfer_operator": "mapper"
64+
}
65+
]
66+
},
67+
{
68+
"name": "fluid",
69+
"output_data_list": [],
70+
"input_data_list": []
71+
}
72+
],
73+
"solvers": {
74+
"fluid": {
75+
"type": "solver_wrappers.kratos.convection_diffusion_wrapper",
76+
"solver_wrapper_settings": {
77+
"input_file": "ProjectParametersFTHERMAL"
78+
},
79+
"data": {
80+
"temp": {
81+
"model_part_name": "ThermalModelPart.FluidThermalInterface2D_Fluid_Interface",
82+
"variable_name": "TEMPERATURE"
83+
},
84+
"reaction": {
85+
"model_part_name": "ThermalModelPart.FluidThermalInterface2D_Fluid_Interface",
86+
"variable_name": "REACTION_FLUX"
87+
}
88+
}
89+
},
90+
"solid": {
91+
"type": "solver_wrappers.kratos.convection_diffusion_wrapper",
92+
"solver_wrapper_settings": {
93+
"input_file": "ProjectParametersSOLID"
94+
},
95+
"data": {
96+
"temp": {
97+
"model_part_name": "Parts_Solid.SolidThermalInterface2D_Solid_Interface",
98+
"variable_name": "TEMPERATURE"
99+
},
100+
"reaction": {
101+
"model_part_name": "Parts_Solid.SolidThermalInterface2D_Solid_Interface",
102+
"variable_name": "REACTION_FLUX"
103+
},
104+
"flux": {
105+
"model_part_name": "Parts_Solid.SolidThermalInterface2D_Solid_Interface",
106+
"variable_name": "FACE_HEAT_FLUX"
107+
}
108+
}
109+
}
110+
}
111+
}
112+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"properties" : [{
3+
"model_part_name" : "Parts_Solid",
4+
"properties_id" : 2,
5+
"Material" : {
6+
"Variables" : {
7+
"DENSITY" : 4.0,
8+
"CONDUCTIVITY" : 2000.0,
9+
"SPECIFIC_HEAT" : 250.0
10+
},
11+
"Tables" : {}
12+
}
13+
}]
14+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import KratosMultiphysics as KM
2+
from KratosMultiphysics.CoSimulationApplication.co_simulation_analysis import CoSimulationAnalysis
3+
import time
4+
5+
# get the start time
6+
st = time.time()
7+
8+
"""
9+
For user-scripting it is intended that a new class is derived
10+
from CoSimulationAnalysis to do modifications
11+
Check also "kratos/python_scripts/analysis-stage.py" for available methods that can be overridden
12+
"""
13+
14+
parameter_file_name = "CoSim.json"
15+
with open(parameter_file_name,'r') as parameter_file:
16+
parameters = KM.Parameters(parameter_file.read())
17+
18+
simulation = CoSimulationAnalysis(parameters)
19+
simulation.Run()
20+
21+
# get the end time
22+
et = time.time()
23+
# get the execution time
24+
elapsed_time = et - st
25+
print('Execution time:', elapsed_time, 'seconds')

0 commit comments

Comments
 (0)