Additional right-hand side source terms for scalar equations (user scalars and specific physics scalars) with the cs_user_source_terms user-defined function.
Local variables and initialization
Field descriptor.
Definition: cs_field.h:275
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
cs_field_t * cs_field(int id)
Return a pointer to a field based on its id. This function requires that a field of the given id is d...
Definition: cs_field.cpp:4295
cs_mesh_quantities_t * cs_glob_mesh_quantities
cs_real_t * cell_vol
Definition: cs_mesh_quantities.h:92
cs_lnum_t n_cells
Definition: cs_mesh.h:97
Only apply to thermal scalar
return;
cs_field_t * cs_thermal_model_field(void)
Definition: cs_thermal_model.cpp:180
Function body
Map required fields
const auto cvar_vel =
CS_F_(
vel)->get_val_v();
@ vel
Definition: cs_field_pointer.h:66
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:47
Compute bulk mean velocity
ubulk += cvar_vel(i, 0) * cell_f_vol[i];
static void sum(const cs_mpi_wrapper &mpi_w, T &first, Vals &... values)
Sum values of a given datatype over a given communicator.
Definition: cs_parall.h:893
cs_real_t tot_vol
Definition: cs_mesh_quantities.h:134
Compute source terms; we want to impose a total flux of 1 Watt.
st_imp[i] = 0.;
st_exp[i] = cell_f_vol[i] * cvar_vel(i, 0) * tot_flux / ubulk;
}