The cs_user_1d_wall_thermal subroutine is used to set the 1D-wall thermal module parameters.
This function is called 3 times:
- A first call (
iappel == 1) to count faces in the selected zones.
- A second call (
iappel == 2) to initialize associated arrays.
- Subsequent calls (
iappel == 3) at each time step to define and update additional arrays.
Local variables declaration
The values in this example should be defined for each call.
cs_1d_wall_thermal_t * cs_get_glob_1d_wall_thermal(void)
Provide access to cs_glob_1d_wall_thermal.
Definition: cs_1d_wall_thermal.cpp:1161
1D wall thermal module descriptor.
Definition: cs_1d_wall_thermal.h:102
The restart behavior of this module can be modified by adapting the following snippet:
int cs_restart_present(void)
Check if we have a restart directory.
Definition: cs_restart.cpp:2168
bool use_restart
Definition: cs_1d_wall_thermal.h:113
Associatation with boundary zones.
For the first and second initialization passes (iappel = 1 or 2), the associated faces must be determined.
At the first pass, the faces must simply be counted. At the second pass, the list of associated faces is actually set.
The following code illustrates how this can be handled.
if (iappel == 1 || iappel == 2) {
&nlelt, lstelt);
if (iappel == 1) {
}
else if (iappel == 2) {
for (
cs_lnum_t ilelt = 0 ; ilelt < nlelt ; ilelt++) {
wall_thermal->
ifpt1d[ifbt1d] = ifac+1;
ifbt1d++;
}
}
}
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:350
#define CS_FREE(_ptr)
Definition: cs_mem.h:155
#define CS_MALLOC(_ptr, _ni, _type)
Allocate memory for _ni elements of type _type.
Definition: cs_mem.h:79
void cs_selector_get_b_face_list(const char *criteria, cs_lnum_t *n_b_faces, cs_lnum_t b_face_list[])
Fill a list of boundary faces verifying a given selection criteria.
Definition: cs_selector.cpp:91
cs_lnum_t nfpt1d
Definition: cs_1d_wall_thermal.h:104
cs_lnum_t * ifpt1d
Definition: cs_1d_wall_thermal.h:117
cs_lnum_t n_b_faces
Definition: cs_mesh.h:99
Thermal model setup.
At the second initialization pass (iappel 2), the number of discretization points along each 1d segment, their distribution (based on a geometric progression ratio), the wall thickness, and initial temperature must also be defined:
For the second initialization pass (iappel 2), The list of associated faces is actualley set. Also, the number of discretization points along each 1d segment, their distribution (based on a geometric progression ratio), the wall thickness, and initial temperature must also be defined.
if (iappel == 2) {
}
}
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.cpp:465
cs_real_t rgpt1d
Definition: cs_1d_wall_thermal.h:70
cs_real_t eppt1d
Definition: cs_1d_wall_thermal.h:67
int nppt1d
Definition: cs_1d_wall_thermal.h:58
cs_1d_wall_thermal_local_model_t * local_models
Definition: cs_1d_wall_thermal.h:126
cs_real_t * tppt1d
Definition: cs_1d_wall_thermal.h:121
double t0
Definition: cs_physical_constants.h:82
Computation
In the solution steps, the solid thermal properties and boundary conditions can be updated at each time step, where the function is called with parameter iappel = 3.
if (iappel == 3) {
if (
cdgfbo[face_id][2] <= 1.e-3) {
}
else {
}
}
}
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:374
@ dt
Definition: cs_field_pointer.h:65
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
cs_mesh_quantities_t * cs_glob_mesh_quantities
double precision, dimension(:,:), pointer cdgfbo
coordinates of the centers of the boundary faces
Definition: mesh.f90:65
cs_real_t xlmbt1
Definition: cs_1d_wall_thermal.h:83
int iclt1d
Definition: cs_1d_wall_thermal.h:62
cs_real_t rcpt1d
Definition: cs_1d_wall_thermal.h:85
cs_real_t dtpt1d
Definition: cs_1d_wall_thermal.h:88
cs_real_t tept1d
Definition: cs_1d_wall_thermal.h:73
cs_real_3_t * b_face_cog
Definition: cs_mesh_quantities.h:107
cs_lnum_t * b_face_cells
Definition: cs_mesh.h:112