|
My Project
programmer's documentation
|
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
Only apply to thermal scalar
if (scalar_id < 0 || scalar_id != cs_glob_thermal_model->
iscalt)
return;
Function body
Map required fields
Compute bulk mean velocity
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;
}
cs_lnum_t n_cells
Definition: cs_mesh.h:73
void const int * f_id
Definition: cs_gui.h:292
cs_mesh_quantities_t * cs_glob_mesh_quantities
double precision, dimension(:), pointer cell_f_vol
Definition: mesh.f90:156
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:315
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
static void cs_parall_sum(int n, cs_datatype_t datatype, void *val)
Sum values of a given datatype on all default communicator processes.
Definition: cs_parall.h:147
Definition: cs_defs.h:265
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.c:2976
void cs_int_t cs_int_t * iscalt
Definition: cs_lagr_options.h:74
#define CS_F_(e)
Macro used to return a field pointer by its enumerated value.
Definition: cs_field_pointer.h:51
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_field_t * cs_field_by_id(int id)
Return a pointer to a field based on its id.
Definition: cs_field.c:2307
cs_real_t * cell_vol
Definition: cs_mesh_quantities.h:93
void const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_int_t *const const cs_real_t *const const cs_real_t *const const cs_real_t const cs_real_t const cs_real_3_t vel[]
Definition: cs_divergence.h:64
int cs_field_key_id(const char *name)
Return an id associated with a given key name.
Definition: cs_field.c:2490
cs_real_t tot_vol
Definition: cs_mesh_quantities.h:131
Field descriptor.
Definition: cs_field.h:124