Introduction
Source terms modelling condensation inside the fluid domain on internal metal structures and at the boundaries can be set respectively through the subroutines cs_user_metal_structures_source_terms and cs_user_wall_condensation.
Source terms for condensation on internal metal structures
This model can be enabled in the subroutine usppmo in the file cs_user_parameters.f90 as follows:
if ( ippmod(igmix).ge.0 ) then
icondv = -1
endif
The setting of the condensation source terms is then done in the subroutine cs_user_metal_structures_source_terms as follows below.
The following variables need to be declared:
integer icmst
integer ifac, iel, iscal
integer ivarh
integer izone
integer f_id
double precision hvap, tk
type(gas_mix_species_prop) s_h2o_g
double precision, dimension(:), pointer :: cpro_cp
double precision, dimension(:), pointer :: cvar_h
Necessary species physical properties can be retrieved as follows:
call field_get_id_try("y_h2o_g", f_id)
if (f_id.ne.-1) &
call field_get_key_struct_gas_mix_species_prop(f_id, s_h2o_g)
The zones on which the condensation mass source term will be imposed can be defined as follows:
izone = 0
met_znb = 1
do izmet = 1 , met_znb
if (izmet.eq.1) then
call getcel(
'z > -7.0d0 and z < 53.d0', ncmast, ltmast)
izone = izone + 1
do icmst = 1, ncmast
iel = ltmast(icmst)
izmast(iel) = izone
enddo
endif
enddo
subroutine getcel(fstr, cellnb, cells)
Build the list of cells matching a criteria string.
Definition: cs_selector_f2c.f90:179
Modelling of the metal side (wall thermal model and metal properties can then be specified as follows:
if (icondv.eq.0) then
itagms = 1
if(itagms.eq.1) then
xem = 0.024d0
tmet0 = 92.d0
xro_m = 8000.d0
xcond_m = 12.8d0
xcp_m = 500.0d0
else
tmet = 92.d0
endif
endif
Finally the source term type and values have to be set as follows:
if (icp.ge.0) call field_get_val_s(icp, cpro_cp)
ivarh = isca(iscalt)
call field_get_val_s(ivarfl(ivarh), cvar_h)
do icmst = 1, ncmast
iel = ltmast(icmst)
if (ntcabs.le.1) then
tk = t0
else
tk = cvar_h(iel)/cpro_cp(iel)
endif
hvap = s_h2o_g%cp*tk
if (nscal.gt.0) then
do iscal = 1, nscal
if (iscal.eq.iscalt) then
itypst(iel,isca(iscalt)) = 1
svcond(iel,isca(iscalt)) = hvap
else
itypst(iel,isca(iscal)) = 1
svcond(iel,isca(iscal)) = 0.d0
endif
enddo
endif
enddo
Boundary source terms for condensation
The condensation of steam on surfaces can be activated by adding the following lines in function cs_user_model of file cs_user_parameters.c :
cs_wall_cond_t * cs_get_glob_wall_cond(void)
Provide writable access to _wall_cond structure.
Definition: cs_wall_condensation.c:812
@ CS_WALL_COND_MODEL_DEHBI
Definition: cs_wall_condensation.h:48
Definition: cs_wall_condensation.h:61
int icondb
Definition: cs_wall_condensation.h:62
cs_wall_cond_natural_conv_model_t natural_conv_model
Definition: cs_wall_condensation.h:66
The subroutine cs_user_wall_condensation is called three times.
The first call computes the number of boundary faces and the number of zones on which a boundary mass source term is imposed, based on the selection criteria prescribed by the user.
In this example, all faces with tag "60" in the mesh are gathered in a single condensation zone.
if (iappel == 1 || iappel == 2) {
for (ieltcd = 0; ieltcd < zone->
n_elts; ieltcd++) {
if (iappel == 2) {
wall_cond->
ifbpcd[ieltcd] = ifac;
wall_cond->
izzftcd[ieltcd] = izone;
}
}
}
if (iappel == 1) {
wall_cond->
nfbpcd = ieltcd + 1;
wall_cond->
nzones = izone + 1;
}
const cs_zone_t * cs_boundary_zone_by_name_try(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.c:737
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
cs_lnum_t * izzftcd
Definition: cs_wall_condensation.h:74
cs_lnum_t nfbpcd
Definition: cs_wall_condensation.h:71
cs_lnum_t nzones
Definition: cs_wall_condensation.h:86
cs_lnum_t * ifbpcd
Definition: cs_wall_condensation.h:72
const cs_lnum_t * elt_ids
Definition: cs_zone.h:65
cs_lnum_t n_elts
Definition: cs_zone.h:64
At the second call, connectivity tables are built between the global mesh numbering and the one dedicated to wall condensation (see snippet above). In addition, parameters related to the condensation model are set.
if (iappel == 2) {
wall_thermal->ztheta[iz] = 1.0;
wall_thermal->zdxmin[iz] = 0.0;
wall_thermal->znmur[iz] = 10;
wall_thermal->zepais[iz] = 0.024;
wall_thermal->ztpar0[iz] = 26.57;
}
}
}
cs_lnum_t * iztag1d
Definition: cs_wall_condensation.h:89
cs_lnum_t * izcophc
Definition: cs_wall_condensation.h:87
cs_lnum_t * izcophg
Definition: cs_wall_condensation.h:88
At the third call, properties related to the solid wall are set.
wall_thermal->zhext[iz] = 1.e8;
wall_thermal->ztext[iz] = 26.57;
wall_thermal->zrob[iz] = 8000.0;
wall_thermal->zcondb[iz] = 12.8;
wall_thermal->zcpb[iz] = 500.0;
}
else {
wall_cond->
ztpar[iz] = 26.57;
}
}
cs_real_t * ztpar
Definition: cs_wall_condensation.h:90
Finally, the source terms associated with the condensation phenomenon are defined.
for (ieltcd = 0; ieltcd <
nfbpcd; ieltcd++) {
tk = cvar_h[iel] / cpro_cp[iel];
if (turb_mdl->itytur == 2) {
}
for (int f_id = 0; f_id < n_fields; f_id++) {
if (iscal > 0) {
}
else {
= 0.0;
}
}
}
}
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.c:2316
int cs_field_get_key_int(const cs_field_t *f, int key_id)
Return a integer value for a given key associated with a field.
Definition: cs_field.c:3064
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.c:404
cs_field_t * cs_thermal_model_field(void)
Definition: cs_thermal_model.c:179
cs_time_step_t * cs_get_glob_time_step(void)
Provide read/write access to cs_glob_time_step.
Definition: cs_time_step.c:433
integer(c_int), pointer, save nfbpcd
number of faces in which a condensation source terms is imposed. See ifbpcd and the user subroutine c...
Definition: cs_nz_condensation.f90:55
#define CS_FIELD_VARIABLE
Definition: cs_field.h:63
integer, save ik
turbulent kinetic energy
Definition: numvar.f90:75
integer, save iep
turbulent dissipation
Definition: numvar.f90:79
integer, save iv
velocity component
Definition: numvar.f90:63
integer, save iu
velocity component
Definition: numvar.f90:59
integer, save iw
velocity component
Definition: numvar.f90:67
elemental pure integer function ifabor(ifac)
index-number of the (unique) neighboring cell for each boundary face
Definition: mesh.f90:252
integer(c_int), pointer, save ntcabs
Current absolute time step number. In case of restart, this is equal to ntpabs + number of new iterat...
Definition: optcal.f90:196
double t0
Definition: cs_physical_constants.h:80
int nt_cur
Definition: cs_time_step.h:74
cs_lnum_t * itypcd
Definition: cs_wall_condensation.h:73
cs_real_t * spcond
Definition: cs_wall_condensation.h:75