Local variables common to following examples
The following declaration and initialization block is required used for the examples of this section:
const cs_lnum_t n_b_faces = domain->mesh->n_b_faces;
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:1502
cs_field_t * cs_field_by_name(const char *name)
Return a pointer to a field based on its name.
Definition: cs_field.c:2344
Field descriptor.
Definition: cs_field.h:131
Initialization and finalization
Initialization and finalization is similar to that of the base examples
Example 1
Example of specific boundary conditions fully defined by the user, on the basis of wall conditions selection (mass flow computation, specific logging, ...)
²We prescribe for zone 'wall_s' a wall, with in addition:
- a Dirichlet condition on velocity (sliding wall with no-slip condition)
- a Dirichlet condition on the first scalar.
CS_F_(
vel)->bc_coeffs->icodcl[face_id] = 1;
vel_rcodcl1[n_b_faces*0 + face_id] = 1.;
vel_rcodcl1[n_b_faces*1 + face_id] = 0.;
vel_rcodcl1[n_b_faces*2 + face_id] = 0.;
vel_rcodcl3[n_b_faces*0 + face_id] = 0;
vel_rcodcl3[n_b_faces*1 + face_id] = 0;
vel_rcodcl3[n_b_faces*2 + face_id] = 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.c:711
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
@ vel
Definition: cs_field_pointer.h:68
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
const cs_real_t cs_math_infinite_r
@ CS_SMOOTHWALL
Definition: cs_parameters.h:87
cs_real_t * rcodcl2
Definition: cs_field.h:110
cs_real_t * rcodcl3
Definition: cs_field.h:111
cs_real_t * rcodcl1
Definition: cs_field.h:109
int * icodcl
Definition: cs_field.h:108
cs_field_bc_coeffs_t * bc_coeffs
Definition: cs_field.h:163
const cs_lnum_t * elt_ids
Definition: cs_zone.h:65
cs_lnum_t n_elts
Definition: cs_zone.h:64
Example 2
Example of specific boundary conditions fully defined by the user, with no definition of a specific type.
We prescribe at zone 'surf_h' a homogeneous Neumann condition for all variables.
for (int f_id = 0; f_id < n_fields; f_id++) {
continue;
}
}
}
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.c:2320
@ CS_INDEF
Definition: cs_parameters.h:82
#define CS_FIELD_VARIABLE
Definition: cs_field.h:63
int type
Definition: cs_field.h:136
int dim
Definition: cs_field.h:138
Example 3
Example of wall boundary condition with automatic continuous switch between rough and smooth.
bpro_roughness[face_id] = 0.05;
}
}
cs_field_t * cs_field_by_name_try(const char *name)
Return a pointer to a field based on its name if present.
Definition: cs_field.c:2370
cs_real_t * val
Definition: cs_field.h:152