Introduction
User integration of the SDE for the user-defined variables.
The variables are constant by default. The SDE must be of the form:
T: particle attribute representing the variable
Tca: characteristic time for the sde to be prescribed in the array auxl1
PIP: coefficient of the SDE (pseudo RHS) to be prescribed in the array auxl2.
If the chosen scheme is first order (nordre=1) then, at the first and only call pip is expressed as a function of the quantities of the previous time step (contained in the particle data).
If the chosen scheme is second order (nordre=2) then, at the first call (nor=1) pip is expressed as a function of the quantities of the previous time step, and at the second passage (nor=2) pip is expressed as a function of the quantities of the current time step.
Example
Example of the integration of the SDE (Stochastic Differential Equation).
void
{
for (int i = 0;
i++) {
tcarac[p_id] = 1.0;
pip[p_id] = prev_usr_var[i];
else
pip[p_id] = usr_var[i];
}
}
}
#define BFT_FREE(_ptr)
Definition: bft_mem.h:90
#define BFT_MALLOC(_ptr, _ni, _type)
Definition: bft_mem.h:58
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:359
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
@ dt
Definition: cs_field_pointer.h:65
cs_lagr_model_t * cs_glob_lagr_model
cs_lagr_time_step_t * cs_glob_lagr_time_step
cs_lagr_particle_set_t * cs_lagr_get_particle_set(void)
Return pointer to the main cs_lagr_particle_set_t structure.
Definition: cs_lagr_particle.cpp:1194
@ CS_LAGR_USER
Definition: cs_lagr_particle.h:178
static void * cs_lagr_particles_attr_n(cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr)
Get pointer to attribute data of a given particle in a set at a given time.
Definition: cs_lagr_particle.h:464
void cs_user_lagr_sde(const cs_real_t dt[], cs_real_t taup[], cs_real_3_t tlag[], cs_real_t tempct[])
User integration of the SDE for the user-defined variables.
Definition: cs_user_lagr_particle.cpp:386
void cs_lagr_sde_attr(cs_lagr_attribute_t attr, cs_real_t *tcarac, cs_real_t *pip)
Integration of a stochastic differential equation (SDE) for a user particle variable (attribute).
Definition: cs_lagr_sde.cpp:3043
int n_user_variables
Definition: cs_lagr.h:340
Definition: cs_lagr_particle.h:223
cs_lnum_t n_particles
Definition: cs_lagr_particle.h:225
int nor
Definition: cs_lagr.h:553