dfnTrans
Code for Particle Tracking simulations in 3D DFN
ReadGridInit.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 dependency graph for ReadGridInit.c:

Go to the source code of this file.

Data Structures

struct  inpfile
 

Functions

void ReadInit ()
 
void ReadDataFiles ()
 
void AdjacentCells (int ln, int in, int jn, int kn)
 
void ReadBoundaryNodes ()
 
FILE * OpenFile (char filen[120], char fileopt[2])
 
void ReadPFLOTRANfile (int nedges)
 
void ReadFEHMfile (int nedges)
 
void WritingInit ()
 
void CheckGrid ()
 
struct inpfile Control_File (char fileobject[], int ctr)
 
struct inpfile Control_File_Optional (char fileobject[], int ctr)
 
int String_Compare (char string1[], char string2[])
 
struct inpfile Control_Data (char fileobject[], int ctr)
 
struct inpfile Control_Param (char fileobject[], int ctr)
 
void ReadAperture ()
 

Function Documentation

◆ AdjacentCells()

void AdjacentCells ( int  ln,
int  in,
int  jn,
int  kn 
)

The function defines adjacent triangular cells for each node

Definition at line 485 of file ReadGridInit.c.

References cell, vertex::cells, vertex::fracts, vertex::fracture, element::fracture, fracture, node, and vertex::numneighb.

Referenced by ReadDataFiles().

Here is the caller graph for this function:

◆ CheckGrid()

void CheckGrid ( )

The function checks the grid: looking for nodes that are defined as internal or external, but belong to two fractures and should be defined as interface nodes

Definition at line 965 of file ReadGridInit.c.

References fracture, nnodes, node, and vertex::numneighb.

Referenced by main().

Here is the caller graph for this function:

◆ Control_Data()

struct inpfile Control_Data ( char  fileobject[],
int  ctr 
)

The function reads control file with input parameters to dfnTrans; returns input parameter value. If the parameter is not defined in the control file, the program is terminated.

Definition at line 1089 of file ReadGridInit.c.

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

Here is the caller graph for this function:

◆ Control_File()

struct inpfile Control_File ( char  fileobject[],
int  ctr 
)

The function reads control file with input parameters to dfnTrans; returns the file name and/or input parameter value. If the parameter is not defined in the control file, the program is terminated.

Definition at line 965 of file ReadGridInit.c.

Referenced by InitInMatrix(), InitPos(), main(), OutputMarPlumDisp(), ParticleTrack(), ReadAperture(), ReadBoundaryNodes(), ReadDataFiles(), ReadFEHMfile(), ReadInit(), and ReadPFLOTRANfile().

Here is the caller graph for this function:

◆ Control_File_Optional()

struct inpfile Control_File_Optional ( char  fileobject[],
int  ctr 
)

The function reads control file with input parameters to dfnTrans; returns the file name and/or input parameter value. This function is called for the optional parameters only. If the parameter is not defined in the control file, the default value is used.

Definition at line 965 of file ReadGridInit.c.

Referenced by InitPos(), ParticleTrack(), and ReadInit().

Here is the caller graph for this function:

◆ Control_Param()

struct inpfile Control_Param ( char  fileobject[],
int  ctr 
)

The function reads control file with input parameters to dfnTrans; returns input parameter value. If the parameter is not defined in the control file, the program is terminated.

Definition at line 1089 of file ReadGridInit.c.

Referenced by InitPos(), main(), ParticleTrack(), and TimeFromMatrix().

Here is the caller graph for this function:

◆ OpenFile()

FILE* OpenFile ( char  filen[120],
char  fileopt[2] 
)

The function opens file for reading or writing. If error - the program is terminated.

Definition at line 664 of file ReadGridInit.c.

Referenced by CalculateVelocity3D(), Coordinations2D(), InitInMatrix(), OutputMarPlumDisp(), ParticleOutput(), ParticleTrack(), ReadAperture(), ReadBoundaryNodes(), ReadDataFiles(), ReadFEHMfile(), ReadInit(), ReadPFLOTRANfile(), and WritingInit().

Here is the caller graph for this function:

◆ ReadAperture()

void ReadAperture ( )

The function reads apertures of fractures in DFN. Aperture can be defined for each fracture or for every node/cell, representing internal heterogeneity.

Definition at line 1203 of file ReadGridInit.c.

References vertex::aperture, Control_File(), inpfile::filename, vertex::fracture, fracture, nfract, nnodes, node, and OpenFile().

Referenced by ReadDataFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBoundaryNodes()

void ReadBoundaryNodes ( )

The functions reads node's IDs assigned to in-flow and out-flow boundaries. the total input flow flux is calculated.

Definition at line 526 of file ReadGridInit.c.

References Control_Data(), Control_File(), density, inpfile::filename, inpfile::flag, vertex::flux, maindir, node, nodezonein, nodezoneout, vertex::numneighb, nzone_in, OpenFile(), totalFluxIn, and vertex::typeN.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadDataFiles()

void ReadDataFiles ( )

The function reads DFN mesh from inp and stor files

if no aperture file specified, the aperture of all fractures will be equal to thickness value

Definition at line 155 of file ReadGridInit.c.

References AdjacentCells(), vertex::aperture, vertex::area, cell, vertex::cells, Control_File(), fehm, inpfile::filename, material::firstcell, material::firstnode, vertex::flux, vertex::fracts, vertex::fracture, element::fracture, fracture, vertex::indnodes, material::lastnode, max_neighb, ncells, nfract, nnodes, node, material::numbcells, vertex::numneighb, OpenFile(), pflotran, ReadAperture(), ReadFEHMfile(), ReadPFLOTRANfile(), thickness, vertex::type, vertex::typeN, and element::veloc_ind.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadFEHMfile()

void ReadFEHMfile ( int  nedges)

The function opens and reads FEHM outputs; read in flow fluxes and cell volumes.

Definition at line 796 of file ReadGridInit.c.

References Control_File(), inpfile::filename, max_neighb, nnodes, node, OpenFile(), and vertex::pressure.

Referenced by ReadDataFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadInit()

void ReadInit ( )

The function reads total number of nodes, triangular cells, fractures in DFN mesh. The memory is allocated for data structures: NODE, CELL, FRACTURE

Definition at line 16 of file ReadGridInit.c.

References vertex::area, cell, vertex::cells, Control_File(), Control_File_Optional(), inpfile::filename, inpfile::flag, vertex::flux, vertex::fracts, fracture, vertex::indnodes, max_neighb, ncells, nfract, nnodes, node, material::nvect_xy, material::nvect_z, OpenFile(), material::theta, and vertex::type.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadPFLOTRANfile()

void ReadPFLOTRANfile ( int  nedges)

The function opens and reads PFLOTRAN files, read in flow fluxes, areas, pressure.

Definition at line 677 of file ReadGridInit.c.

References vertex::aperture, vertex::area, Control_File(), density, inpfile::filename, inpfile::flag, vertex::flux, nnodes, node, vertex::numneighb, OpenFile(), vertex::pressure, and vertex::pvolume.

Referenced by ReadDataFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ String_Compare()

int String_Compare ( char  string1[],
char  string2[] 
)

The finction performs a string comparison, used in the control file reading.

Definition at line 1089 of file ReadGridInit.c.

Referenced by main(), and ParticleTrack().

Here is the caller graph for this function:

◆ WritingInit()

void WritingInit ( )

Functions write the data structure of nodes, cells and fractures into files in ASCII format with detail explanations. This output is optional and can be helpful in code debugging.

Definition at line 898 of file ReadGridInit.c.

References cell, inpfile::filename, fracture, maindir, nfract, nnodes, node, material::numbcells, vertex::numneighb, and OpenFile().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: