Local variables to be added
const cs_lnum_t n_b_faces = domain->mesh->n_b_faces;
const cs_lnum_t *b_face_cells = domain->mesh->b_face_cells;
const cs_lnum_t c_id = b_face_cells[face_id];
CS_F_(
vel)->bc_coeffs->rcodcl1[face_id] = 5.0;
CS_F_(
vel)->bc_coeffs->rcodcl1[n_b_faces*1 + face_id] = 0;
CS_F_(
vel)->bc_coeffs->rcodcl1[n_b_faces*2 + face_id] = 0;
CS_F_(p)->bc_coeffs->rcodcl1[face_id] = 5.5;
CS_F_(
e_tot)->bc_coeffs->rcodcl1[face_id] = 355.e3;
for(
int ii = 0; ii <
CS_F_(
vel)->dim; ii++)
uref2,
dhy,
rhomoy,
viscl0);
for (int f_id = 0; f_id < n_fields; f_id++) {
continue;
int sc_id = -1;
if (sc_id < 0)
continue;
}
}
}
CS_F_(p)->bc_coeffs->rcodcl1[face_id] = 1e5;
CS_F_(
e_tot)->bc_coeffs->rcodcl1[face_id] = 294465.0;
for(
int ii = 0; ii <
CS_F_(
vel)->dim; ii++)
CS_F_(
vel)->bc_coeffs->rcodcl1[n_b_faces*ii +face_id]
= -b_face_normal[face_id][ii];
for (int f_id = 0; f_id < n_fields; f_id++) {
continue;
int sc_id = -1;
if (sc_id < 0)
continue;
}
}
CS_F_(p)->bc_coeffs->rcodcl1[face_id] = 5.e5;
}
CS_F_(
vel)->bc_coeffs->rcodcl1[face_id] = 1.0;
}
Initialization and finalization
Initialization and finalization is similar to that of the base examples
Example 1
Example of input / output for which everything is known.
Without presuming subsonic or supersonic character, the user wishes to impose all the flow characteristics. A supersonic inlet is a special case.
If the speed is outgoing, an homogenous Neumann is imposed on turbulence and user scalars.
const cs_lnum_t c_id = b_face_cells[face_id];
CS_F_(
vel)->bc_coeffs->rcodcl1[face_id] = 5.0;
CS_F_(
vel)->bc_coeffs->rcodcl1[n_b_faces*1 + face_id] = 0;
CS_F_(
vel)->bc_coeffs->rcodcl1[n_b_faces*2 + face_id] = 0;
CS_F_(p)->bc_coeffs->rcodcl1[face_id] = 5.5;
CS_F_(
e_tot)->bc_coeffs->rcodcl1[face_id] = 355.e3;
for(
int ii = 0; ii <
CS_F_(
vel)->dim; ii++)
uref2,
dhy,
rhomoy,
viscl0);
for (int f_id = 0; f_id < n_fields; f_id++) {
continue;
int sc_id = -1;
if (sc_id < 0)
continue;
}
}
Example 2
Example supersonic output
All features are output. Internal values are used to calculate the flow edge, they should not be imposed.
For turbulence and scalar, if RCODCL values are provided, they will be used in Dirichlet if the mass flow is incoming, otherwise a null flow is imposed (flow outgoing mass or RCODCL informed here). Note that for turbulence RCODCL must be defined for all turbulent variables. Otherwise a null flow is applied).
Example of supersonic outlet
All characteristics exit. Nothing should be prescribed (the internal values are used to the computation of boundary fluxes).
For turbulence and scalars, if we provide here values ofrcodcl, we prescribe them as Dirichlet values if the mass flux is entering. otherwise, we prescribe a zero flux (outgoing mass flux or rcodcl defined here). Note that for turbulence, rcodcl should be set for all turbulent variables (otherwise, we apply a zero flux).
Example 3
Subsonic input example with density and velocity.
Two of three characteristics are incoming: two informations must be provided, third is deduced by a scenario of 2-contact and 3-relaxation in the field. Here we choose to give (rho, U).
Example of a subsonic inlet (density, velocity)
2 characteristcs out ot 3 enter: both informations should be provided the third is deducted by a scenario of 2-contact and 3-relaxation in the domain. Here, whe choose to give (rho, U).
CS_F_(p)->bc_coeffs->rcodcl1[face_id] = 1e5;
CS_F_(
e_tot)->bc_coeffs->rcodcl1[face_id] = 294465.0;
for(
int ii = 0; ii <
CS_F_(
vel)->dim; ii++)
CS_F_(
vel)->bc_coeffs->rcodcl1[n_b_faces*ii +face_id]
= -b_face_normal[face_id][ii];
for (int f_id = 0; f_id < n_fields; f_id++) {
continue;
int sc_id = -1;
if (sc_id < 0)
continue;
}
}
Example 4
Subsonic outlet example
1 characteristic out of 3 exits: 1 information must be given the 2 others are deduced by a 2-contact and 3-relaxation in the domain. Here we choose to definer P.
Turbulence and user scalars take a zero flux.
CS_F_(p)->bc_coeffs->rcodcl1[face_id] = 5.e5;
}
Example 5
Wall example
CS_F_(
vel)->bc_coeffs->rcodcl1[face_id] = 1.0;
}