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;
= domain->mesh_quantities->b_face_u_normal;
const cs_lnum_t c_id = b_face_cells[face_id];
vel_rcodcl1[face_id] = 5.0;
vel_rcodcl1[n_b_faces*1 + face_id] = 0;
vel_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;
uref2,
dhy,
rhomoy,
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;
vel_rcodcl1[n_b_faces*ii +face_id] = -b_face_u_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;
}
vel_rcodcl1[face_id] = 1.0;
}
const cs_zone_t * cs_boundary_zone_by_name(const char *name)
Return a pointer to a boundary zone based on its name if present.
Definition: cs_boundary_zone.cpp:716
#define restrict
Definition: cs_defs.h:158
double cs_real_t
Floating-point value.
Definition: cs_defs.h:357
cs_nreal_t cs_nreal_3_t[3]
Definition: cs_defs.h:400
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:350
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.cpp:3157
int cs_field_n_fields(void)
Return the number of defined fields.
Definition: cs_field.cpp:1486
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.cpp:2347
int cs_field_key_id(const char *name)
Return an id associated with a given key name.
Definition: cs_field.cpp:2663
@ p
Definition: cs_field_pointer.h:67
@ t_kelvin
Definition: cs_field_pointer.h:118
@ vel
Definition: cs_field_pointer.h:70
@ e_tot
Definition: cs_field_pointer.h:97
@ rho
Definition: cs_field_pointer.h:100
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
static CS_F_HOST_DEVICE cs_real_t cs_math_pow2(cs_real_t x)
Compute the square of a real value.
Definition: cs_math.h:787
@ CS_BC_NEUMANN
Definition: cs_param_types.h:503
@ CS_BC_WALL_MODELLED
Definition: cs_param_types.h:508
@ CS_EPHCF
Definition: cs_parameters.h:96
@ CS_ESICF
Definition: cs_parameters.h:92
@ CS_SOPCF
Definition: cs_parameters.h:95
@ CS_SSPCF
Definition: cs_parameters.h:94
@ CS_SMOOTHWALL
Definition: cs_parameters.h:89
const cs_fluid_properties_t * cs_glob_fluid_properties
Definition: cs_physical_constants.cpp:465
void cs_turbulence_bc_inlet_hyd_diam(cs_lnum_t face_id, double uref2, double dh, double rho, double mu)
Set inlet boundary condition values for turbulence variables based on a diameter and the reference v...
Definition: cs_turbulence_bc.cpp:773
real(c_double), pointer, save viscl0
reference molecular dynamic viscosity.
Definition: cstphy.f90:82
#define CS_FIELD_VARIABLE
Definition: cs_field.h:64
CS_F_HOST_DEVICE T max(const T a, const T b)
Definition: cs_defs.h:769
cs_real_t * rcodcl1
Definition: cs_field.h:125
Field descriptor.
Definition: cs_field.h:156
int type
Definition: cs_field.h:161
cs_field_bc_coeffs_t * bc_coeffs
Definition: cs_field.h:188
double viscl0
Definition: cs_physical_constants.h:75
const cs_lnum_t * elt_ids
Definition: cs_zone.h:65
cs_lnum_t n_elts
Definition: cs_zone.h:64
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];
vel_rcodcl1[face_id] = 5.0;
vel_rcodcl1[n_b_faces*1 + face_id] = 0;
vel_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;
uref2,
dhy,
rhomoy,
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;
vel_rcodcl1[n_b_faces*ii +face_id] = -b_face_u_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
vel_rcodcl1[face_id] = 1.0;
}