8.0
general documentation
Infinite channel inlet with near-inlet feedback

A second method of defining an inlet condition which converges towards an infinite channel profile is based simply on feedback from values computed at inlet cell centers (combining the inlet boundary conditions and the effect of wall friction on the inlet walls). It assumes the mesh is very regular and orthogonal, at least on the first two inlet cell layers (using a gradient correction in the case of a less regular mesh might work, but has never been tested.

Initialization and finalization

Initialization and finalization is similar to that of the base examples

const cs_lnum_t n_cells_ext = domain->mesh->n_cells_with_ghosts;
const cs_lnum_t n_b_faces = domain->mesh->n_b_faces;
const int n_fields = cs_field_n_fields();
const int keysca = cs_field_key_id("scalar_id");
const int nt_cur = domain->time_step->nt_cur;
const cs_lnum_t *b_face_cells = domain->mesh->b_face_cells;
const cs_real_3_t *restrict b_face_normal
= (const cs_real_3_t *restrict)domain->mesh_quantities->b_face_normal;
const cs_real_t *restrict b_face_surf
= ( const cs_real_t *restrict)domain->mesh_quantities->b_face_surf;
const cs_real_t *bpro_rho = CS_F_(rho_b)->val;
const cs_real_3_t *cvar_vel = (const cs_real_3_t *)CS_F_(vel)->val;
const cs_zone_t *zn = NULL;
#define restrict
Definition: cs_defs.h:139
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
int cs_field_n_fields(void)
Return the number of defined fields.
Definition: cs_field.c:1527
int cs_field_key_id(const char *name)
Return an id associated with a given key name.
Definition: cs_field.c:2570
@ vel
Definition: cs_field_pointer.h:68
@ rho_b
Definition: cs_field_pointer.h:98
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.c:404
real(c_double), pointer, save viscl0
reference molecular dynamic viscosity.
Definition: cstphy.f90:157
double viscl0
Definition: cs_physical_constants.h:73
Definition: cs_zone.h:55

Body

Here, we define an inlet boundary condition for a very long channel or duct with a section matching the boundary faces of zone 'INLET'.

We fix a mean inlet velocity, and use a feedback loop assuming a fixed-point type behavior will allow us to reach a state matching that of a very long inlet channel.

Warning
We assume other boundary conditions are defined before this one (ideally, using the GUI).
We also assume that the mesh is orthogonal at the inlet, and we are using a RANS (not LES) computation. to the current inlet.

For EBRSM of V2f models, to avoid laminarization at the inlet, the initial velocity (at the first time step) is divided by 10 on inlet faces adjacent to the boundary, so as to ensure a velocity gradient and turbulent production. Otherwise, the initialization may fail.