#include "cs_headers.h"#include <limits.h>#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <ctype.h>#include <float.h>#include <assert.h>
Include dependency graph for cs_user_lagr_particle.cpp:Functions | |
| void | cs_user_lagr_ef (cs_real_t dt_p, const cs_lnum_t p_id, const cs_real_t *taup, const cs_real_3_t *tlag, const cs_real_3_t *piil, const cs_real_33_t *bx, const cs_real_t tsfext, const cs_real_3_t *vagaus, const cs_real_3_t gradpr, const cs_real_33_t gradvf, cs_real_t rho_p, cs_real_3_t fextla) |
| User definition of an external force field acting on the particles. More... | |
| void | cs_user_lagr_extra_operations (const cs_real_t dt[]) |
| User function (non-mandatory intervention) More... | |
| void | cs_user_lagr_imposed_motion (const cs_lagr_particle_set_t *particles, cs_lnum_t p_id, const cs_real_t coords[3], const cs_real_t dt, cs_real_t disp[3]) |
| Impose the motion of a particle flagged CS_LAGR_PART_IMPOSED_MOTION. More... | |
| void | cs_user_lagr_in_force_coords (cs_lagr_particle_set_t *particles, const cs_lagr_injection_set_t *zis, const cs_lnum_t particle_range[2], const cs_lnum_t particle_face_id[], const cs_real_t visc_length[]) |
| User modification of newly injected particle location and cell_id. More... | |
| void | cs_user_lagr_in (cs_lagr_particle_set_t *particles, const cs_lagr_injection_set_t *zis, const cs_lnum_t particle_range[2], const cs_lnum_t particle_face_id[], const cs_real_t visc_length[]) |
| User modification of newly injected particles. More... | |
| void | cs_user_lagr_rt (int phase_id, cs_lnum_t p_id, cs_real_t re_p, cs_real_t uvwr, cs_real_t rho_f, cs_real_t rho_p, cs_real_t nu_f, cs_real_t *taup, const cs_real_t dt) |
| Modification of the calculation of the particle relaxation time with respect to the chosen formulation for the drag coefficient. More... | |
| void | cs_user_lagr_rt_t (cs_lnum_t p_id, cs_real_t re_p, cs_real_t uvwr, cs_real_t rho_f, cs_real_t rho_p, cs_real_t nu_f, cs_real_t cp_f, cs_real_t k_f, cs_real_2_t tempct, const cs_real_t dt) |
| Modification of the calculation of the thermal relaxation time of the particles with respect to the chosen formulation of the Nusselt number. More... | |
| void | cs_user_lagr_sde (const cs_real_t dt, const cs_lnum_t p_id, const cs_real_t *taup, const cs_real_3_t *tlag, const cs_real_2_t tempct, const int nor) |
| User integration of the SDE for the user-defined variables. More... | |
| void cs_user_lagr_ef | ( | cs_real_t | dt_p, |
| const cs_lnum_t | p_id, | ||
| const cs_real_t * | taup, | ||
| const cs_real_3_t * | tlag, | ||
| const cs_real_3_t * | piil, | ||
| const cs_real_33_t * | bx, | ||
| const cs_real_t | tsfext, | ||
| const cs_real_3_t * | vagaus, | ||
| const cs_real_3_t | gradpr, | ||
| const cs_real_33_t | gradvf, | ||
| cs_real_t | rho_p, | ||
| cs_real_3_t | fextla | ||
| ) |
User definition of an external force field acting on the particles.
It must be prescribed in every cell and be homogeneous to gravity (m/s^2) By default gravity and drag force are the only forces acting on the particles (the gravity components gx gy gz are assigned in the GUI or in cs_user_parameters) Note that taup, tlag, piil and bx are associated to the particle and their value for all phases is provided
| [in] | dt_p | time step (for the cell) |
| [in] | p_id | particle id |
| [in] | taup | particle relaxation time |
| [in] | tlag | relaxation time for the flow |
| [in] | piil | term in the integration of the sde |
| [in] | bx | characteristics of the turbulence |
| [in] | tsfext | infos for the return coupling |
| [in] | vagaus | Gaussian random variables |
| [in,out] | rho_p | particle density |
| [out] | fextla | user external force field (m/s^2)$ |
| void cs_user_lagr_extra_operations | ( | const cs_real_t | dt[] | ) |
User function (non-mandatory intervention)
User-defined modifications on the variables at the end of the Lagrangian time step and calculation of user-defined additional statistics on the particles.
| void cs_user_lagr_imposed_motion | ( | const cs_lagr_particle_set_t * | particles, |
| cs_lnum_t | p_id, | ||
| const cs_real_t | coords[3], | ||
| const cs_real_t | dt, | ||
| cs_real_t | disp[3] | ||
| ) |
Impose the motion of a particle flagged CS_LAGR_PART_IMPOSED_MOTION.
User-defined modifications on the particle position and its velocity.
| [in] | particles | pointer to particle set |
| [in] | p_id | particle id |
| [in] | coords | old particle coordinates |
| [in] | dt | time step (per particle) |
| [out] | disp | particle dispacement |
| void cs_user_lagr_in | ( | cs_lagr_particle_set_t * | particles, |
| const cs_lagr_injection_set_t * | zis, | ||
| const cs_lnum_t | particle_range[2], | ||
| const cs_lnum_t | particle_face_id[], | ||
| const cs_real_t | visc_length[] | ||
| ) |
User modification of newly injected particles.
This function is called after the initialization of the new particles in order to modify them according to new particle profiles (injection profiles, statistical weights, correction of the diameter if the standard-deviation option is activated); the modification of particles position should preferentially be made in cs_user_lagr_in_force_coords to get an initialization of particle properties coherent with the local fields.
This function is called for each injection zone and class. Particles with ids between pset->n_particles and n_elts are initialized but may be modified by this function.
| [in,out] | particles | particle set |
| [in] | zis | injection data for this set |
| [in] | particle_range | start and past-the-end ids of new particles for this zone and class |
| [in] | particle_face_id | face ids of new particles if zone is a boundary, NULL otherwise |
| [in] | visc_length | viscous layer thickness (size: number of mesh boundary faces) |
| void cs_user_lagr_in_force_coords | ( | cs_lagr_particle_set_t * | particles, |
| const cs_lagr_injection_set_t * | zis, | ||
| const cs_lnum_t | particle_range[2], | ||
| const cs_lnum_t | particle_face_id[], | ||
| const cs_real_t | visc_length[] | ||
| ) |
User modification of newly injected particle location and cell_id.
This function is called before the initialization of the new particles in order to initialize them according to new particle positions, to this aim it is necessary to modify the cell_id associated to the particle accordingly.
This function is called for each injection zone and class. Particles with ids between pset->n_particles and n_elts are initialized but may be modified by this function.
| [in,out] | particles | particle set |
| [in] | zis | injection data for this set |
| [in] | particle_range | start and past-the-end ids of new particles for this zone and class |
| [in] | particle_face_id | face ids of new particles if zone is a boundary, NULL otherwise |
| [in] | visc_length | viscous layer thickness (size: number of mesh boundary faces) |
| void cs_user_lagr_rt | ( | int | phase_id, |
| cs_lnum_t | id_p, | ||
| cs_real_t | re_p, | ||
| cs_real_t | uvwr, | ||
| cs_real_t | rho_f, | ||
| cs_real_t | rho_p, | ||
| cs_real_t | nu_f, | ||
| cs_real_t * | taup, | ||
| const cs_real_t | dt | ||
| ) |
Modification of the calculation of the particle relaxation time with respect to the chosen formulation for the drag coefficient.
This function is called in a loop on the particles, so be careful to avoid too costly operations.
\f$\tau_c = \frac{m_p{C_p}_p}{PId_p^2h_e}\f$
\f$\tau_c\f$ : Thermal relaxation time (value to be computed)
\f$m_p\f$ : Particle mass
\f${C_p}_p\f$ : Particle specific heat
\f$d_p\f$ : Particle diameter
\f$h_e\f$ : Coefficient of thermal exchange
The coefficient of thermal exchange is calculated from a Nusselt number, itself evaluated by a correlation (Ranz-Marshall by default)
\f$\nu = \frac{h_ed_p}{\lambda} = 2 + 0.55{\Re_e}_p^{0.5}P_{rt}^{0.33}\f$
\f$\lambda\f$ : Thermal conductivity of the carrier field
\f${\Re_e}_p\f$ : Particle Reynolds number
: Prandtl number
| void cs_user_lagr_rt_t | ( | cs_lnum_t | id_p, |
| cs_real_t | re_p, | ||
| cs_real_t | uvwr, | ||
| cs_real_t | rho_f, | ||
| cs_real_t | rho_p, | ||
| cs_real_t | nu_f, | ||
| cs_real_t | cp_f, | ||
| cs_real_t | k_f, | ||
| cs_real_2_t | tempct, | ||
| const cs_real_t | dt | ||
| ) |
Modification of the calculation of the thermal relaxation time of the particles with respect to the chosen formulation of the Nusselt number.
This function is called in a loop on the particles, so be careful to avoid too costly operations.
| void cs_user_lagr_sde | ( | const cs_real_t | dt, |
| const cs_lnum_t | p_id, | ||
| const cs_real_t * | taup, | ||
| const cs_real_3_t * | tlag, | ||
| const cs_real_2_t | tempct, | ||
| const int | nor | ||
| ) |
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.
Note that taup, tlag are associated to the particle and their value for all phases is provided
| [in] | dt | time step (per cell) |
| [in] | p_id | particle id |
| [in] | taup | particle relaxation time |
| [in] | tlag | relaxation time for the flow |
| [in] | tempct | characteristic thermal time and implicit source term of return coupling |
| [in] | nor | current step id (for 2nd order scheme) |