Conjugate Heat Transfer (CHT) Solver Example

Contents

Conjugate Heat Transfer (CHT) Solver Example#

This script demonstrates the setup and running of a steady-state Conjugate Heat Transfer (CHT) simulation using the Flow360 Python API. It illustrates the process of defining coupled fluid and solid domains from a pre-existing volume mesh, specifying material properties and thermal boundary conditions within the SI unit system, configuring appropriate solver models for both fluid dynamics and heat conduction in a solid, and submitting the simulation case for computation.

 1import flow360 as fl
 2from flow360.examples import TutorialCHTSolver
 3
 4TutorialCHTSolver.get_files()
 5project = fl.Project.from_volume_mesh(
 6    TutorialCHTSolver.mesh_filename, name="Tutorial CHT Solver from Python"
 7)
 8volume_mesh = project.volume_mesh
 9
10with fl.SI_unit_system:
11    params = fl.SimulationParams(
12        reference_geometry=fl.ReferenceGeometry(
13            moment_center=[0, 0, 0] * fl.u.m,
14            moment_length=[1, 1, 1] * fl.u.m,
15            area=1 * fl.u.m**2,
16        ),
17        operating_condition=fl.AerospaceCondition.from_mach(mach=0.1),
18        time_stepping=fl.Steady(
19            max_steps=10000, CFL=fl.RampCFL(initial=1, final=100, ramp_steps=1000)
20        ),
21        models=[
22            fl.Fluid(
23                navier_stokes_solver=fl.NavierStokesSolver(
24                    absolute_tolerance=1e-9,
25                    linear_solver=fl.LinearSolver(max_iterations=35),
26                    order_of_accuracy=2,
27                    kappa_MUSCL=-1,
28                ),
29                turbulence_model_solver=fl.SpalartAllmaras(
30                    absolute_tolerance=1e-8,
31                    linear_solver=fl.LinearSolver(max_iterations=25),
32                    equation_evaluation_frequency=4,
33                    order_of_accuracy=2,
34                ),
35            ),
36            fl.Solid(
37                entities=volume_mesh["solid"],
38                heat_equation_solver=fl.HeatEquationSolver(
39                    absolute_tolerance=1e-11,
40                    linear_solver=fl.LinearSolver(
41                        max_iterations=25,
42                        absolute_tolerance=1e-12,
43                    ),
44                    equation_evaluation_frequency=10,
45                ),
46                material=fl.SolidMaterial(
47                    name="copper",
48                    thermal_conductivity=398 * fl.u.W / (fl.u.m * fl.u.K),
49                ),
50                volumetric_heat_source=5e3 * fl.u.W / (0.01257 * fl.u.m**3),
51            ),
52            fl.Wall(
53                surfaces=volume_mesh["fluid/centerbody"],
54            ),
55            fl.Freestream(
56                surfaces=volume_mesh["fluid/farfield"],
57            ),
58            fl.Wall(
59                surfaces=volume_mesh["solid/adiabatic"],
60                heat_spec=fl.HeatFlux(0 * fl.u.W / fl.u.m**2),
61            ),
62        ],
63        outputs=[
64            fl.VolumeOutput(
65                output_format="both",
66                output_fields=[
67                    "primitiveVars",
68                    "T",
69                    "Cp",
70                    "Mach",
71                ],
72            ),
73            fl.SurfaceOutput(
74                surfaces=volume_mesh["*"],
75                output_format="both",
76                output_fields=["primitiveVars", "T", "Cp", "Cf", "CfVec"],
77            ),
78        ],
79    )
80
81project.run_case(params=params, name="Tutorial CHT Solver from Python")

Notes#

  • This example showcases a CHT simulation, coupling fluid flow (Navier-Stokes) and solid heat conduction (Heat Equation) solvers.

  • The fl.Solid model is employed to define the solid domain, its material properties (fl.SolidMaterial), and internal heat generation (volumetric_heat_source).

  • Thermal boundary conditions are specified, including an adiabatic wall condition using fl.HeatFlux(0).