diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a930f9d..62c21b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -13,9 +13,9 @@ jobs: python-version: ['3.8','3.10'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -28,3 +28,4 @@ jobs: uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + continue-on-error: true diff --git a/.gitignore b/.gitignore index f318513..02e064f 100644 --- a/.gitignore +++ b/.gitignore @@ -164,3 +164,6 @@ cython_debug/ *logs/ *scratch/ ltximg/ + +public/ +.packages/ diff --git a/README.org b/README.org index 4fec73a..00da50f 100644 --- a/README.org +++ b/README.org @@ -1,8 +1,15 @@ * flowVCUtils -utilities for the flowVC project [[https://github.com/bkm82/flowVC-utils/actions][https://github.com/bkm82/flowVC-utils/actions/workflows/tests.yml/badge.svg]] [[https://codecov.io/gh/bkm82/flowVC-utils][https://codecov.io/gh/bkm82/flowVC-utils/graph/badge.svg?token=WFC6ZW61XD]] + +utilities for the flowVC project + +#+begin_quote +[!TIP] +Check out the [[https://bkm82.github.io/flowVC-utils/][Docs] +#+end_quote + ** Installation Clone and install the repository #+begin_src shell diff --git a/docs/content/FTLE_example.org b/docs/content/FTLE_example.org index 8e8d830..3d797c2 100644 --- a/docs/content/FTLE_example.org +++ b/docs/content/FTLE_example.org @@ -2,351 +2,351 @@ #+INCLUDE: "./header.org" * Input File -#+begin_src shell :tangle ../../examples/inputfile.in - -################################# flowVC INPUT FILE ##################################### -# -# NOTE: Order of parameters listed must be maintained for proper parsing of input file -# Comment lines begin with #, comments can be added or removed as desired -# Comments cannot occur on lines containing variable declartations -# Standard format: VARIABLE_NAME = VALUE -# -####################################################################################### - -# Path_Data: String, Directory containing data files, e.g. velocity data, etc. -# Can be set to pwd (i.e. present working directory) -Path_Data = ../bin/ - -# Path_Output: String, Directory where output files will be written -# Can be set to pwd (i.e. present working directory) -Path_Output = ../output/ - -# Dimensions: Integer, Specifies if velocity data is 2D or 3D -Dimensions = 2 - -# Data_MeshType: Integer, Specifies mesh type of velocity data -# 0: Cartesian -# You will need files Data_InFilePrefix_vel.*.bin and Data_InFilePrefix_Cartesian.bin -# 1: Unstructured (tetrahedral for 3D and triangular for 2D) -# You will need files Data_InFilePrefix_vel.*.bin and Data_InFilePrefix_coordinates.bin, -# Data_InFilePrefix_connectivity.bin and Data_InFilePrefix_adjacency.bin -Data_MeshType = 0 - -# Data_InFilePrefix: String, common prefix for input velocity files (see minimum files needed above) -Data_InFilePrefix = dg - -# Data_SuffixTMin: Integer, number appended to the name of first velocity data file -# Assumes naming convention of Data_InFilePrefix_vel.N.bin, where Data_InFilePrefix is -# specified above and N varies from Data_SuffixTMin to (Data_SuffixTMin + Data_SuffixTDelta * Data_SuffixTRes) -Data_SuffixTMin = 0 - -# Data_SuffixTDelta: Integer, Increment between successive velocity data files -Data_SuffixTDelta = 1 - -# Data_SuffixTRes: Integer, number of velocity data files -Data_TRes = 51 - -# Data_TDelta: (Positive) Float, actual time spacing between successive velocity data files -# Assumes time spacing between velocity data files is constant -Data_TDelta = 0.02 - -# Data_TMin: Float, actual time assigned to first velocity data file -# Choice is arbitrary, but it usually makes sense to set this to 0.0, which would -# imply that the first velocity data file specifies the velocity at time 0.0 -Data_TMin = 0.0 - -# Data_TPeriodic: Binary flag, Specifies if data is periodic in time -# 0: Not periodic -# 1: Periodic (make sure first and last data file correspond to same point in cycle) -Data_TPeriodic = 1 - -# Data_XPeriodic: Binary flag, Specifies if data is periodic in space -# 0: Not periodic -# 1: Periodic -Data_XPeriodic = 0 - -# Data_MeshBounds.XMin, ..., Data_MeshBounds.ZMax: Specifies bounding box of velocity data -# Setting these bounds LARGER than the actual velocity domain will NOT affect the results -# Setting these bounds SMALLER than the actual velocity domain WILL limit the velocity data considered -Data_MeshBounds.XMin = 0.0 -Data_MeshBounds.XMax = 2.0 -Data_MeshBounds.YMin = 0.0 -Data_MeshBounds.YMax = 1.0 -Data_MeshBounds.ZMin = 0.0 -Data_MeshBounds.ZMax = 0.0 - -# Fluid_Density: Float, specifies fluid density (use consistent units) -# Valid only if Particle_Radius > 0 -Fluid_Density = 1.0 - -# Fluid_Viscosity: Float, specifies fluid viscosity (use consistent units) -# Valid only if Particle_Radius > 0 -Fluid_Viscosity = 1.0 - -# Output_TStart: Float, initial time to start simulation and begin writing output -# If FTLE_Compute = 1: Specifies time at which first FTLE field is computed AND output -# If Trace_Compute = 1: Specifies start time to begin computing tracer trajectories AND outputting positions to file -Output_TStart = 0.0 - -# Output_TRes: (Positive) Integer, Number of output times -# If FTLE_Compute: Specifies number of time instances when the FTLE field will be computed AND output -# If Trace_Compute: Specifies number of time instances that tracer positions will be output to file -Output_TRes = 11 - -# Output_TDelta: (Positive) Float, Time between successive output -# If FTLE_Compute: How often the FTLE field will be computed AND output -# If Trace_Compute: How often the tracer positions will be output to file -Output_TDelta = 0.1 - -# Int_Type: Integer, specified integration routine used -# 0: Euler -# 1: 4th order Runge Kutta -# 2: Runge Kutta Fehlberg (adaptive time stepping) -Int_Type = 1 - -# Int_TimeStep: (Positive) Float, Time step used for integration Euler or RK4 routines (i.e. Int_Type = 0 or 1) -# Valid only for Int_Type = 0 or 1 -Int_TimeStep = 0.001 - -# Int_Accuracy: (Positive) Float, Absolute error tolorance (between RK4 and RK5) -# Valid only for Int_Type = 2 -Int_Accuracy = 0.001 - -# Int_MinTimeStep: (Positive) Float, Minimum allowable time step used in RKF routine -# Once this time step is reached, RK4 approximation automatically accepted -# Valid only for Int_Type = 2 -Int_MinTimeStep = 0.00001 - -# Int_MaxTimeStep: (Positive) Float, Maximum allowable time step used in RKF routine -# Time step will not be increased beyond this limit even if error between RK4 and RK5 is less than Int_Accuracy -# Valid only for Int_Type = 2 -Int_MaxTimeStep = 0.1 - -# Int_TimeDirection: Integer, Should be set to 1 or -1 -# 1: Advect particles forward in time -# -1: Advect particles backward in time (used to compute backward time FTLE field) -Int_TimeDirection = 1 - -# Int_NormalFlow: Binary flag -# 0: Do not impose inward flow on no-slip boundaries -# 1: Replace no-slip condition on boundaries with inward velocity (magnitude specified by NormalFlowScaling below) -# Requires the file Data_InFilePrefix_normals.bin generated from program GetNormals.exe -# Currently valid only for Data_MeshType = 1 -Int_NormalFlow = 0 - -# Int_NormalFlowScaling: Float, Scaling for inward pointing boundary velocity (to prevent tracers from crossing -# no-slip boundaries), Need to set the number negative if file contains outward normals -# Valid only for Data_MeshType = 1, Int_NormalFlow = 1 -Int_NormalFlowScaling = 1.0 - -# Int_Extrapolate: Integer, allows particles to be integrated outside of domain of data by extrapolation of data set -# 0: End integration once particle leaves domain (or subset defined by Data_MeshBounds above). -# Computes FTLE for such points (and neighbors) early. -# 1: Extrapolate velocity outside domain by continuing particle with exit velocity (usually better than below) -# 2: Linear extrapolation of entire data set (NOT recommended unless you know what you're doing) -Int_Extrapolate = 0 - -# Particle_Radius: Float, Radius of all things treated as Lagrangian points -# Set to zero if you want points to behave as perfect tracers (recommended unless you know what you're doing) -Particle_Radius = 0.0 - -# Particle_Density: Float, Mass density of all things treated as Lagrangian points -# Respectively, set =, >, or < fluid density for neutrally buoyant, aerosols, or bubbles -# Only valid if Particle_Radius > 0 -Particle_Density = 1.0 - -# Particle_ICType: Int, Specified type of initial condition assigned to particles -# 0: Start particles from rest -# 1: Start particles with velocity equal to fluid velocity at particle release location (recommended) -# Valid only if Particle_Radius > 0 -Particle_ICType = 1 - -# Gravity_Vector[i]: Floats, Specifies components of gravity vector (use consistent units) -# Valid only if Particle_Radius > 0 -Gravity_Vector[0] = 0.0 -Gravity_Vector[1] = 0.0 -Gravity_Vector[2] = 0.0 - -# Local_Search_Checking: Binary flag -# 0: Only use local search protocol to determine elements containing initial location of points -# where velocity will need to be interpolated (recommended) -# 1: Use global search to check failures of local search protocol (safest, but can be painfully slow -# if you're not careful) -# Valid only if Data_MeshType = 1 -LocalSearchChecking = 0 - -# FTLE_Compute: Binary flag -# 0: Do not compute FTLE fields -# 1: Compute FTLE fields (Trace_Compute MUST be 0) -FTLE_Compute = 1 - -# FTLE_GenerateMesh: Binary flag -# 0: Read in FTLE mesh data from file FTLE_ICFile (this file created by running flowVC with FTLE_GenerateMesh = 1) -# 1: Generate a Cartesian mesh over which FTLE will be computed (mesh parameters specified below, resulting data -# saved to file FTLE_ICFile) -# Valid only if FTLE_Compute = 1 -FTLE_GenerateMesh = 1 - -# FTLE_ICFile: String, Name of file storing FTLE mesh information -# If FTLE_GenerateMesh = 0, this file should be located in Path_Work directory -# If FTLE_GenerateMesh = 0, this file will be written to Path_Work directory -# Valid only if FTLE_Compute = 1 -FTLE_ICFile = dg_FTLEgrid - -# FTLE_MeshBounds.XMin, ..., FTLE_MeshBounds.ZRes: Specifies structured grid over which FTLE is computed -# Valid only if FTLE_Compute = 1 -FTLE_MeshBounds.XMin = 0.0 -FTLE_MeshBounds.XMax = 2.0 -FTLE_MeshBounds.YMin = 0.0 -FTLE_MeshBounds.YMax = 1.0 -FTLE_MeshBounds.ZMin = 0.0 -FTLE_MeshBounds.ZMax = 0.0 -FTLE_MeshBounds.XRes = 201 -FTLE_MeshBounds.YRes = 101 -FTLE_MeshBounds.ZRes = 1 - -# FTLE_IntTLength: (Positive) Float, Integration time used to compute FTLE -# Valid only if FTLE_Compute = 1 -FTLE_IntTLength = 1.0 - -# FTLE_ComputeVariation: Binary flag, Used to help determine appropriate integration time by ah hoc means -# 0: Compute FTLE at each output time with integration time set to FTLE_IntTimeLength (nominally, can be reduced when a tracer leaves early) -# 1: Compute variation of FTLE with integration time -# Output_TRes MUST be 1 if FTLE_ComputeVariation = 1 -# Valid only if FTLE_Compute = 1 -FTLE_ComputeVariation = 0 - -# FTLE_VariationOutFreq: (Positive) Integer, controls how often FTLE is output when computing variation of FTLE with -# integration time -# If set to 1, output is generated at every time instance that velocity data is defined, if set to, e.g., 5, then output -# is generated at 1/5 of that rate (i.e. every 5 velocity data frames) -# Valid only if FTLE_ComputeVariation = 1 -FTLE_VariationOutFreq = 1 - -# FTLE_OutFilePrefix: String, Filename prefix where FTLE output data is written -# A separate file is generated for each output time (e.g. dg_forFTLE.0.bin, ..., dg_forFTLE.10.bin if Output_TRes = 11) -# NOTE: Two types of output files are generated, one set with the 1/T scaling in the definition of FTLE (*_noT.bin files), and ones with the scaling -# Valid only if FTLE_Compute = 1 -FTLE_OutFilePrefix = dg_forwardFTLE - - -# Trace_Compute: Binary flag -# 0: Do not compute tracer trajectories -# 1: Compute tracer trajectories (FTLE_Compute MUST be 0) -Trace_Compute = 0 - -Trace_ReleaseStrategy = 0 -Trace_ReleaseTMax = 0.000755 - - -# Trace_GenerateMesh: Binary Flag -# 0: Read in tracer initial positions from a file (specified by Trace_InFile) -# 1: Generate a Cartesian grid of tracers to integrate (mesh parameters specified below) -# Valid only if Trace_Compute = 1 -Trace_GenerateMesh = 1 - -# Trace_InFile: String, Name of File containing tracer initial positions -# Valid only if Trace_Compute = 1 and Trace_GenerateMesh = 0 -Trace_InFile = tracer_grid.bin - -# Trace_MultipleInFiles: Binary Flag -# 0: Default -# 1: Tracer initial conditions change over time and are specified by multiple files -Trace_MultipleInFiles = 0 - -# Trace_InFileFormat: Integer, specifies format of Trace_InFile -# 0: Use this if you want to reuse the .IC file that is generated from flowVC (use with care) -# 1: ASCII file, first line lists the number of tracers and subsequent lines list the x,y,z coordinates -# 2: ASCII legacy VTK polydata mesh format -# 3: ASCII legacy VTK unstructured mesh format -# 4: Binary file, first entry (int) lists the number of tracers and subsequent entries (doubles) list the x,y,z coordinates (binary version of format 1) -# Valid only if Compute_Tracers = 1 and Trace_GenerateMesh = 0 -Trace_InFileFormat = 4 - -# Trace_OutFile: String, Prefix for files where tracer position data will be written -# Tracer positions written to separate files for each output time -# Valid only if Trace_Compute = 1 -Trace_OutFilePrefix = dg_tracer-positions - -# Trace_NumLaunchTimes: (Positive) Integer, Number of times to release tracers from initial positions -# If Trace_MultipleInFiles = 1, then this should be number of files -# Valid only if Trace_Compute = 1 -Trace_NumLaunchTimes = 1 - -# Trace_LaunchTimeSpacing: (Positive) Float, Time between successive release of tracers from initial positions -# Valid only if Trace_Compute = 1 and Trace_NumLaunchTimes > 1 -Trace_LaunchTimeSpacing = 0.1 - -# Trace_IntTLength: (Positive) Float, Can be used to limit amount of time any tracer will be integrated -# Recommended to set this to some value larger than (Output_TRes x Output_TDelta) unless you know what you're doing -# Valid only if Trace_Compute = 1 and Trace_ReleaseStrategy = 0 -Trace_IntTLength = 100 - -# Trace_AlwaysOutput: Binary Flag -# 0: Do not write out tracer position to file once it has left the domain -# 1: Always write out tracer position to file, even if it left the domain -# Valid only if Trace_Compute = 1 -Trace_AlwaysOutput = 0 - -# Trace_CartMesh.XMin, ..., Trace_CartMesh.ZRes: Specifies Cartesian mesh of tracers to be intergrated -# Valid only if Trace_Compute = 1 AND Trace_GenerateMesh = 1 -Trace_CartMesh.XMin = 0.0 -Trace_CartMesh.XMax = 2.0 -Trace_CartMesh.YMin = 0.0 -Trace_CartMesh.YMax = 0.1 -Trace_CartMesh.ZMin = 0.0 -Trace_CartMesh.ZMax = 0.0 -Trace_CartMesh.XRes = 201 -Trace_CartMesh.YRes = 101 -Trace_CartMesh.ZRes = 1 - -# TODO Fill in this documentation -# These are required but their functionality is not -Trace_VorticityCompute = 0 -Trace_APCompute = 0 -Trace_CETCompute = 0 -Trace_CETAuxillaryMesh = 0 -Trace_CETMeshPrefix = specified -Trace_CETSubsteps = 0 -Trace_RTCompute = 0 -Trace_RTOutFilePrefix = dg_tracer-rt - -# VelOut_Compute: Binary flag, Used to generate interpolated velocity fields -# 0: Do not generate interpolated velocity fields -# 1: Generate interploated velocity fields -VelOut_Compute = 0 - -# VelOut_GenerateMesh: Binary flag -# 0: Read interpolation locations from file specified by VelOut_InFile -# 1: Generate a Cartesian mesh of positions where velocity will be interpolated (mesh parameters specified below) -# Valid only for VelOut_Compute = 1 -VelOut_GenerateMesh = 1 - -# VelOut_InFile: String, filename containing locations of points for interpolation -# Valid only for VelOut_Compute = 1 and VelOut_GenerateMesh = 0 -VelOut_InFile = interpolation-positions.vtk - -# VelOut_InFileFormat, Integer, specified format of VelOut_InFile -# 1: ASCII file, first line lists the number of locations and subsequent lines list the coordinates -# 3: ASCII legacy VTK polydata mesh format (as output from Paraview) -# 4: ASCII legacy VTK unstructured mesh format (as output from Paraview) -# Valid only if VelOut_Compute = 1 AND VelOut_GenerateMesh = 0 -VelOut_InFileFormat = 1 - -# VelOut_FilePrefix: String, Filename prefix for files that interpolated velocity is data is written to -# Velocity output written to separate files, one per output time -# Valid only if VelOut_Compute = 1 -VelOut_FilePrefix = dg-interpolated - -# VelOut_CartMesh.XMin, ..., VelOut_CartMesh.ZRes: Specifies Cartesian mesh of interpolation positions -# Valid only if VelOut_Compute = 1 -VelOut_CartMesh.XMin = 0.0 -VelOut_CartMesh.XMax = 2.0 -VelOut_CartMesh.YMin = 0.0 -VelOut_CartMesh.YMax = 1.0 -VelOut_CartMesh.ZMin = 0.0 -VelOut_CartMesh.ZMax = 0.0 -VelOut_CartMesh.XRes = 21 -VelOut_CartMesh.YRes = 11 -VelOut_CartMesh.ZRes = 1 +#+begin_src shell :tangle ../../src/config/config.inigenerator.cfg + [Outputs] + ################################# flowVC INPUT FILE ##################################### + # + # NOTE: Order of parameters listed must be maintained for proper parsing of input file + # Comment lines begin with #, comments can be added or removed as desired + # Comments cannot occur on lines containing variable declartations + # Standard format: VARIABLE_NAME = VALUE + # + ####################################################################################### + + # Path_Data: String, Directory containing data files, e.g. velocity data, etc. + # Can be set to pwd (i.e. present working directory) + Path_Data = ../bin/ + + # Path_Output: String, Directory where output files will be written + # Can be set to pwd (i.e. present working directory) + Path_Output = ../output/ + + # Dimensions: Integer, Specifies if velocity data is 2D or 3D + Dimensions = 3 + + # Data_MeshType: Integer, Specifies mesh type of velocity data + # 0: Cartesian + # You will need files Data_InFilePrefix_vel.*.bin and Data_InFilePrefix_Cartesian.bin + # 1: Unstructured (tetrahedral for 3D and triangular for 2D) + # You will need files Data_InFilePrefix_vel.*.bin and Data_InFilePrefix_coordinates.bin, + # Data_InFilePrefix_connectivity.bin and Data_InFilePrefix_adjacency.bin + Data_MeshType = 0 + + # Data_InFilePrefix: String, common prefix for input velocity files (see minimum files needed above) + Data_InFilePrefix = dg + + # Data_SuffixTMin: Integer, number appended to the name of first velocity data file + # Assumes naming convention of Data_InFilePrefix_vel.N.bin, where Data_InFilePrefix is + # specified above and N varies from Data_SuffixTMin to (Data_SuffixTMin + Data_SuffixTDelta * Data_SuffixTRes) + Data_SuffixTMin = 0 + + # Data_SuffixTDelta: Integer, Increment between successive velocity data files + Data_SuffixTDelta = 50 + + # Data_SuffixTRes: Integer, number of velocity data files + Data_TRes = 101 + + # Data_TDelta: (Positive) Float, actual time spacing between successive velocity data files + # Assumes time spacing between velocity data files is constant + Data_TDelta = 0.05 + + # Data_TMin: Float, actual time assigned to first velocity data file + # Choice is arbitrary, but it usually makes sense to set this to 0.0, which would + # imply that the first velocity data file specifies the velocity at time 0.0 + Data_TMin = 0.0 + + # Data_TPeriodic: Binary flag, Specifies if data is periodic in time + # 0: Not periodic + # 1: Periodic (make sure first and last data file correspond to same point in cycle) + Data_TPeriodic = 1 + + # Data_XPeriodic: Binary flag, Specifies if data is periodic in space + # 0: Not periodic + # 1: Periodic + Data_XPeriodic = 0 + + # Data_MeshBounds.XMin, ..., Data_MeshBounds.ZMax: Specifies bounding box of velocity data + # Setting these bounds LARGER than the actual velocity domain will NOT affect the results + # Setting these bounds SMALLER than the actual velocity domain WILL limit the velocity data considered + Data_MeshBounds.XMin = 0.0 + Data_MeshBounds.XMax = 1.0 + Data_MeshBounds.YMin = 0.0 + Data_MeshBounds.YMax = 1.0 + Data_MeshBounds.ZMin = 0.0 + Data_MeshBounds.ZMax = 1.0 + + # Fluid_Density: Float, specifies fluid density (use consistent units) + # Valid only if Particle_Radius > 0 + Fluid_Density = 1.2e-3 + + # Fluid_Viscosity: Float, specifies fluid viscosity (use consistent units) + # Valid only if Particle_Radius > 0 + Fluid_Viscosity = 1.81e-4 + + # Output_TStart: Float, initial time to start simulation and begin writing output + # If FTLE_Compute = 1: Specifies time at which first FTLE field is computed AND output + # If Trace_Compute = 1: Specifies start time to begin computing tracer trajectories AND outputting positions to file + Output_TStart = 0.0 + + # Output_TRes: (Positive) Integer, Number of output times + # If FTLE_Compute: Specifies number of time instances when the FTLE field will be computed AND output + # If Trace_Compute: Specifies number of time instances that tracer positions will be output to file + Output_TRes = 20 + + # Output_TDelta: (Positive) Float, Time between successive output + # If FTLE_Compute: How often the FTLE field will be computed AND output + # If Trace_Compute: How often the tracer positions will be output to file + Output_TDelta = 0.05 + + # Int_Type: Integer, specified integration routine used + # 0: Euler + # 1: 4th order Runge Kutta + # 2: Runge Kutta Fehlberg (adaptive time stepping) + Int_Type = 1 + + # Int_TimeStep: (Positive) Float, Time step used for integration Euler or RK4 routines (i.e. Int_Type = 0 or 1) + # Valid only for Int_Type = 0 or 1 + Int_TimeStep = 5e-6 + + # Int_Accuracy: (Positive) Float, Absolute error tolorance (between RK4 and RK5) + # Valid only for Int_Type = 2 + Int_Accuracy = 0.0001 + + # Int_MinTimeStep: (Positive) Float, Minimum allowable time step used in RKF routine + # Once this time step is reached, RK4 approximation automatically accepted + # Valid only for Int_Type = 2 + Int_MinTimeStep = 0.0001 + + # Int_MaxTimeStep: (Positive) Float, Maximum allowable time step used in RKF routine + # Time step will not be increased beyond this limit even if error between RK4 and RK5 is less than Int_Accuracy + # Valid only for Int_Type = 2 + Int_MaxTimeStep = 0.001 + + # Int_TimeDirection: Integer, Should be set to 1 or -1 + # 1: Advect particles forward in time + # -1: Advect particles backward in time (used to compute backward time FTLE field) + Int_TimeDirection = 1 + + # Int_NormalFlow: Binary flag + # 0: Do not impose inward flow on no-slip boundaries + # 1: Replace no-slip condition on boundaries with inward velocity (magnitude specified by NormalFlowScaling below) + # Requires the file Data_InFilePrefix_normals.bin generated from program GetNormals.exe + # Currently valid only for Data_MeshType = 1 + Int_NormalFlow = 0 + + # Int_NormalFlowScaling: Float, Scaling for inward pointing boundary velocity (to prevent tracers from crossing + # no-slip boundaries), Need to set the number negative if file contains outward normals + # Valid only for Data_MeshType = 1, Int_NormalFlow = 1 + Int_NormalFlowScaling = 0.05 + + # Int_Extrapolate: Integer, allows particles to be integrated outside of domain of data by extrapolation of data set + # 0: End integration once particle leaves domain (or subset defined by Data_MeshBounds above). + # Computes FTLE for such points (and neighbors) early. + # 1: Extrapolate velocity outside domain by continuing particle with exit velocity (usually better than below) + # 2: Linear extrapolation of entire data set (NOT recommended unless you know what you're doing) + Int_Extrapolate = 0 + + # Particle_Radius: Float, Radius of all things treated as Lagrangian points + # Set to zero if you want points to behave as perfect tracers (recommended unless you know what you're doing) + Particle_Radius = 0.0 + + # Particle_Density: Float, Mass density of all things treated as Lagrangian points + # Respectively, set =, >, or < fluid density for neutrally buoyant, aerosols, or bubbles + # Only valid if Particle_Radius > 0 + Particle_Density = 1.0 + + # Particle_ICType: Int, Specified type of initial condition assigned to particles + # 0: Start particles from rest + # 1: Start particles with velocity equal to fluid velocity at particle release location (recommended) + # Valid only if Particle_Radius > 0 + Particle_ICType = 0 + + # Gravity_Vector[i]: Floats, Specifies components of gravity vector (use consistent units) + # Valid only if Particle_Radius > 0 + Gravity_Vector[0] = 0.0 + Gravity_Vector[1] = 0.0 + Gravity_Vector[2] = -981 + + # Local_Search_Checking: Binary flag + # 0: Only use local search protocol to determine elements containing initial location of points + # where velocity will need to be interpolated (recommended) + # 1: Use global search to check failures of local search protocol (safest, but can be painfully slow + # if you're not careful) + # Valid only if Data_MeshType = 1 + LocalSearchChecking = 1 + + # FTLE_Compute: Binary flag + # 0: Do not compute FTLE fields + # 1: Compute FTLE fields (Trace_Compute MUST be 0) + FTLE_Compute = 1 + + # FTLE_GenerateMesh: Binary flag + # 0: Read in FTLE mesh data from file FTLE_ICFile (this file created by running flowVC with FTLE_GenerateMesh = 1) + # 1: Generate a Cartesian mesh over which FTLE will be computed (mesh parameters specified below, resulting data + # saved to file FTLE_ICFile) + # Valid only if FTLE_Compute = 1 + FTLE_GenerateMesh = 1 + + # FTLE_ICFile: String, Name of file storing FTLE mesh information + # If FTLE_GenerateMesh = 0, this file should be located in Path_Work directory + # If FTLE_GenerateMesh = 0, this file will be written to Path_Work directory + # Valid only if FTLE_Compute = 1 + FTLE_ICFile = FTLE_mesh.bin + + # FTLE_MeshBounds.XMin, ..., FTLE_MeshBounds.ZRes: Specifies structured grid over which FTLE is computed + # Valid only if FTLE_Compute = 1 + FTLE_MeshBounds.XMin = 0.0 + FTLE_MeshBounds.XMax = 2.0 + FTLE_MeshBounds.YMin = 0.0 + FTLE_MeshBounds.YMax = 1.0 + FTLE_MeshBounds.ZMin = 0.0 + FTLE_MeshBounds.ZMax = 1.0 + FTLE_MeshBounds.XRes = 201 + FTLE_MeshBounds.YRes = 101 + FTLE_MeshBounds.ZRes = 101 + + # FTLE_IntTLength: (Positive) Float, Integration time used to compute FTLE + # Valid only if FTLE_Compute = 1 + FTLE_IntTLength = 1.0 + + # FTLE_ComputeVariation: Binary flag, Used to help determine appropriate integration time by ah hoc means + # 0: Compute FTLE at each output time with integration time set to FTLE_IntTimeLength (nominally, can be reduced when a tracer leaves early) + # 1: Compute variation of FTLE with integration time + # Output_TRes MUST be 1 if FTLE_ComputeVariation = 1 + # Valid only if FTLE_Compute = 1 + FTLE_ComputeVariation = 0 + + # FTLE_VariationOutFreq: (Positive) Integer, controls how often FTLE is output when computing variation of FTLE with + # integration time + # If set to 1, output is generated at every time instance that velocity data is defined, if set to, e.g., 5, then output + # is generated at 1/5 of that rate (i.e. every 5 velocity data frames) + # Valid only if FTLE_ComputeVariation = 1 + FTLE_VariationOutFreq = 1 + + # FTLE_OutFilePrefix: String, Filename prefix where FTLE output data is written + # A separate file is generated for each output time (e.g. dg_forFTLE.0.bin, ..., dg_forFTLE.10.bin if Output_TRes = 11) + # NOTE: Two types of output files are generated, one set with the 1/T scaling in the definition of FTLE (*_noT.bin files), and ones with the scaling + # Valid only if FTLE_Compute = 1 + FTLE_OutFilePrefix = FTLE_medium_bwd + + + # Trace_Compute: Binary flag + # 0: Do not compute tracer trajectories + # 1: Compute tracer trajectories (FTLE_Compute MUST be 0) + Trace_Compute = 0 + + Trace_ReleaseStrategy = 0 + Trace_ReleaseTMax = 0.000755 + + + # Trace_GenerateMesh: Binary Flag + # 0: Read in tracer initial positions from a file (specified by Trace_InFile) + # 1: Generate a Cartesian grid of tracers to integrate (mesh parameters specified below) + # Valid only if Trace_Compute = 1 + Trace_GenerateMesh = 1 + + # Trace_InFile: String, Name of File containing tracer initial positions + # Valid only if Trace_Compute = 1 and Trace_GenerateMesh = 0 + Trace_InFile = tracer_grid.bin + + # Trace_MultipleInFiles: Binary Flag + # 0: Default + # 1: Tracer initial conditions change over time and are specified by multiple files + Trace_MultipleInFiles = 0 + + # Trace_InFileFormat: Integer, specifies format of Trace_InFile + # 0: Use this if you want to reuse the .IC file that is generated from flowVC (use with care) + # 1: ASCII file, first line lists the number of tracers and subsequent lines list the x,y,z coordinates + # 2: ASCII legacy VTK polydata mesh format + # 3: ASCII legacy VTK unstructured mesh format + # 4: Binary file, first entry (int) lists the number of tracers and subsequent entries (doubles) list the x,y,z coordinates (binary version of format 1) + # Valid only if Compute_Tracers = 1 and Trace_GenerateMesh = 0 + Trace_InFileFormat = 4 + + # Trace_OutFile: String, Prefix for files where tracer position data will be written + # Tracer positions written to separate files for each output time + # Valid only if Trace_Compute = 1 + Trace_OutFilePrefix = dg_tracer-positions + + # Trace_NumLaunchTimes: (Positive) Integer, Number of times to release tracers from initial positions + # If Trace_MultipleInFiles = 1, then this should be number of files + # Valid only if Trace_Compute = 1 + Trace_NumLaunchTimes = 1 + + # Trace_LaunchTimeSpacing: (Positive) Float, Time between successive release of tracers from initial positions + # Valid only if Trace_Compute = 1 and Trace_NumLaunchTimes > 1 + Trace_LaunchTimeSpacing = 0.1 + + # Trace_IntTLength: (Positive) Float, Can be used to limit amount of time any tracer will be integrated + # Recommended to set this to some value larger than (Output_TRes x Output_TDelta) unless you know what you're doing + # Valid only if Trace_Compute = 1 and Trace_ReleaseStrategy = 0 + Trace_IntTLength = 100 + + # Trace_AlwaysOutput: Binary Flag + # 0: Do not write out tracer position to file once it has left the domain + # 1: Always write out tracer position to file, even if it left the domain + # Valid only if Trace_Compute = 1 + Trace_AlwaysOutput = 0 + + # Trace_CartMesh.XMin, ..., Trace_CartMesh.ZRes: Specifies Cartesian mesh of tracers to be intergrated + # Valid only if Trace_Compute = 1 AND Trace_GenerateMesh = 1 + Trace_CartMesh.XMin = 0.0 + Trace_CartMesh.XMax = 2.0 + Trace_CartMesh.YMin = 0.0 + Trace_CartMesh.YMax = 0.1 + Trace_CartMesh.ZMin = 0.0 + Trace_CartMesh.ZMax = 0.0 + Trace_CartMesh.XRes = 201 + Trace_CartMesh.YRes = 101 + Trace_CartMesh.ZRes = 1 + + # TODO Fill in this documentation + # These are required but their functionality is not + Trace_VorticityCompute = 0 + Trace_APCompute = 0 + Trace_CETCompute = 0 + Trace_CETAuxillaryMesh = 0 + Trace_CETMeshPrefix = specified + Trace_CETSubsteps = 0 + Trace_RTCompute = 0 + Trace_RTOutFilePrefix = dg_tracer-rt + + # VelOut_Compute: Binary flag, Used to generate interpolated velocity fields + # 0: Do not generate interpolated velocity fields + # 1: Generate interploated velocity fields + VelOut_Compute = 0 + + # VelOut_GenerateMesh: Binary flag + # 0: Read interpolation locations from file specified by VelOut_InFile + # 1: Generate a Cartesian mesh of positions where velocity will be interpolated (mesh parameters specified below) + # Valid only for VelOut_Compute = 1 + VelOut_GenerateMesh = 1 + + # VelOut_InFile: String, filename containing locations of points for interpolation + # Valid only for VelOut_Compute = 1 and VelOut_GenerateMesh = 0 + VelOut_InFile = interpolation-positions.vtk + + # VelOut_InFileFormat, Integer, specified format of VelOut_InFile + # 1: ASCII file, first line lists the number of locations and subsequent lines list the coordinates + # 3: ASCII legacy VTK polydata mesh format (as output from Paraview) + # 4: ASCII legacy VTK unstructured mesh format (as output from Paraview) + # Valid only if VelOut_Compute = 1 AND VelOut_GenerateMesh = 0 + VelOut_InFileFormat = 1 + + # VelOut_FilePrefix: String, Filename prefix for files that interpolated velocity is data is written to + # Velocity output written to separate files, one per output time + # Valid only if VelOut_Compute = 1 + VelOut_FilePrefix = dg-interpolated + + # VelOut_CartMesh.XMin, ..., VelOut_CartMesh.ZRes: Specifies Cartesian mesh of interpolation positions + # Valid only if VelOut_Compute = 1 + VelOut_CartMesh.XMin = 0.0 + VelOut_CartMesh.XMax = 2.0 + VelOut_CartMesh.YMin = 0.0 + VelOut_CartMesh.YMax = 1.0 + VelOut_CartMesh.ZMin = 0.0 + VelOut_CartMesh.ZMax = 0.0 + VelOut_CartMesh.XRes = 21 + VelOut_CartMesh.YRes = 11 + VelOut_CartMesh.ZRes = 1 #+end_src diff --git a/docs/content/header.org b/docs/content/header.org index ae80325..742efb4 100644 --- a/docs/content/header.org +++ b/docs/content/header.org @@ -1,2 +1,2 @@ #+OPTIONS: ^:nil -| [[./index.org][Home]] | [[./inigenerator.org][inigenerator]] | +| [[./index.org][Home]] | [[./vtu_2bin.org][vtu2bin]] | [[./inigenerator.org][inigenerator]] | diff --git a/docs/content/index.org b/docs/content/index.org index 2d750d8..5f85667 100644 --- a/docs/content/index.org +++ b/docs/content/index.org @@ -1,4 +1,5 @@ #+SETUPFILE: ../org-themes/theme-readtheorg.setup +* Navigation Bar #+INCLUDE: "./header.org" * Welcome Welcome to the flowVC-utils documentation this utility project provides documentation and tooling to assist in utilizing the flowVC software for computing Finite Time Lyoponove Exponents @@ -6,6 +7,7 @@ Welcome to the flowVC-utils documentation this utility project provides document * Project Organization It is recomended that before starting your project is organized into the following directory structure, with a subdirectory being created for each of the simulation cases. Note the trailing "_" in the subdirectory names, this is necissary for the code to to generate and identify file names throughout the process. +#+begin_src shell └── project_root ├── case1_ │   ├── input_bin @@ -23,14 +25,16 @@ It is recomended that before starting your project is organized into the followi │   └── case2_00100.vtu ├── output_bin └── output_vtk - +#+end_src The input_vtu stores the input data files in a ".vtu" file format. This would often be the velocity data from a CFD simulation that you wish to generate FTLE fields for. * Step 1: Create Binary Files using - FlowVC requires the velocity data be converted into binary files prior to exectution. These binary files contain the velocity data as well as the coordinate and connectivity information of your dataset. For more information regarding the anticipated file format, refer to the flowVC documentation [[https://bkm82.github.io/flowVC/][flowVC Documenation]]. - - To generate the binary files use the vtu2bin argument [[./vtu_2bin.org][vtu2bin]] +#+INCLUDE: "./vtu_2bin.org::vtu2bin" +[[./vtu_2bin.org][More Detail]] * Step 2: Create the input settings (.in) file +#+INCLUDE: "./inigenerator.org::Inigenerator" + +[[./inigenerator.org][More Detail]] diff --git a/docs/content/inigenerator.org b/docs/content/inigenerator.org index 4e6e979..d85e7d7 100644 --- a/docs/content/inigenerator.org +++ b/docs/content/inigenerator.org @@ -1,11 +1,12 @@ #+SETUPFILE: ../org-themes/theme-readtheorg.setup +* Navigation Bar #+INCLUDE: "./header.org" -** Inigenerator -The inigenerator utility is utilized to create the flowVC input files for multiple simulations. The utility reads a configuration file wich can be used to set default paramaters (config.inigenerator.cfg) and adjusts input/output paths for each case.The utility can also be used to determines 3D coordinate bounds, streaching them slighly to meet the flowVC requirement of having cubic cells. Essentially the utility helps manage +* Inigenerator +The inigenerator utility is utilized to create the flowVC input files for multiple simulations. The inigenerator utility helps managing the following settings: - Directory paths (where input data is stored, where outputs go, etc.) -- Mesh bounds for the data (e.g., xmin, xmax, ymin, ymax, zmin, zmax). +- Mesh bounds for the data (e.g., xmin, xmax, ymin, ymax, zmin, zmax), streaching the mesh slighly to ensure cubic cells as required by flowVC - Resolution in each dimension (xres, yres, zres) based on the cell size. @@ -13,54 +14,59 @@ The inigenerator utility is utilized to create the flowVC input files for multip - Name prefixes and other run-time details that go into the final configuration so the output FTLE files are identifiable for each simulation case. -*** Usage -#+begin_src shell -python -m flowvcutils inigenerator -#+end_src +- All of the other settings can be set by updating the [[./FTLE_example.org][configuration file]] located: + #+BEGIN_SRC Text + /src/config/config.inigenerator.cfg + #+END_SRC +As the inigenerator creates absolute file paths, it is recomeded that this utility is ran from the directory and computer/server that will be executing the flowVC calculations. If the folder is moved re-run the generator to update filepaths. -The defaults for the .in settings can be found and changed in the flowVC_utils/src/config directory. The tool assumes that the results of the simulation are organized in the following folder structure, where "project_root" and "case1" can be any name, but the "input_bin" "input_vtu" and "output_bin" directory names are exactly as shown: +If you are using the [[./index.org::Project Organization][recomended layout]] the best way to use this is from the project_root direcory running the following command with the --batch flag enabled. -#+Begin_SRC text - project_root - └── case1 - ├── input_bin - ├── input_vtu - └── output_bin -#+End_SRC +#+begin_src shell + python -m flowvcutils inigenerator --batch +#+end_src -*** Options -**** -d, --directory +* Options +** -d, --directory This specifies where to run the tool from, with a default being the current directory you are in. -**** --autorange: +** --autorange: This flag can be utilized to have the tool read the mesh bounds for the DataMesh and FTLEMesh from the simulation results data. To use this flag ensure there is at least one .vtu file in the input_vtu directory. If it is not set whatever is in the configuration file will be utilized. -**** --cell_size +** --cell_size The cell size for the FTLE mesh with a default of 0.001 -**** --manual_bounds: +** --manual_bounds: This can be utilized to set the min_x, min_y, min_z, max_x, max_y, and max_z for the FTLE mesh. This is useful when attempting to compute the ftle field on a smaller subset (i.e. slice) of the result domain. -**** --direction: +** --direction: This can be utilized to specify the computation of an attracting (backward) or repeling (forward) FTLE field. -**** --batch: -This creates input files for multiple simulation result cases at once. To utilize this ensure your project is organized as follows - -#+Begin_SRC text --project_directory -project_root -├── case1 -│   ├── input_bin -│   ├── input_vtu -│   └── output_bin -└── case2 - ├── input_bin - ├── input_vtu - └── output_bin -#+End_SRC - -*** Examples +** --batch: +This creates input files for multiple simulation result cases at once. To utilize this ensure your project is organized using the recomended layout + +#+begin_src text +└── project_root + ├── case1_ + │   ├── input_bin + │   ├── input_vtu + │   │   ├── case1_00000.vtu + │   │   ├── case1_00050.vtu + │   │   └── case2_00100.vtu + │   ├── output_bin + │   └── output_vtk + └── case2_ + ├── input_bin + ├── input_vtu + │   ├── case2_00000.vtu + │   ├── case2_00050.vtu + │   └── case2_00100.vtu + ├── output_bin + └── output_vtk +#+end_src + + +* Examples To generate the FTLE mesh over the entire computation domain for multiple simulation results you can run: #+begin_src shell python -m flowvcutils inigenerator --auto_range True --batch diff --git a/docs/content/vtu_2bin.org b/docs/content/vtu_2bin.org index a23fe3e..23107c1 100644 --- a/docs/content/vtu_2bin.org +++ b/docs/content/vtu_2bin.org @@ -2,12 +2,60 @@ #+OPTIONS: ^:nil #+INCLUDE: "./header.org" +* vtu2bin +FlowVC requires the velocity data be converted into binary files prior to exectution. These binary files contain the velocity data as well as the coordinate and connectivity information of your dataset and can be created using the vtu2bin command. + +If you are using the [[./index.org::Project Organization][recomended layout]] the best way to use this is from the project_root direcory running the following command with the --batch flag enabled. + +#+begin_src shell +python -m flowvcutils vtu2bin START STOP --batch +#+end_src + +Where START and STOP is the starting and stopping timestep for your data set. This will generate the binary files for all of the simulation cases that you have with a single command. + +* Options + +** --root Text + +In batch mode this is the root to the project directory. Ensure the .vtu files are located in the path root/case_/input_vtu/case_xxxxxx.vtu + +If batch mode is not used, this is the directory where the .vtu files are located, with the default being the current dirctory. +** --output TEXT +Output directory target to store bin files. -* Data Format -To use flowVC, you'll need to supply velocity data in binary format. The velocity data typically requires separate files for the velocity field at each time point. A single (Cartesian) or multiple (Unstructured) files define the mesh. These files all share a common prefix, which can be any name you choose and is referred to here as InFilePrefix. +Batch Mode: This will be set to root/case_input_bin/ +Non Batch Mode: Default = current working directory +** --file_name TEXT +The base file name, used to locate the velocity files. (e.g., case1_ if the ".vtu" files are named case1_00000.vtu). + +Batch Mode: This will be set to the subdirectory name. +Non Batch Mode: default = current directory name + +** --batch +Flag to set the operating mode into Batch Mode to process all subdirectorys in the project. Otherwise it will process a single folder. + + +** --extension TEXT +File extension of the data files. The default is '.vtu'. File formats ".vtp", ".vtk" and ".pvtu" file formats might work, but they have not been tested. + +** --increment INTEGER +The increment between each vtu file (default: 50). + +** --num_digits INTEGER +The number of digits in file name, (e.g., 5 for case1_00100.vtu) with the default being 5 + +** --field_name TEXT +Field name for velocity data within the .vtu files. The default is 'velocity' and this is the only field name that was tested. + +** -h, --help +Show the help message with a description of all the options. + + +* Binary File Data Format +FlowVC requires velocity files, and for an unstructured mesh requires a cordinates file, connectivity file, and an adjacency file to define the mesh. These files all share a common prefix, which can be any name you choose and is refered to here as InFilePrefix. ** Velocity If the velocity is defined discretely in time, each time instant should have its own separate file. The velocity data must be equally spaced in time. File names should follow the format InFilePrefix_vel.#.bin, where # is a unique index for each time instant. The difference between successive file time points must be consistent @@ -27,24 +75,6 @@ t_s \; \underbrace{u_0\; v_0\; w_0}_{\text{node 0}} \underbrace{u_1\; v_1 \; w_ | t | double | | u,v,w | double | - -** Cartesian Mesh -To define a cartesian mesh, the mesh bounds and resolution needs to be defined. - - \begin{equation} - x_{min} \;\; x_{max} \;\; x_{res} \;\; y_{min} \;\; y_{max}\;\; y_{res} \;\; z_{min} \;\; z_{max} \; \; z_{res} - \end{equation} - -- Resolution: Number of *nodes* in each direction (not intervals) -- 2D: Set $z_{min} = z_{max} = 0.0$ and $z_{res}=1$ -#+Latex: \hfill -#+ATTR_HTML: :width 100% -| | | -| Value | Type | -|---------+--------| -| min/max | double | -| res | int | - ** Unstructured Mesh The unstructured mesh is defined by three files: - Coordinates File : InFilePrefix_coordinates.bin @@ -58,7 +88,6 @@ n \; \underbrace{x_0\; y_0\; z_0}_{\text{node 0}} \underbrace{x_1\; y_1 \; z_1} - n: The the number of points in the data set - $x_i \; y_i \; z_i$: The cordinates of each node -- 2D: set $z_i = 0$ #+ATTR_HTML: :width 100% @@ -75,7 +104,7 @@ The connectivity specifies the indices of the 4 nodes that make up each element. - e: The number of elements in the data set - $i_i^j$: The index of the j'th node making i'th element in the dataset - - 2D: $n_i^3 = -1$ + #+ATTR_HTML: :width 100% | Value | Data Type | @@ -83,7 +112,6 @@ The connectivity specifies the indices of the 4 nodes that make up each element. | e | int | | $i_i^j$ | int | - *** Adjacency The adjacency file contains the indices of the adacent elements that share a face with the current element. The index of each element is based on the order of the connectivity file. @@ -92,68 +120,7 @@ The adjacency file contains the indices of the adacent elements that share a fac \end{equation} - Boundary Elements: For faces not shared with other elements set $e=-1$ - - 2D: $e_i^3=-1$ - - Ordering: + **** Data Type e(int): The number of elements in the data set $e_i^j$ (int): The index of the element that shares the j'th face for the ith element in the dataset. Note if the element face is not shared with another element (i.e. on the edge this is a -1) -* vtu2bin - -The vtu2bin utility can be utilized to generate the binary files from a -.vtu dataset. To use it run: -#+begin_src shell -python -m flowvcutils vtu2bin START STOP -#+end_src - -where START is the starting index of your velocity data and STOP is the stopping index of your velocity data - -** Project Organization -To utilize the flowVC-Utils - -The recomended way to use this utility is in --batch mode, which will create the binary files for multiple cases all at once. In order to do this structure your simulation results into the following format. The "project_root" can be any name, but - -project_root -├── case1 -│   ├── input_bin -│   ├── input_vtu -│   └── output_bin -└── case2 - ├── input_bin - ├── input_vtu - └── output_bin - - - -* Options -#+Begin_SRC text -python -m flowvcutils vtu2bin --help -Usage: python -m flowvcutils vtu2bin [OPTIONS] START STOP - - Convert .vtu files into .bin format for FlowVC. - - START: Starting index for the processing (positional argument). STOP : - Stopping index for the processing (positional argument). - -Options: - --root TEXT Directory with the VTU files (default: current - directory).In batch mode ensure vtu files are in - root/subdir/input_vtu/ - --output TEXT Output directory target to store bin files (default: - current directory).In batch mode this will be - root/subdir/input_bin/ - --file_name TEXT Base file name (e.g., steady_ for steady_00000.vtu) - (default: current directory name).Note: In batch - mode this will be the subdirectory namesensure files - are named - root/subdirname/input_vtu/subdirname_xxxxx.vtu - --batch Process subdirectories (directory mode) if set - otherwise process a single folder. - --extension TEXT File extension (default: '.vtu'). - --increment INTEGER Increment between each vtu file (default: 50). - --num_digits INTEGER Digits in file name (e.g., 5 for test_00100.vtu). - (default: 5). - --field_name TEXT Field name for velocity data within the .vtu files - (default: 'velocity'). - -h, --help Show this message and exit. - - #+End_SRC diff --git a/src/config/config.inigenerator.backup b/src/config/config.inigenerator.backup new file mode 100644 index 0000000..f07efea --- /dev/null +++ b/src/config/config.inigenerator.backup @@ -0,0 +1,99 @@ +[Outputs] +Path_Data = pwd +Path_Output = pwd +Dimensions = 3 +Data_MeshType = 1 +Data_InFilePrefix = dg +Data_SuffixTMin = 0 +Data_SuffixTDelta = 50 +Data_TRes = 101 +Data_TDelta = 0.05 +Data_TMin = 0.0 +Data_TPeriodic = 0 +Data_XPeriodic = 0 +Data_MeshBounds.XMin = 0.0 +Data_MeshBounds.XMax = 1.0 +Data_MeshBounds.YMin = 0.0 +Data_MeshBounds.YMax = 1.0 +Data_MeshBounds.ZMin = 0.0 +Data_MeshBounds.ZMax = 1.0 +Fluid_Density = 1.2e-3 +Fluid_Viscosity = 1.81e-4 +Output_TStart = 0.0 +Output_TRes = 20 +Output_TDelta = 0.05 +Int_Type = 1 +Int_TimeStep = 5e-6 # good while doing unsteady simulations +Int_Accuracy = 0.0001 +Int_MinTimeStep = 0.0001 +Int_MaxTimeStep = 0.001 +Int_TimeDirection = 1 +Int_NormalFlow = 0 +Int_NormalFlowScaling = 0.05 +Int_Extrapolate = 0 +Particle_Radius = 0.0 +Particle_Density = 1.0 +Particle_ICType = 0 +Gravity_Vector[0] = 0 +Gravity_Vector[1] = 0 +Gravity_Vector[2] = -981 +LocalSearchChecking = 1 +FTLE_Compute = 1 +FTLE_GenerateMesh = 1 +FTLE_ICFile = FTLE_mesh.bin +FTLE_MeshBounds.XMin = 0.0 +FTLE_MeshBounds.XMax = 2.0 +FTLE_MeshBounds.YMin = 0.0 +FTLE_MeshBounds.YMax = 1.0 +FTLE_MeshBounds.ZMin = 0.0 +FTLE_MeshBounds.ZMax = 1.0 +FTLE_MeshBounds.XRes = 201 +FTLE_MeshBounds.YRes = 101 +FTLE_MeshBounds.ZRes = 101 +FTLE_IntTLength = 1.0 +FTLE_ComputeVariation = 0 +FTLE_VariationOutFreq = 1 +FTLE_OutFilePrefix = FTLE_medium_bwd +Trace_Compute = 0 +Trace_ReleaseStrategy = 0 +Trace_ReleaseTMax = 0.000755 +Trace_GenerateMesh = 0 +Trace_InFile = trachea_1.vtk +Trace_MultipleInFiles = 0 +Trace_InFileFormat = 4 +Trace_OutFilePrefix = trachea_1_5e-5 +Trace_NumLaunchTimes = 1 +Trace_LaunchTimeSpacing = 0.02 +Trace_IntTLength = 1000 +Trace_AlwaysOutput = 1 +Trace_CartMesh.XMin = -1.9 +Trace_CartMesh.XMax = .43 +Trace_CartMesh.YMin = -11.3 +Trace_CartMesh.YMax = -9.7 +Trace_CartMesh.ZMin = 26.1 +Trace_CartMesh.ZMax = 26.3 +Trace_CartMesh.XRes = 200 +Trace_CartMesh.YRes = 200 +Trace_CartMesh.ZRes = 4 +Trace_VorticityCompute = 0 +Trace_APCompute = 0 +Trace_CETCompute = 0 +Trace_CETAuxillaryMesh = 1 +Trace_CETMeshPrefix = meshfile #AMIR +Trace_CETSubsteps = 50 +Trace_RTCompute = 0 #AMIR +Trace_RTOutFilePrefix = AAA18rt +VelOut_Compute = 0 +VelOut_GenerateMesh = 1 +VelOut_InFile = transient-interpolated.vtk +VelOut_InFileFormat = 1 +VelOut_FilePrefix = transient-interpolated +VelOut_CartMesh.XMin = -3.0 +VelOut_CartMesh.XMax = 6.0 +VelOut_CartMesh.YMin = -1.577 +VelOut_CartMesh.YMax = 1.577 +VelOut_CartMesh.ZMin = 0.0 +VelOut_CartMesh.ZMax = 0.0 +VelOut_CartMesh.XRes = 91 +VelOut_CartMesh.YRes = 32 +VelOut_CartMesh.ZRes = 1 diff --git a/src/config/config.inigenerator.cfg b/src/config/config.inigenerator.cfg index f07efea..0db8782 100644 --- a/src/config/config.inigenerator.cfg +++ b/src/config/config.inigenerator.cfg @@ -1,46 +1,195 @@ [Outputs] -Path_Data = pwd -Path_Output = pwd +################################# flowVC INPUT FILE ##################################### +# +# NOTE: Order of parameters listed must be maintained for proper parsing of input file +# Comment lines begin with #, comments can be added or removed as desired +# Comments cannot occur on lines containing variable declartations +# Standard format: VARIABLE_NAME = VALUE +# +####################################################################################### + +# Path_Data: String, Directory containing data files, e.g. velocity data, etc. +# Can be set to pwd (i.e. present working directory) +Path_Data = ../bin/ + +# Path_Output: String, Directory where output files will be written +# Can be set to pwd (i.e. present working directory) +Path_Output = ../output/ + +# Dimensions: Integer, Specifies if velocity data is 2D or 3D Dimensions = 3 -Data_MeshType = 1 + +# Data_MeshType: Integer, Specifies mesh type of velocity data +# 0: Cartesian +# You will need files Data_InFilePrefix_vel.*.bin and Data_InFilePrefix_Cartesian.bin +# 1: Unstructured (tetrahedral for 3D and triangular for 2D) +# You will need files Data_InFilePrefix_vel.*.bin and Data_InFilePrefix_coordinates.bin, +# Data_InFilePrefix_connectivity.bin and Data_InFilePrefix_adjacency.bin +Data_MeshType = 0 + +# Data_InFilePrefix: String, common prefix for input velocity files (see minimum files needed above) Data_InFilePrefix = dg + +# Data_SuffixTMin: Integer, number appended to the name of first velocity data file +# Assumes naming convention of Data_InFilePrefix_vel.N.bin, where Data_InFilePrefix is +# specified above and N varies from Data_SuffixTMin to (Data_SuffixTMin + Data_SuffixTDelta * Data_SuffixTRes) Data_SuffixTMin = 0 + +# Data_SuffixTDelta: Integer, Increment between successive velocity data files Data_SuffixTDelta = 50 + +# Data_SuffixTRes: Integer, number of velocity data files Data_TRes = 101 + +# Data_TDelta: (Positive) Float, actual time spacing between successive velocity data files +# Assumes time spacing between velocity data files is constant Data_TDelta = 0.05 + +# Data_TMin: Float, actual time assigned to first velocity data file +# Choice is arbitrary, but it usually makes sense to set this to 0.0, which would +# imply that the first velocity data file specifies the velocity at time 0.0 Data_TMin = 0.0 -Data_TPeriodic = 0 + +# Data_TPeriodic: Binary flag, Specifies if data is periodic in time +# 0: Not periodic +# 1: Periodic (make sure first and last data file correspond to same point in cycle) +Data_TPeriodic = 1 + +# Data_XPeriodic: Binary flag, Specifies if data is periodic in space +# 0: Not periodic +# 1: Periodic Data_XPeriodic = 0 + +# Data_MeshBounds.XMin, ..., Data_MeshBounds.ZMax: Specifies bounding box of velocity data +# Setting these bounds LARGER than the actual velocity domain will NOT affect the results +# Setting these bounds SMALLER than the actual velocity domain WILL limit the velocity data considered Data_MeshBounds.XMin = 0.0 Data_MeshBounds.XMax = 1.0 Data_MeshBounds.YMin = 0.0 Data_MeshBounds.YMax = 1.0 Data_MeshBounds.ZMin = 0.0 Data_MeshBounds.ZMax = 1.0 + +# Fluid_Density: Float, specifies fluid density (use consistent units) +# Valid only if Particle_Radius > 0 Fluid_Density = 1.2e-3 + +# Fluid_Viscosity: Float, specifies fluid viscosity (use consistent units) +# Valid only if Particle_Radius > 0 Fluid_Viscosity = 1.81e-4 + +# Output_TStart: Float, initial time to start simulation and begin writing output +# If FTLE_Compute = 1: Specifies time at which first FTLE field is computed AND output +# If Trace_Compute = 1: Specifies start time to begin computing tracer trajectories AND outputting positions to file Output_TStart = 0.0 + +# Output_TRes: (Positive) Integer, Number of output times +# If FTLE_Compute: Specifies number of time instances when the FTLE field will be computed AND output +# If Trace_Compute: Specifies number of time instances that tracer positions will be output to file Output_TRes = 20 -Output_TDelta = 0.05 + +# Output_TDelta: (Positive) Float, Time between successive output +# If FTLE_Compute: How often the FTLE field will be computed AND output +# If Trace_Compute: How often the tracer positions will be output to file +Output_TDelta = 0.05 + +# Int_Type: Integer, specified integration routine used +# 0: Euler +# 1: 4th order Runge Kutta +# 2: Runge Kutta Fehlberg (adaptive time stepping) Int_Type = 1 -Int_TimeStep = 5e-6 # good while doing unsteady simulations + +# Int_TimeStep: (Positive) Float, Time step used for integration Euler or RK4 routines (i.e. Int_Type = 0 or 1) +# Valid only for Int_Type = 0 or 1 +Int_TimeStep = 5e-6 + +# Int_Accuracy: (Positive) Float, Absolute error tolorance (between RK4 and RK5) +# Valid only for Int_Type = 2 Int_Accuracy = 0.0001 + +# Int_MinTimeStep: (Positive) Float, Minimum allowable time step used in RKF routine +# Once this time step is reached, RK4 approximation automatically accepted +# Valid only for Int_Type = 2 Int_MinTimeStep = 0.0001 + +# Int_MaxTimeStep: (Positive) Float, Maximum allowable time step used in RKF routine +# Time step will not be increased beyond this limit even if error between RK4 and RK5 is less than Int_Accuracy +# Valid only for Int_Type = 2 Int_MaxTimeStep = 0.001 + +# Int_TimeDirection: Integer, Should be set to 1 or -1 +# 1: Advect particles forward in time +# -1: Advect particles backward in time (used to compute backward time FTLE field) Int_TimeDirection = 1 + +# Int_NormalFlow: Binary flag +# 0: Do not impose inward flow on no-slip boundaries +# 1: Replace no-slip condition on boundaries with inward velocity (magnitude specified by NormalFlowScaling below) +# Requires the file Data_InFilePrefix_normals.bin generated from program GetNormals.exe +# Currently valid only for Data_MeshType = 1 Int_NormalFlow = 0 + +# Int_NormalFlowScaling: Float, Scaling for inward pointing boundary velocity (to prevent tracers from crossing +# no-slip boundaries), Need to set the number negative if file contains outward normals +# Valid only for Data_MeshType = 1, Int_NormalFlow = 1 Int_NormalFlowScaling = 0.05 + +# Int_Extrapolate: Integer, allows particles to be integrated outside of domain of data by extrapolation of data set +# 0: End integration once particle leaves domain (or subset defined by Data_MeshBounds above). +# Computes FTLE for such points (and neighbors) early. +# 1: Extrapolate velocity outside domain by continuing particle with exit velocity (usually better than below) +# 2: Linear extrapolation of entire data set (NOT recommended unless you know what you're doing) Int_Extrapolate = 0 + +# Particle_Radius: Float, Radius of all things treated as Lagrangian points +# Set to zero if you want points to behave as perfect tracers (recommended unless you know what you're doing) Particle_Radius = 0.0 + +# Particle_Density: Float, Mass density of all things treated as Lagrangian points +# Respectively, set =, >, or < fluid density for neutrally buoyant, aerosols, or bubbles +# Only valid if Particle_Radius > 0 Particle_Density = 1.0 + +# Particle_ICType: Int, Specified type of initial condition assigned to particles +# 0: Start particles from rest +# 1: Start particles with velocity equal to fluid velocity at particle release location (recommended) +# Valid only if Particle_Radius > 0 Particle_ICType = 0 -Gravity_Vector[0] = 0 -Gravity_Vector[1] = 0 + +# Gravity_Vector[i]: Floats, Specifies components of gravity vector (use consistent units) +# Valid only if Particle_Radius > 0 +Gravity_Vector[0] = 0.0 +Gravity_Vector[1] = 0.0 Gravity_Vector[2] = -981 + +# Local_Search_Checking: Binary flag +# 0: Only use local search protocol to determine elements containing initial location of points +# where velocity will need to be interpolated (recommended) +# 1: Use global search to check failures of local search protocol (safest, but can be painfully slow +# if you're not careful) +# Valid only if Data_MeshType = 1 LocalSearchChecking = 1 + +# FTLE_Compute: Binary flag +# 0: Do not compute FTLE fields +# 1: Compute FTLE fields (Trace_Compute MUST be 0) FTLE_Compute = 1 + +# FTLE_GenerateMesh: Binary flag +# 0: Read in FTLE mesh data from file FTLE_ICFile (this file created by running flowVC with FTLE_GenerateMesh = 1) +# 1: Generate a Cartesian mesh over which FTLE will be computed (mesh parameters specified below, resulting data +# saved to file FTLE_ICFile) +# Valid only if FTLE_Compute = 1 FTLE_GenerateMesh = 1 + +# FTLE_ICFile: String, Name of file storing FTLE mesh information +# If FTLE_GenerateMesh = 0, this file should be located in Path_Work directory +# If FTLE_GenerateMesh = 0, this file will be written to Path_Work directory +# Valid only if FTLE_Compute = 1 FTLE_ICFile = FTLE_mesh.bin + +# FTLE_MeshBounds.XMin, ..., FTLE_MeshBounds.ZRes: Specifies structured grid over which FTLE is computed +# Valid only if FTLE_Compute = 1 FTLE_MeshBounds.XMin = 0.0 FTLE_MeshBounds.XMax = 2.0 FTLE_MeshBounds.YMin = 0.0 @@ -50,50 +199,148 @@ FTLE_MeshBounds.ZMax = 1.0 FTLE_MeshBounds.XRes = 201 FTLE_MeshBounds.YRes = 101 FTLE_MeshBounds.ZRes = 101 + +# FTLE_IntTLength: (Positive) Float, Integration time used to compute FTLE +# Valid only if FTLE_Compute = 1 FTLE_IntTLength = 1.0 + +# FTLE_ComputeVariation: Binary flag, Used to help determine appropriate integration time by ah hoc means +# 0: Compute FTLE at each output time with integration time set to FTLE_IntTimeLength (nominally, can be reduced when a tracer leaves early) +# 1: Compute variation of FTLE with integration time +# Output_TRes MUST be 1 if FTLE_ComputeVariation = 1 +# Valid only if FTLE_Compute = 1 FTLE_ComputeVariation = 0 + +# FTLE_VariationOutFreq: (Positive) Integer, controls how often FTLE is output when computing variation of FTLE with +# integration time +# If set to 1, output is generated at every time instance that velocity data is defined, if set to, e.g., 5, then output +# is generated at 1/5 of that rate (i.e. every 5 velocity data frames) +# Valid only if FTLE_ComputeVariation = 1 FTLE_VariationOutFreq = 1 + +# FTLE_OutFilePrefix: String, Filename prefix where FTLE output data is written +# A separate file is generated for each output time (e.g. dg_forFTLE.0.bin, ..., dg_forFTLE.10.bin if Output_TRes = 11) +# NOTE: Two types of output files are generated, one set with the 1/T scaling in the definition of FTLE (*_noT.bin files), and ones with the scaling +# Valid only if FTLE_Compute = 1 FTLE_OutFilePrefix = FTLE_medium_bwd + + +# Trace_Compute: Binary flag +# 0: Do not compute tracer trajectories +# 1: Compute tracer trajectories (FTLE_Compute MUST be 0) Trace_Compute = 0 + Trace_ReleaseStrategy = 0 Trace_ReleaseTMax = 0.000755 -Trace_GenerateMesh = 0 -Trace_InFile = trachea_1.vtk + + +# Trace_GenerateMesh: Binary Flag +# 0: Read in tracer initial positions from a file (specified by Trace_InFile) +# 1: Generate a Cartesian grid of tracers to integrate (mesh parameters specified below) +# Valid only if Trace_Compute = 1 +Trace_GenerateMesh = 1 + +# Trace_InFile: String, Name of File containing tracer initial positions +# Valid only if Trace_Compute = 1 and Trace_GenerateMesh = 0 +Trace_InFile = tracer_grid.bin + +# Trace_MultipleInFiles: Binary Flag +# 0: Default +# 1: Tracer initial conditions change over time and are specified by multiple files Trace_MultipleInFiles = 0 + +# Trace_InFileFormat: Integer, specifies format of Trace_InFile +# 0: Use this if you want to reuse the .IC file that is generated from flowVC (use with care) +# 1: ASCII file, first line lists the number of tracers and subsequent lines list the x,y,z coordinates +# 2: ASCII legacy VTK polydata mesh format +# 3: ASCII legacy VTK unstructured mesh format +# 4: Binary file, first entry (int) lists the number of tracers and subsequent entries (doubles) list the x,y,z coordinates (binary version of format 1) +# Valid only if Compute_Tracers = 1 and Trace_GenerateMesh = 0 Trace_InFileFormat = 4 -Trace_OutFilePrefix = trachea_1_5e-5 + +# Trace_OutFile: String, Prefix for files where tracer position data will be written +# Tracer positions written to separate files for each output time +# Valid only if Trace_Compute = 1 +Trace_OutFilePrefix = dg_tracer-positions + +# Trace_NumLaunchTimes: (Positive) Integer, Number of times to release tracers from initial positions +# If Trace_MultipleInFiles = 1, then this should be number of files +# Valid only if Trace_Compute = 1 Trace_NumLaunchTimes = 1 -Trace_LaunchTimeSpacing = 0.02 -Trace_IntTLength = 1000 -Trace_AlwaysOutput = 1 -Trace_CartMesh.XMin = -1.9 -Trace_CartMesh.XMax = .43 -Trace_CartMesh.YMin = -11.3 -Trace_CartMesh.YMax = -9.7 -Trace_CartMesh.ZMin = 26.1 -Trace_CartMesh.ZMax = 26.3 -Trace_CartMesh.XRes = 200 -Trace_CartMesh.YRes = 200 -Trace_CartMesh.ZRes = 4 -Trace_VorticityCompute = 0 -Trace_APCompute = 0 -Trace_CETCompute = 0 -Trace_CETAuxillaryMesh = 1 -Trace_CETMeshPrefix = meshfile #AMIR -Trace_CETSubsteps = 50 -Trace_RTCompute = 0 #AMIR -Trace_RTOutFilePrefix = AAA18rt + +# Trace_LaunchTimeSpacing: (Positive) Float, Time between successive release of tracers from initial positions +# Valid only if Trace_Compute = 1 and Trace_NumLaunchTimes > 1 +Trace_LaunchTimeSpacing = 0.1 + +# Trace_IntTLength: (Positive) Float, Can be used to limit amount of time any tracer will be integrated +# Recommended to set this to some value larger than (Output_TRes x Output_TDelta) unless you know what you're doing +# Valid only if Trace_Compute = 1 and Trace_ReleaseStrategy = 0 +Trace_IntTLength = 100 + +# Trace_AlwaysOutput: Binary Flag +# 0: Do not write out tracer position to file once it has left the domain +# 1: Always write out tracer position to file, even if it left the domain +# Valid only if Trace_Compute = 1 +Trace_AlwaysOutput = 0 + +# Trace_CartMesh.XMin, ..., Trace_CartMesh.ZRes: Specifies Cartesian mesh of tracers to be intergrated +# Valid only if Trace_Compute = 1 AND Trace_GenerateMesh = 1 +Trace_CartMesh.XMin = 0.0 +Trace_CartMesh.XMax = 2.0 +Trace_CartMesh.YMin = 0.0 +Trace_CartMesh.YMax = 0.1 +Trace_CartMesh.ZMin = 0.0 +Trace_CartMesh.ZMax = 0.0 +Trace_CartMesh.XRes = 201 +Trace_CartMesh.YRes = 101 +Trace_CartMesh.ZRes = 1 + +# TODO Fill in this documentation +# These are required but their functionality is not +Trace_VorticityCompute = 0 +Trace_APCompute = 0 +Trace_CETCompute = 0 +Trace_CETAuxillaryMesh = 0 +Trace_CETMeshPrefix = specified +Trace_CETSubsteps = 0 +Trace_RTCompute = 0 +Trace_RTOutFilePrefix = dg_tracer-rt + +# VelOut_Compute: Binary flag, Used to generate interpolated velocity fields +# 0: Do not generate interpolated velocity fields +# 1: Generate interploated velocity fields VelOut_Compute = 0 + +# VelOut_GenerateMesh: Binary flag +# 0: Read interpolation locations from file specified by VelOut_InFile +# 1: Generate a Cartesian mesh of positions where velocity will be interpolated (mesh parameters specified below) +# Valid only for VelOut_Compute = 1 VelOut_GenerateMesh = 1 -VelOut_InFile = transient-interpolated.vtk + +# VelOut_InFile: String, filename containing locations of points for interpolation +# Valid only for VelOut_Compute = 1 and VelOut_GenerateMesh = 0 +VelOut_InFile = interpolation-positions.vtk + +# VelOut_InFileFormat, Integer, specified format of VelOut_InFile +# 1: ASCII file, first line lists the number of locations and subsequent lines list the coordinates +# 3: ASCII legacy VTK polydata mesh format (as output from Paraview) +# 4: ASCII legacy VTK unstructured mesh format (as output from Paraview) +# Valid only if VelOut_Compute = 1 AND VelOut_GenerateMesh = 0 VelOut_InFileFormat = 1 -VelOut_FilePrefix = transient-interpolated -VelOut_CartMesh.XMin = -3.0 -VelOut_CartMesh.XMax = 6.0 -VelOut_CartMesh.YMin = -1.577 -VelOut_CartMesh.YMax = 1.577 + +# VelOut_FilePrefix: String, Filename prefix for files that interpolated velocity is data is written to +# Velocity output written to separate files, one per output time +# Valid only if VelOut_Compute = 1 +VelOut_FilePrefix = dg-interpolated + +# VelOut_CartMesh.XMin, ..., VelOut_CartMesh.ZRes: Specifies Cartesian mesh of interpolation positions +# Valid only if VelOut_Compute = 1 +VelOut_CartMesh.XMin = 0.0 +VelOut_CartMesh.XMax = 2.0 +VelOut_CartMesh.YMin = 0.0 +VelOut_CartMesh.YMax = 1.0 VelOut_CartMesh.ZMin = 0.0 VelOut_CartMesh.ZMax = 0.0 -VelOut_CartMesh.XRes = 91 -VelOut_CartMesh.YRes = 32 +VelOut_CartMesh.XRes = 21 +VelOut_CartMesh.YRes = 11 VelOut_CartMesh.ZRes = 1