Additional right-hand side source terms for velocity components equation (Navier-Stokes)
Local variables and initialization
const cs_lnum_t n_cells = domain->mesh->n_cells;
const cs_real_t *cell_f_vol = domain->mesh_quantities->cell_vol;
Example
Example of arbitrary source term for component
:
appearing in the equation under the form:

In the following example:
with:
CKP = 1.0
(in
) (return term on velocity)
MMT = 100.0
(in
) (momentum production by volume and time unit)
which yields:
st_imp[i][0][0] = volume[i] * A = - volume[i]*(rho*CKP)
st_exp[i][0] = volume[i] * B = volume[i]*(XMMT)
Body
_st_imp[i][0][0] = - cell_f_vol[i] * cpro_rom[i] * ckp;
_st_exp[i][0] = cell_f_vol[i] * cpro_rom[i] * xmmt;
}
}
Example of a boussinesq momentum source term
Example to add Boussinesq source to the z component of
:
Body
_st_exp[i][2] = cell_f_vol[i] * ro0 * beta * (cvar_temperature[i]-
t0);
}
}