My Project
programmer's documentation
Data setting for the 1D-wall thermal module (cs_user_1d_wall_thermal.c)

The cs_user_1d_wall_thermal subroutine is used to set the 1D-wall thermal module parameters.

Local variables declaration

Allocation

BFT_MALLOC(lstelt, n_b_faces, cs_lnum_t);

Rereading of the restart file

/*----------------------------------------------------------------------------*
* Rereading of the restart file:
*----------------------------------
* isuit1 = 0 --> No rereading
* (meshing and wall temperature reinitialization)
* isuit1 = 1 --> Rereading of the restart file for the 1-Dimension
* thermal module
* isuit1 = isuite --> Rereading only if the computational fluid dynamic is
* a continuation of the computation.
* The initialization of isuit1 is mandatory.
*----------------------------------------------------------------------------*/
izone = 0;
ifbt1d = 0;

iappel = 1 or 2

if (iappel == 1 || iappel == 2) {
/*----------------------------------------------------------------------------*
* Faces determining with the 1-D thermal module:
*----------------------------------------------
*
* nfpt1d : Total number of faces with the 1D thermal module
* ifpt1d[ii]: Number of the [ii]th face with the 1D thermal module
* Remarks:
*--------
* During the rereading of the restart file, nfpt1d and ifpt1d are
* compared with the other values from the restart file being the result of
* the start or restarting computation.
*
* A total similarity is required to continue with the previous computation.
* Regarding the test case on ifpt1d, it is necessary that the array be
* arranged in increasing order (ifpt1[jj] > ifpt1d[ii] if jj > ii).
*
* If it is impossible, contact the developer team to deactivate this test.
*----------------------------------------------------------------------------*/
/* Get the list of boundary faces that will be coupled */
cs_selector_get_b_face_num_list("2 or 3 or 5 or 6 or 7 or 8 or 9 or 10",
&nlelt, lstelt);
izone++;
/* Fill the ifpt1d array, and compute nfpt1d */
for (cs_lnum_t ilelt = 0 ; ilelt < nlelt ; ilelt++) {
cs_lnum_t ifac = lstelt[ilelt];
wall_thermal->izft1d[ifac-1] = izone;
if (iappel == 2) wall_thermal->ifpt1d[ifbt1d] = ifac;
ifbt1d++;
}
}
if (iappel == 1) {
wall_thermal->nfpt1d = ifbt1d;
}

iappel = 2

/*----------------------------------------------------------------------------*
* Parameters padding of the mesh and initialization:
*--------------------------------------------------
*
* (Only one pass during the beginning of the computation)
* locals_models[ii].nppt1d: number of discretized points associated
* to the (ii)th face with the 1-D thermal module.
* locals_models[ii].eppt1d: wall thickness associated to the (ii)th face
* with the 1-D thermal module.
* locals_models[ii].rgpt1d: geometric progression ratio of the meshing refinement
* associated to the (ii)th face with the 1-D thermal module.
* (with : rgpt1d > 1 => small meshes on the fluid side)
* locals_models[ii].tppt1d: wall temperature initialization associated to the
* (ii)th face with the 1-D thermal module.
* Remarks:
*--------
* During the rereading of the restart file for the 1-D thermal module,
* the tppt1d variable is not used.
*
* The nfpt1d, eppt1d and rgpt1d variables are compared to the previous
* values being the result of the restart file.
*
* An exact similarity is necessary to continue with the previous computation.
*----------------------------------------------------------------------------*/
if (iappel == 2) {
for (cs_lnum_t ii = 0 ; ii < wall_thermal->nfpt1d ; ii++) {
wall_thermal->local_models[ii].nppt1d = 8;
wall_thermal->local_models[ii].eppt1d = 0.01144;
wall_thermal->local_models[ii].rgpt1d = 1.;
wall_thermal->tppt1d[ii] = cs_glob_fluid_properties->t0;
}
}

iappel = 3

/*----------------------------------------------------------------------------*
* Padding of the wall exterior boundary conditions:
*-------------------------------------------------
*
* local_models[ii].iclt1d: boundary condition type
* ----------
* local_models[ii].iclt1d = 1: dirichlet condition,
* with exchange coefficient
* local_models[ii].iclt1d = 3: flux condition
*
* local_models[ii].tept1d: exterior temperature
* local_models[ii].hept1d: exterior exchange coefficient
* local_models[ii].fept1d: flux applied to the exterior (flux<0 = coming flux)
* local_models[ii].xlmt1d: lambda wall conductivity coefficient (W/m/C)
* local_models[ii].rcpt1d: wall coefficient rho*Cp (J/m3/C)
* local_models[ii].dtpt1d: time step resolution of the thermal equation to the
* (ii)th boundary face with the 1-D thermal module (s)
*----------------------------------------------------------------------------*/
if (iappel == 3) {
for (cs_lnum_t ii = 0 ; ii < wall_thermal->nfpt1d ; ii++) {
wall_thermal->local_models[ii].iclt1d = 1;
wall_thermal->local_models[ii].tept1d = cs_glob_fluid_properties->t0;
/* Physical parameters */
cs_lnum_t face_id = wall_thermal->ifpt1d[ii] - 1;
/* Floor: plate */
if (cdgfbo[face_id][2] <= 1.e-3) {
wall_thermal->local_models[ii].xlmbt1 = 0.16;
wall_thermal->local_models[ii].rcpt1d = 790.*900.;
/* Wall and ceiling: marinite */
} else {
wall_thermal->local_models[ii].xlmbt1 = 0.11;
wall_thermal->local_models[ii].rcpt1d = 670.*778.;
}
cs_lnum_t c_id = b_face_cells[face_id];
wall_thermal->local_models[ii].dtpt1d = CS_F_(dt)->val[c_id];
}
}

Deallocation

cs_glob_mesh_quantities
cs_mesh_quantities_t * cs_glob_mesh_quantities
cs_restart_present
int cs_restart_present(void)
Check if we have a restart directory.
Definition: cs_restart.c:1912
cs_real_3_t
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
cs_mesh_quantities_t::b_face_cog
cs_real_t * b_face_cog
Definition: cs_mesh_quantities.h:105
cs_fluid_properties_t::t0
double t0
Definition: cs_physical_constants.h:78
ifac
void const cs_lnum_t *const ifac
Definition: cs_wall_functions.h:1147
cs_mesh_t::b_face_cells
cs_lnum_t * b_face_cells
Definition: cs_mesh.h:88
cs_mesh_t::n_b_faces
cs_lnum_t n_b_faces
Definition: cs_mesh.h:75
cs_glob_fluid_properties
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.c:346
cs_glob_mesh
cs_mesh_t * cs_glob_mesh
cs_selector_get_b_face_num_list
void cs_selector_get_b_face_num_list(const char *criteria, cs_lnum_t *n_b_faces, cs_lnum_t b_face_num_list[])
Definition: cs_selector.c:89
cs_get_glob_1d_wall_thermal
cs_1d_wall_thermal_t * cs_get_glob_1d_wall_thermal(void)
Provide acces to cs_glob_1d_wall_thermal.
Definition: cs_1d_wall_thermal.c:1218
optcal::isuit1
integer, save isuit1
Definition: optcal.f90:328
BFT_MALLOC
#define BFT_MALLOC(_ptr, _ni, _type)
Allocate memory for _ni elements of type _type.
Definition: bft_mem.h:62
BFT_FREE
#define BFT_FREE(_ptr)
Free allocated memory.
Definition: bft_mem.h:101
cs_1d_wall_thermal_t
1D wall thermal module descriptor.
Definition: cs_1d_wall_thermal.h:102
CS_F_
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
dt
Definition: cs_field_pointer.h:65
lstelt
void cs_int_t cs_int_t * lstelt
Definition: cs_syr_coupling.h:194
mesh::cdgfbo
double precision, dimension(:,:), pointer cdgfbo
Definition: mesh.f90:144