programmer's documentation
Functions
cs_user_lagr_particle.c File Reference
#include "cs_defs.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 "bft_printf.h"
#include "bft_error.h"
#include "bft_mem.h"
#include "fvm_periodicity.h"
#include "cs_base.h"
#include "cs_halo.h"
#include "cs_interface.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_mesh_quantities.h"
#include "cs_order.h"
#include "cs_parall.h"
#include "cs_prototypes.h"
#include "cs_search.h"
#include "cs_timer_stats.h"
#include "cs_thermal_model.h"
#include "cs_field.h"
#include "cs_field_pointer.h"
#include "cs_lagr.h"
#include "cs_lagr_particle.h"
#include "cs_lagr_stat.h"
#include "cs_lagr_geom.h"
#include "cs_lagr_prototypes.h"
Include dependency graph for cs_user_lagr_particle.c:

Functions

void cs_user_lagr_ef (cs_real_t dt_p, const cs_real_t taup[], const cs_real_3_t tlag[], const cs_real_3_t piil[], const cs_real_t bx[], const cs_real_t tsfext[], const cs_real_33_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_real_3_t coords, const cs_real_t dt, cs_real_3_t disp)
 Impose the motion of a particle falgged CS_LAGR_PART_IMPOSED_MOTION. More...
 
void cs_user_lagr_in (int time_id, int *injfac, cs_lagr_zone_class_data_t *local_userdata, cs_real_t vislen[])
 User setting of particle inlet conditions for the particles (inlet and treatment for the other boundaries) More...
 
void cs_user_lagr_new_p_attr (unsigned char *particle, const cs_lagr_attribute_map_t *p_am, cs_lnum_t face_id, cs_lagr_attribute_t attr_id)
 Prescribe some attributes for newly injected particles. More...
 
void cs_user_lagr_rt (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. More...
 
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_t tauc[], const cs_real_t dt[])
 Modification of the computation 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[], cs_real_t taup[], cs_real_3_t tlag[], cs_real_t tempct[])
 User integration of the SDE for the user-defined variables. More...
 

Function Documentation

§ cs_user_lagr_ef()

void cs_user_lagr_ef ( cs_real_t  dt_p,
const cs_real_t  taup[],
const cs_real_3_t  tlag[],
const cs_real_3_t  piil[],
const cs_real_t  bx[],
const cs_real_t  tsfext[],
const cs_real_33_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 usipsu)

Parameters
[in]dt_ptime step (for the cell)
[in]taupparticle relaxation time
[in]tlagrelaxation time for the flow
[in]piilterm in the integration of the sde
[in]bxcharacteristics of the turbulence
[in]tsfextinfos for the return coupling
[in]vagausGaussian random variables
[in]gradprpressure gradient
[in]gradvfgradient of the flow velocity
[in,out]rho_pparticle density
[out]fextlauser external force field (m/s^2)$

§ cs_user_lagr_extra_operations()

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.

About the user-defined additional statistics, we recall that:

isttio = 0 : unsteady Lagrangian calculation = 1 : steady Lagrangian calculation

isuist : Restart of statistics calculation if >= 1, else no stats

idstnt : Number of the time step for the start of the statistics calculation

nstist : Number of the time step of the start of the steady computation

Parameters
[in]dttime step (per cell)

§ cs_user_lagr_imposed_motion()

void cs_user_lagr_imposed_motion ( const cs_real_3_t  coords,
const cs_real_t  dt,
cs_real_3_t  disp 
)

Impose the motion of a particle falgged CS_LAGR_PART_IMPOSED_MOTION.

User-defined modifications on the particle position and its velocity.

Parameters
[in]coordsold particle coordinates
[in]dttime step (per particle)
[out]dispparticle dispacement

§ cs_user_lagr_in()

void cs_user_lagr_in ( int  time_id,
int *  injfac,
cs_lagr_zone_class_data_t local_userdata,
cs_real_t  vislen[] 
)

User setting of particle inlet conditions for the particles (inlet and treatment for the other boundaries)

User function for the boundary conditions for the particles (inlet and treatment for the other boundaries) This routine is called after the initialization of the new particles in order to modify them according to new particle profiles.

This function is called after the initialization of the new particles in order to modify them according to new particle profiles (injection profiles, position of the injection point, statistical weights, correction of the diameter if the standard-deviation option is activated).

Parameters
[in]time_idtime step indicator for fields 0: use fields at current time step 1: use fields at previous time step
[in]injfacarray of injection face id for every particles
[in]local_userdatalocal_userdata pointer to zone/cluster specific boundary conditions (number of injected particles, velocity profile...)

§ cs_user_lagr_new_p_attr()

void cs_user_lagr_new_p_attr ( unsigned char *  particle,
const cs_lagr_attribute_map_t p_am,
cs_lnum_t  face_id,
cs_lagr_attribute_t  attr_id 
)

Prescribe some attributes for newly injected particles.

This function is called at different points, at which different attributes may be modified.

Parameters
[in,out]particleparticle structure
[in]p_amparticle attributes map
[in]face_idid of particle injection face
[in]attr_idid of variable modifiable by this call. called for CS_LAGR_VELOCITY, CS_LAGR_DIAMETER, CS_LAGR_TEMPERATURE, CS_LAGR_STAT_WEIGHT

§ cs_user_lagr_rt()

void cs_user_lagr_rt ( 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.

           m   Cp
            p    p
  Tau = ---------------
     c          2
           PI d    h
               p    e

 Tau  : Thermal relaxation time (value to be computed)
    c

 m    : Particle mass
  p

 Cp   : Particle specific heat
   p

 d    : Particle diameter
  p

 h    : Coefficient of thermal exchange
  e

he coefficient of thermal exchange is calculated from a Nusselt number, itself evaluated by a correlation (Ranz-Marshall by default)

       h  d
        e  p
Nu = --------  = 2 + 0.55 Re **(0.5) Prt**(0.33)
      Lambda                p

Lambda : Thermal conductivity of the carrier field

Re     : Particle Reynolds number
  p

Prt    : Prandtl number
Parameters
[in]id_pparticle id
[in]re_pparticle Reynolds number
[in]uvwrrelative velocity of the particle (flow-seen velocity - part. velocity)
[in]rho_ffluid density at particle position
[in]rho_pparticle density
[in]nu_fkinematic viscosity of the fluid at particle position
[in]cp_fspecific heat of the fluid at particle position
[in]k_fdiffusion coefficient of the fluid at particle position
[out]taupthermal relaxation time
[in]dttime step (per cell)

§ cs_user_lagr_rt_t()

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_t  tauc[],
const cs_real_t  dt[] 
)

Modification of the computation of the thermal relaxation time of the particles with respect to the chosen formulation of the Nusselt number.

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.

Parameters
[in]id_pparticle id
[in]re_pparticle Reynolds number
[in]uvwrrelative velocity of the particle (flow-seen velocity - part. velocity)
[in]rho_ffluid density at particle position
[in]rho_pparticle density
[in]nu_fkinematic viscosity of the fluid at particle position
[in]cp_fspecific heat of the fluid at particle position
[in]k_fdiffusion coefficient of the fluid at particle position
[out]taucthermal relaxation time
[in]dttime step (per cell)

§ cs_user_lagr_sde()

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.

User function (non-mandatory intervention) Integration of the sde for the user-defined variables. The variables are constant by default. The sde must be of the form:

\[ \frac{dT}{dt}=\frac{T - PIP}{Tca} \]

T : IIIIeme user-defined variable, given for the ip particle by T = EPTP(JVLS(IIII),IP) T = EPTPA(JVLS(IIII),IP) Tca : Characteristic time for the sde to be prescribed in the array auxl1 PIP : Coefficient of the sde (pseudo right member) to be prescribed in the array auxl2 If the chosen scheme is first order (nordre=1) then, at the first and only passage pip is expressed as a function of the quantities of the previous time step contained in eptpa If the chosen scheme is second order (nordre=2) then, at the first passage (nor=1) pip is expressed as a function of the quantities of the previous time step contained in eptpa, and at the second passage (nor=2) pip is expressed as a function of the quantities of the current time step.

The variables are constant by default. The SDE must be of the form:

\[ \frac{dT}{dt}=\frac{T - PIP}{Tca} \]

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.

Parameters
[in]dttime step (per cell)
[in]taupparticle relaxation time
[in]tlagrelaxation time for the flow
[in]tempctcharacteristic thermal time and implicit source term of return coupling