dfnTrans
Code for Particle Tracking simulations in 3D DFN
main.c File Reference
#include <stdio.h>
#include <search.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "FuncDef.h"
#include <unistd.h>
#include <time.h>
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  inpfile
 

Functions

int main (int argc, char *controlf[])
 

Variables

unsigned int pflotran
 
unsigned int fehm
 
unsigned int nnodes
 
unsigned int ncells
 
unsigned int nfract
 
unsigned int max_neighb
 
unsigned int npart
 
unsigned int np
 
unsigned int nzone_in
 
unsigned int * nodezonein
 
unsigned int * nodezoneout
 
unsigned int flag_w
 
struct materialfracture
 
struct vertexnode
 
struct contamparticle
 
struct elementcell
 
char maindir [125]
 
char controlfile [120]
 
double porosity
 
double density
 
unsigned long int timesteps
 
double thickness
 
double saturation
 
double timeunit
 
double totalFluxIn
 

Function Documentation

◆ main()

int main ( int  argc,
char *  controlf[] 
)

The MAIN of dfnTrans code. Input argument is a control file with input parameters to dfnTrans. The main parts of particle tracking simulations are called:

  1. Read DFN mesh and Flow Solver's ouputs
  2. Reconstruct Darcy's velocities on each node of DFN mesh
  3. Perform Particle Tracking procedure

Definition at line 66 of file main.c.

References cell, CheckGrid(), Control_Data(), Control_File(), Control_Param(), controlfile, Convertto2d(), Convertto3d(), DarcyVelocity(), DefineTimeStep(), density, inpfile::filename, inpfile::flag, fracture, maindir, node, nodezonein, nodezoneout, inpfile::param, particle, ParticleTrack(), porosity, ReadBoundaryNodes(), ReadDataFiles(), ReadInit(), saturation, String_Compare(), thickness, timesteps, timeunit, Velocity3D(), and WritingInit().

Here is the call graph for this function:

Variable Documentation

◆ cell

◆ controlfile

char controlfile[120]

Name of Control file with all inut parameters to dfnTrans, given by user at the command line

Definition at line 44 of file main.c.

Referenced by main().

◆ density

double density

Flow density, defined by user

Definition at line 47 of file main.c.

Referenced by InitParticles_flux(), main(), ReadBoundaryNodes(), ReadPFLOTRANfile(), VelocityExteriorNode(), and VelocityInteriorNode().

◆ fehm

unsigned int fehm

fehm=1 when FEHM flow solver is used

Definition at line 28 of file main.c.

Referenced by DarcyVelocity(), HalfPolygonVelocity(), and ReadDataFiles().

◆ flag_w

unsigned int flag_w

Definition at line 38 of file main.c.

Referenced by InitPos(), and ParticleTrack().

◆ fracture

◆ maindir

char maindir[125]

The directory/path for particle tracking outputs, defined by user

Definition at line 43 of file main.c.

Referenced by CalculateVelocity3D(), DefineBoundaryAngle(), main(), OutputMarPlumDisp(), ParticleOutput(), ParticleTrack(), ReadBoundaryNodes(), and WritingInit().

◆ max_neighb

unsigned int max_neighb

maximum number of nodes neighbours/connections

Definition at line 32 of file main.c.

Referenced by DarcyVelocity(), HalfPolygonVelocity(), ReadDataFiles(), ReadFEHMfile(), and ReadInit().

◆ ncells

unsigned int ncells

total number of triangular elements in the DFN mesh

Definition at line 30 of file main.c.

Referenced by BoundaryCells(), InitPos(), ReadDataFiles(), and ReadInit().

◆ nfract

unsigned int nfract

total number of fractures in the DFN mesh

Definition at line 31 of file main.c.

Referenced by Convertto2d(), Convertto3d(), Coordinations2D(), DefineBoundaryAngle(), ParticleTrack(), ReadAperture(), ReadDataFiles(), ReadInit(), and WritingInit().

◆ nnodes

◆ node

◆ nodezonein

unsigned int* nodezonein

pointer to the dynamic array with a list of in-flow boundary nodes

Definition at line 36 of file main.c.

Referenced by InitCell(), InitInWell(), InitParticles_flux(), InitParticles_np(), InitPos(), main(), ParticleTrack(), and ReadBoundaryNodes().

◆ nodezoneout

unsigned int* nodezoneout

pointer to the dynamic array with a list of out-flow boundary nodes

Definition at line 37 of file main.c.

Referenced by main(), ParticleTrack(), and ReadBoundaryNodes().

◆ np

unsigned int np

index of current particle, idex in particle's loop

Definition at line 34 of file main.c.

◆ npart

unsigned int npart

initial number of particles set up in the simulation

Definition at line 33 of file main.c.

Referenced by InitInMatrix(), InitParticles_eq(), InitParticles_flux(), InitParticles_np(), InitParticles_ones(), and InitPos().

◆ nzone_in

unsigned int nzone_in

number of nodes in in-flow boundary face/zone

Definition at line 35 of file main.c.

Referenced by InitCell(), InitInWell(), InitPos(), and ReadBoundaryNodes().

◆ particle

◆ pflotran

unsigned int pflotran

pflotran=1 when PFLOTRAN flow solver is used

Definition at line 27 of file main.c.

Referenced by DarcyVelocity(), HalfPolygonVelocity(), and ReadDataFiles().

◆ porosity

double porosity

Fracture porosity, used in velocity reconstructions, defined by user

Definition at line 46 of file main.c.

Referenced by main(), VelocityExteriorNode(), and VelocityInteriorNode().

◆ saturation

double saturation

Flow saturation, defined by user

Definition at line 50 of file main.c.

Referenced by main().

◆ thickness

double thickness

One value for all fractures aperture (defined by user), used in case when fracture aperture is not provided by user

Definition at line 49 of file main.c.

Referenced by main(), and ReadDataFiles().

◆ timesteps

unsigned long int timesteps

Max number of time steps used for each particles movements, defined by user

Definition at line 48 of file main.c.

Referenced by main(), and ParticleTrack().

◆ timeunit

double timeunit

Time unit multiplier, converts calculated time/velocities according to required time units

Definition at line 51 of file main.c.

Referenced by main(), OutputMarPlumDisp(), ParticleTrack(), TimeFromMatrix(), VelocityExteriorNode(), and VelocityInteriorNode().

◆ totalFluxIn

double totalFluxIn

Total Flow flux on in-flow boundary, calculated in the code

Definition at line 52 of file main.c.

Referenced by InitPos(), and ReadBoundaryNodes().