Guide of LPT3D code Ver.14 (2001): Lagrangian ... - Rachid Ababou

Apr 20, 2006 - ce guide: R.Ababou, T.Becker, A.Fadili (Institut de Mécanique des ... A l'origine, le code de calcul LPT3D émane d'un code d'essai pour le.
181KB taille 0 téléchargements 270 vues
Guide of LPT3D code Ver.14 (2001): Lagrangian Particle Tracking 3D (short guide without test problems) Rachid ABABOU et al. April 20, 2006

Abstract

PREAMBULE Ce document constitue un guide utilisateur pour le code Fortran 77 ”LPT3D” (Lagrangian Particle Tracking 3D), version 14 (Juillet 2001). Co-auteurs de ce guide: R.Ababou, T.Becker, A.Fadili (Institut de M´ecanique des Fluides, 2001). Concernant les r´esultats obtenus `a l’aide du code LPT3D, par exemple dans le cas de l’advection-diffusion et la dispersion hydrodynamique de particules dans un champ de vitesse conservatif al´eatoire, ou encore, pour la diffusion pure dans un milieu h´et´erog`ene matrice-joints, voir: Fadili, Ababou et al. (1999); Ababou et Fadili (1999); Spiller et al. (2002) . . . . Le code LPT3D impl´emente une approche lagrangienne particulaire en une, deux ou trois dimensions, tant pour l’advection dX/dt = V(X(t),t) que pour la diffusion (marche al´eatoire g´en´eralis´ee), bas´ee sur le travail de Ababou et Fadili concernant la mod´elisation du transport de solut´e en milieux poreux h´et´erog`enes. Pour plus de d´etails concernant l’´equivalence entre le transport particulaire (microscopique) et l’´equation macroscopique d’advectiondiffusion (Fokker-Planck), voir les r´ef´erences ci-dessus, ainsi que le rapport de stage de DEA de M´ecanique des Fluides de A.Fadili (1994). A l’origine, le code de calcul LPT3D ´emane d’un code d’essai pour le transport advectif de traceurs, initialement utilis´e pour tester la parall´elisation de l’approche lagrangienne particulaire 3D sur un calculateur massivement parall`ele (Connection Machine CM2 avec 64K processeurs). Une des conclusions de ce travail ´etait que la parall´elisation ne pouvait ˆetre efficace que si le champ de vitesse eul´erien 3D V(x) pouvait ˆetre maintenu tout entier dans la m´emoire locale de chaque processeur (Ababou et al., SwRI 1992).

0.1

Mod` ele Math´ ematique et Num´ erique

On met en oeuvre une approche lagrangienne particulaire en 1D, 2D ou 3D, tant pour le transport advectif dX/dt = V(X(t),t) que pour la diffusion (processus de Wiener – marche al´eatoire g´en´eralis´ee). L’approche est bas´ee sur le travail de Ababou et Fadili concernant la mod´elisation du transport de solut´e en milieux poreux h´et´erog`enes. Pour plus de d´etails concernant l’´equivalence entre transport particulaire (microscopique) et l’´equation macroscopique d’advection-diffusion (Fokker-Planck), voir r´ef´erences cit´ees plus haut. La version du code LPT3D pr´esent´ee dans ce guide (version 14, 2001) a ´et´e d´evelopp´ee et test´ee par T. Becker et A. Fadili, sous la direction de R. Ababou, `a l’Institut de M´ecanique des Fluides de Toulouse. La structure du code LPT3D est sch´ematis´ee dans la figure Fig. 1. Le tableau ci-apr`es r´esume les de taches de programmation (”implementation”) et leur test numerique (”validation”), en pr´ecisant ce qui a ´et´e accompli et ce qui restait `a d´evelopper en Juillet 2001, notamment en liaison avec l’objectif de g´en´eraliser la partie diffusive (marche al´eatoire) au cas de milieux poreux diffusifs fortement h´et´erog`enes de type matrice-joints (coefficient D ou Dij quasi-discontinu en espace). Tˆache Dispersion Hydrodyn.(DH) Diffusion Heterog. (Dx) DH + Dx simultan´ement Conditions de Dirichlet sur C Calcul de C par fenetrage Calcul du flux (”sondes num.”) Interpolation de Pollock Lissage de Dx

Etat impl´ement´ee, non valid´ee impl´ement´ee, part. valid´ee `a faire impl´ement´ees, valid´ees impl´ement´e, valid´e impl´ement´e, (`a g´en´eraliser) appliqu´ee `a A = V + ∇.D impl´ement´e, voir plus loin

Lissage de Dx : Z 1 Dsmooth (x) = D(x + y)dy |W | W

(1)

o` u |W | est le volume (surface) de la fenˆetre de lissage. Ceci permet de ”r´egulariser” le coeff de diffusion aux discontinuit´es. Perspectives: cette proc´edure de lissage peut ˆetre remplac´ee par la r´esolution d’un probl`eme d’homog´en´eisation tenant compte de l’anisotropie g´eom´etrique du milieu. (. . . ) 1

0.1.1

Exemple de fichier input comment´ e

Le fichier d’input s’appelle parameter9.dat. Il s’agit d’un fichier ascii dont voici un exemple (LPT3D Version 14, 2001) : BLANCK LINE BLANCK LINE BLANCK LINE 2 NDIM 2.5, 0.005, 1.E-6 TS DT DTMIN 2.5, 0 TENG LENG_0 2.5, 0 CENG LCENG_0 0.0001,0.00 CONC_M,CONC_0 0.0001 XMASS_P 100000002 NINJ 400., 200. , 1. SGRID(I) 1., 1. , 1. DX(I) 0, 0, 1, 0, 0 LAD LDIF LHDIF LAN LULA 1, 1 LIS LID 1 IEULER 2 INHDIFF for reading M’s file 1 INITHD 1 IDIR 1.0, 25, 25 OMEGA IOMCENT1 IOMCENT2 1, 1 IRANDCHOI IGEN 1, 1027, 104857 IUU MLRAND MDRAND 1, 1 ISEED1 ISEED2 20 INIT 1.3, 5., 1 XYZ0 0. , 0. , 0. SDOM_INI(I) 1 , 20 , 1 ICELL(I) 1 , 50 , 1 ISDOM_IN(I) 2 IRANINIT 10., 1., 0. DIFF(I) 1., 0.1 DLON DTRAN 0.1, 3 EPSILON NEXPAND 0., 0., 0. DEBUT_CC(I) 0.2, 10., 0. SDOM_CC(I) 1., 0., 0. DEBUT_CF(I) 1, 0.1, 0. , 0. NCON_CF (ECAWIN(I) 0.2, 10., 0. SDOM_CF(I)

2

10, 1, 1., 1. NSONDES IDIRFLOW PRSONDE ECASONDE 3, 1, 3, 5 LSONDES (IPOSONDE(I) 1. HEAD_T0 ****************POROSITY****************************** 1. POR_0 ********INTERPOLATION OF D(X)************************* 2 N_SMOOTH (number of applications of smoothening on field) 3,3,0 INT_W(I) (width of interpolation window) **********BOUNDARY CONDITIONS************************* 2 N_BC (number of BCs) 0.,0.,0. BC_EDGE(I) (edge point of BC) 400.,0.1,0. BC_SIDE(I) (length of sides) 0.05 CONC_BC (boundary concentration) 0.,199.9,0 400.,0.1,0. 0.00 Choice of INHD: 1 : planar f(x) 2 : paraboloid f(x) 3 : divided field f(x) 4 : exponential function f(x) 5 : square function f(x)

La signification des diff´erents param`etres est donn´ee dans le tableau Tab. 1 et sa suite, le tableau Tab. 2. Rappel: il s’agit de la version 14 du code LPT3D (2001). Remarques : • SGRID(I) est la longueur du domaine dans la direction I et DX(I) est la longueur de la maille. Ces param´etres sont utilis´es, a priori, pour d´eterminer la taille de la grille num´erique (NGRID1,2,3). MAIS la taille de la grille num´erique peut ´egalement ˆetre lue directement `a partir d’un fichier d’input de vitesse, diffusion h´eterog`ene. Dans ce cas l’utilisateur doit donner des valeurs `a SGRID et DX coh´erentes avec le fichier de donn´ees. Dans le cas de champ de vitesses analytique (LAN=1, IEULER fix´e), on peut prendre DX = SGRID (recommand´e pour minimiser la taille des tableaux). • Le parametre NINJ est li´e `a la variable interne NINJECTE. On force NINJECTE= 0 pour n’avoir aucune injection source dans le cas ou 3

Param`etre input NDIM TS DT DTMIN TENG LENG 0 CENG LCENG 0 CONC M

CONC 0 XMASS0 P NINJ SGRID(i),DX(i)

LAD,LDIF,. . . . . . LHDIF,LAN

LULA LIS LID IEULER

INHDIFF

INHD

IDIR OMEGA,IOMCENTj

Table 1: Table 1 Guide explicatif des parametres d’input Commentaires Number of space dimensions (1, 2 ou 3) Simulation time, time step, and DTMIN=0 (not used) in time units (s); Time period (s) for output of particle positions in file ”pospart.out”; Logical switch for saving initial particle positions in output file: 0 : not saved ; 1 : saved Time period (s) for output of concentration fields C(t,x,y,z) in file ”concentra.out” ; Logical switch for saving initial concentration output : 0 : not saved ; 1 : saved ; Maximum estimated concentration (kg/m3) within the domain, including injection sources and boundary conditions (used by the code to set up max number of particles and array sizes); Initial concentration (kg/m3 of water) Mass of each individual particle (kg) Periodicity of source injections : injection at every NINJ t-step (DT) (Cf. remarque in the text) Domain size and mesh size in unit lengths (meters); if LAN=1 it is possible to set DX=SGRID (recommanded); SGRID and DX are used in the code to get the grid size NGRID1,2,3; depending on other parameters (INHDIFF,LAD,IEULER) other grid dimensions may be read directly from multidim input files; Logical 0/1 switches for advection and/or diffusion : LAD=0/1: implement ADvection (with/out other features); LDIF=0/1: implement molecular-type DIFfusion (with/out other features) LHDIF=0/1: implement heterogeneous DIFfusion (w/out other features); LAN=0/1: use a given ANalytical V-field (see IEULER for sub-options); Logical 0/1 switch for statistics of LAgrangian V-field Up(t) Logical switches : other features (not used in this version . . . ) Logical swith to specify type of EULERian velocity field : 1 : cstant vector V=(1,0,0); 12 : cstant vector V (diagonal); 2 : uniformly distributed random vector V (horizontal); 3 : log-normally distributed random V (horizontal); 31: normally distributed random V (horizontal); 4 : 2D numerical cell-velocity components VCELL1,2 (from 2 BigFlow files); 5 : 2D solid rotation velocity field (simple analytical test); Logical switch: type of INput Heterogeneous DIFFusion Dii(x,y,z): 1 : read Dii(x,y,z) field from an ascii file; 2 : read a special binary field D(x,y) ascii file (from binary raster); 3 : use a predefined analytical Dii(x,y) : see INITHD ; Logical switch to specify analytical D(x,y) function in 2D: 1: bilinear; 2: paraboloid; 3: composite (single fracture in matrix) 4: exponential function ; 5: quadratic function; . . . Logical switch 1,2,3 = direction of analytical V-field (see IEULER); 4 Special parameters for analytical velocity (if 2D rotation): OMEGA : Angular velocity; IOMCENT1,IOMCENT2 : Coordinates of center of rotation;

Table 2: Table 2 Guide explicatif des parametres d’input (suite et fin) Commentaires Logical switch for type of random variable: 3=uniform ; 1 or 2=gaussian; Logical switch for random GENerator : 0=RANDALI (simple), 1=ECUYERCG (combined); IUU MLRAND MDRAND Seed, Multiplier, Modulus (for ”simple” R.N.Generator RANDALI); ISEED1 ISEED2 Two seeds for the ”combined” Random Number GENerator ECUYERCG; INIT Logical switch for the type and location of the initial/source window; INIT=2 : case of a 1,2,3-dimensional rectangular source ; INIT=20 : case of a 0-dimensional point source XYZ0(i) 3D position of lower-left-corner of (0,1,2,3D) rectangular window source SDOM INI(i) 3D size of 1,2,3D initial/source window (independent of velocity grid) ICELL(i) Integer grid-based position of window, similar to XYZ0 ISDOM IN(i) Integer grid-based size of domain (in terms of velocity grid); IRANINIT Logical switch setting particles distribution in initial/source window; IRANINIT=1,2 : gaussian ; IRANINIT=3 : random uniform ; IRANINIT=4 : deterministic uniform ; DIFF(i) Diffusion coefficients (Dii)o; this value may be used in analytical cases; DLON DTRAN Longitudinal and transverse dispersivities (for hydrodynamic dispersion); EPSILON NEXPAND Special parameters for analytical velocity: case of thermal convection in a square cavity, obtained by asymptotic expansion (not used here). DEBUT CC(i) Lower-left corner position of the window used for post-treatment of concentration field C(x,y,z) by windowing (’concentra.out’); SDOM CC(i) Size of the window used to evaluate output concentration field; DEBUT CF(i) Idem: lower-left corner location of fixed window used to evaluate the temporal variation of concentration C(t) (’concent f.out’); NCON CF Number of fixed windows used for calculation of C(t); ECAWIN(i) Distance between fixed windows used for calculation of C(t) SDOM CF(i) Size of fixed windows used for calculation of C(t) NSONDES IDIRFLOW NSONDES: number of flux probes perpendicular to direction IDIRFLOW=1,2,3 PRSONDE ECASONDE Position of the first probe; and separation distance between probes (this sets all the probes used for fluxes and arrival time moments) LSONDES LSONDES is the number of probes used for output flux calculations; IPOSONDE(i) IPOSONDE(i)= cell number of the chosen probes for output fluxes (LSONDES are a subset of NPROBES ⇒ LSONDES ≤ NSONDES); HEAD T0 Seldom used parameter (same as total head variation delta H); useful only to adjust the magnitude of a log-normal V-field; POR 0 Porosity of the porous medium (not used yet); N SMOOTH Number of local smoothing iterations on the diffusion field D(x,y,z); INT W(i) Width of local smoothing window (full width, in number of pixels) N BC Number of Dirichlet-type boundary condition (BC) windows; BC EDGE(i) Position of left lower corner of the ith BC window; BC SIDE(i) Size of the ith BC window; 5 CONC BC Value of the ith boundary condition (concentration) ;

Param`etre input IRANDCHOI IGEN

les conditions initiales et frontieres (Dirichlet) sont toutes nulles. Si NINJECTE > 0, le mode d’injection de la source est r´egl´e assez particuli`erement comme suit : on injecte NINJECTE fois le nombre de particules (initiales+fronti`eres), et ceci tous les NINJ pas de temps (donc si NINJ= 1 l’injection source est continue).

0.1.2

Exemple de fichier d’outputs de LPT3D

Exemple de fichiers outputs de LPT3D (2001,v.14 et 20016,v.15): -Le sous-repertoire ’ESSAI’ doit d’abord cr´e´e dans le r´epertoire courant. -Le nom complet du fichier ne doit pas depasser 30 caracteres. -Tous les fichiers outputs sont de format ASCII texte. -La plupart des donn´ees outputs sont organis´ees en multi-colonnes. c -------------------------------------------------------------------- c c Fichiers OUTPUTS pour le programme "lpt3d.f" UPGRADE MODIF: 27/11/97 c -------------------------------------------------------------------- c ESSAI/m1Xp_b.out ESSAI/vaXp_b.out ESSAI/m1Xp_t0.out ESSAI/m1Xpnt0.out ESSAI/stdXp_t0.out ESSAI/pospart.out ESSAI/mas_in.out ESSAI/vaXp_t0.out ESSAI/vaXpn_t0.out ESSAI/finsimul.out ESSAI/m1Up_b.out ESSAI/vaUp_b.out ESSAI/vitlag.out ESSAI/m3Xp_b.out ESSAI/concentra.out ESSAI/concent_f.out ESSAI/mtarrive.out ESSAI/flux_t.out ESSAI/flux_x.out ccc NOMS des FICHIERS de VITESSE 2D format BIGFLOW AA-QELT/Q1ELK1_001 AA-QELT/Q2ELK1_001

6

Nom du fichier output ESSAI/m1Xp b.out ESSAI/vaXp b.out ESSAI/m1Xp t0.out ESSAI/m1Xpnt0.out ESSAI/stdXp t0.out ESSAI/pospart.out ESSAI/mas in.out ESSAI/vaXp t0.out ESSAI/vaXpn t0.out ESSAI/finsimul.out ESSAI/m1Up b.out ESSAI/vaUp b.out ESSAI/vitlag.out ESSAI/m3Xp b.out ESSAI/concentra.out ESSAI/concent f.out ESSAI/mtarrive.out ESSAI/flux t.out ESSAI/flux x.out ccc AA-QELT/Q1ELK1 001 AA-QELT/Q2ELK1 001

Commentaires Moment 1 (position of center of mass) at every t-step Moment 2 (var-covar matrix of particle positions) every t-step Moment 1 of (X-Xo) Moment 1 of (X-Xo) normalized Std deviation and cross-correl (correlation matrix) Particle positions (at selected times): t,X,Y,Z columns Moment 0 (resident total mass in the domain) every t-step Moment 2 of (X - Xo) Moment 2 of (X-Xo) normalized Summary of basic input parameters Moment 1 of lagrangian particle velocities Up every t-step Moment 2 (var-covar matrix) of lagrangian Up every t-step Obsolete : visualisation de vitesses lagrangiennes Moment 3 (raw, centered): diagonal of 3rd-rank tensor M3 Concentration fields from spatial windowing: t,X,Y,Z,C(x,y,z) Concentration versus time in fixed window(s): C(t) every t-step Arrival time/flux moments of order 0,1,2 at selected probes Flux vs. time at selected probes Pi: t, Flux(P1), Flux(P2). . . Flux vs. space at every time step: t, X, Flux Blanck line Cell-velocity in BigFlow format (1rst component of 2D vector) Cell-velocity in BigFlow format( 2nd component of 2D vector)

7

A titre d’exemple, on montre ci-dessous le fichier d’input de LPT3D (2001, v.14) dans le cas de la diffusion pure en milieu h´et´erog`ene matrice-joints 2D. Le coefficient de diffusion est un champ D(x,y) binaire, lu dans un fichier, puis liss´e deux fois. Le fichier d’input permettant d’obtenir le nuage de particules au bout de 100 pas de temps est le suivant : BLANCK LINE BLANCK LINE BLANCK LINE 2 NDIM 1E+18, 1E+16, 0. TS DT DTMIN 1E+18, 0 TENG LENG_0 1E+18, 0 CENG LCENG_0 5.0, 0.00 CONC_M,CONC_0 1.0 XMASS0_P 10000000 NINJ 400., 200. , 1. SGRID(I) 1., 1. , 1. DX(I) 0, 0, 1, 0, 0 LAD LDIF LHDIF LAN LULA 1, 1 LIS LID 1 IEULER 2 INHDIFF for reading M’s file 1 INHD 1 IDIR 1.0, 25, 25 OMEGA IOMCENT1 IOMCENT2 1, 1 IRANDCHOI IGEN 1, 1027, 104857 IUU MLRAND MDRAND 1, 1 ISEED1 ISEED2 20 INIT 1.3, 5., 1 XYZ0 0. , 0. , 0. SDOM_INI(I) 1 , 20 , 1 ICELL(I) 1 , 50 , 1 ISDOM_IN(I) 2 IRANINIT 1.366E-19, 3.974E-16, 1. DIFF(I), DIFF(1) : grains, DIFF(2): joints 1., 0.1 DLON DTRAN 0.1, 3 EPSILON NEXPAND 0., 0., 0. DEBUT_CC(I),windowing method for whole domain 0.2, 10., 0. SDOM_CC(I) 1., 0., 0. DEBUT_CF(I), for fixed window 1, 0.1, 0. , 0. NCON_CF (ECAWIN(I)

8

0.2, 10., 0. SDOM_CF(I) 10, 1, 1., 1. NSONDES IDIRFLOW PRSONDE ECASONDE for fluxes 3, 1, 3, 5 LSONDES (IPOSONDE(I) 1. HEAD_T0 ****************POROSITY****************************** 1. POR_0 ********INTERPOLATION OF D(X)************************* 2 N_SMOOTH (number of applications of smoothening on field) 3,3,0 INT_W(I) (width of interpolation window) **********BOUNDARY CONDITIONS************************* 2 N_BC (number of BCs) 0.,0.,0. BC_EDGE(I) (edge point of BC) 400.,0.1,0. BC_SIDE(I) (length of sides) 100. CONC_BC (boundary concentration) 0.,199.9,0 400.,0.1,0. 10.

9

"LPT3D" : FLOW-CHART (ORGANIGRAMME) INITIALISATION (INITIAL CONDITIONS, BOUNDARY CONDITIONS)

PRE-PROCESSING (INPUT VERIFICATION)

ti

PARTICLE DISPLACEMENT X(t) Î X(t+∆t)

INTERIOR DOMAIN

ANALYSIS OF PARTICLE POSITIONS

Flux and Concentration Evaluation

(DEACTIVATION OF PARTICLES) EACH BOUNDARY

STATISTICS ON ACTIVE PARTICLES

(TEMPORAL MOMENTS)

UPDATE BOUNDARY CONDITIONS REACTIVATION OR CREATION OF NEW PARTICLES

POST-PROCESSING (SPATIAL MOMENTS, CONCENTRATIONS)

ti+1