LogoLogo
  • 1. GASFLOW Code
    • 1.1. Overview
    • 1.2. Code Approach
    • 1.3. Code Features
    • 1.4. Graphical User Interface
    • 1.5. Code V&V
    • 1.6. Application Highlights
    • 1.7. Publications
    • 1.8. Current Activities
  • 2. Tutorials
    • 2.1. Overview
    • 2.2. Sod's Shock Tube Problem
    • 2.3. Mesh Generation from CAD Models
    • 2.4. 2D Lid-driven Cavity Flow
    • 2.5. Hydrogen Diffusion into Air in a 1D Duct
    • 2.6. Supersonic Flow over a Forward-facing Step
    • 2.7. Vented Explosion of Premixed Hydrogen-Air Mixtures
    • 2.8. Transient Laminar Jet Flow at Low Mach Number Regime
  • 3. Brief User Guide
    • 3.1. Overview
    • 3.2. General User Guidance
    • 3.3. Unit System and Files
    • 3.4. Mesh Generation
    • 3.5. Geometry Definition
    • 3.6. Numerical Control
    • 3.7. Gas Species and Properties
    • 3.8. Initial and Boundary Conditions
    • 3.9. Solid Heat Structures
    • 3.10. Physical Models
    • 3.11. Restart and Output
    • 3.12. GASFLOW Parallelization
  • 4. Pre- and Post-Processing Tools
    • 4.1. GASVIEW
    • 4.2. Pyscan
    • 4.3. Create3D
  • 5. Verification and Validation
    • 5.1.Overview
    • 5.2. Fluid Dynamics
      • [AS-FD 1] Steady-State and Laminar Flow Startup
      • [AS-FD 2] Transient Compressible Flow
      • [AS-FD 3] Diffusion of Hydrogen into Air
      • [AS-FD 4] Flow past a Rectangular Block
      • [AS-FD 5] 1D Flow with an Orifice
      • [ED-FD 1] Incompressible Laminar Flow in a Lid-driven Cavity
      • [ED-FD 2] Stationary Turbulent Channel Flow
      • [ED-FD 3] Turbulent Flow between Two Parallel Plates
      • [ED-FD 4] Flow over Backward-Facing Step
      • [ED-FD 5] Transient Supersonic Flow at Mach 3 over a Forward-facing Step
      • [ED-FD 6] Large Eddy Simulations of the Turbulent Jet Flow
      • [ED-FD-7] Hydrogen Turbulent Dispersion in Nuclear Containment Compartment
      • [ED-FD 8] Buoyant Jet from Unintended Hydrogen Release
      • [ED-FD 9] Radiolytic Gas Accumulation in a Pipe
      • [ED-FD 10] Supersonic Flow at Mach 2 over a Backward Facing Step
    • 5.3. Combustion
      • [ED-CM 1] BOM Spherical Combustion Chamber
      • [ED-CM 2] SNL Flame Acceleration Measurement Facility Experiment
      • [ED-CM 3] Hydrogen Deflagration in a Multi-compartment System
      • [ED-CM 4] Hydrogen Jet Fire in a Compartment with Venting Hole
      • [ED-CM 5] Hydrogen-Air Fast Deflagration in ENACCEF Facility
      • [ED-CM 6] Detonation of Premixed H2-Air Mixture in a Hemispherical Balloon
      • [ED-CM 7] H2 Deflagration at a Refueling Station
      • [ED-CM 8] Methane-Air Explosion in LLEM
      • [ED-CM 9] Hydrogen-Methane Combution in a 20 L Spherical Vessel
    • 5.4. Heat and Mass Transfer
      • [AS-HT 1] Steady-State Heat Transfer through a Wall
      • [AS-HT 2] Pressure-Volume Work Term 1: Equilibrium Case
      • [AS-HT 3] Thermodynamic Benchmarks
      • [AS-HT 4] Uniform Energy Addition to Stagnant Fluid
      • [ED-HT 1] Natural Convection in an Air-filled Square Cavity
      • [ED-HT 2] Validation of the condensation model with COPAIN facility
      • [ED-HT 3] Heat and mass transfer of a thin film model in a channel
      • [ED-HT 4] Validation of the Film Model in the Integral Test Facility for Passive Containment Cooling
      • [ED-HT 5] Stratification Erosion Benchmark
      • [ED-HT 6] Battelle Containment HYJET Test JX7
      • [ED-HT 7] Battelle GX Tests
      • [ED-HT 8] Tests in ThAI Facility
      • [ED-HT 9] HDR Tests
      • [ED-HT 10] Phebus Thermal Hydraulic Tests
      • [ED-HT 11] Test Tosqan ISP47
      • [ED-HT 12] Test MISTRA ISP47
      • [ED-HT 13] Panda SETH Test Program
    • 5.5. Multiphase Flow
      • [AS-MP 1] Particle Terminal Velocity
      • [AS-MP 2] Water droplet evaporation
      • [ED-MP 1] Spray Single Droplet Test
      • [ED-MP 2] Spray Droplets Test 113 at IRSN TOSQAN
      • [ED-MP 3] Spray Droplets Test 101 at IRSN TOSQAN
  • 6. APPLICATION HIGHLIGHTS
    • 6.1. H2 Fuel Cell Vehicle Accident in Tunnel
    • 6.2. Hydrogen Explosion in a Refueling Station
    • 6.3. Hydrogen Explosion at Fukushima Accident
    • 6.4. Methane Explosion in the Roadway of a Coal Mine
    • 6.5. Aerosols and Droplets
      • 6.5.1. Coronavirus Aerosol Transmission
      • 6.5.2. Water Droplets
  • 7. Ongoing Development and Enhancements
    • 7.1. Combustion Modeling
      • 7.1.1. Multi-step Global Methane Combustion Models
        • 7.1.1.1. One-step Reaction Mechanism
        • 7.1.1.2. Two-step Reaction Mechanism
        • 7.1.1.3. Three-step Reaction Mechanism
        • 7.1.1.4. Four-step Reaction Mechanism
        • 7.1.1.5. Five-step Reaction Mechanism
        • 7.1.1.6. FAQ
      • 7.1.2. Laminar Flame Speed Correlations for Methane-air Mixtures
        • 7.1.2.1. Stone's Correlation
        • 7.1.2.2. Elia's Correlation
        • 7.1.2.3. Takizawa's Correlation
        • 7.1.2.4. Liao's Correlation
      • 7.1.3. Turbulent Flame Speed Correlations for Methane-air Mixtures
      • 7.1.4. Correction of Effective Turbulent Burning Velocity for Lean Hydrogen-air Mixtures
      • 7.1.5. Induction Time Model
      • 7.1.6. Detailed Chemical Kinetic Modeling
      • 7.1.7. Jet Flame Modeling
    • 7.2. Discrete Particle Modeling
      • 7.2.1. Particle mass in user-defined volumes - volpardef
      • 7.2.2. Particle injection from ring shaped volumes
    • 7.3. Heat Transfer Modeling
      • 7.3.1. Time-dependent tables for heat flux and heat transfer coefficient in sinkdef
      • 7.3.2. Thermal Radiation Model for Water Vapor and Carbon Dioxide
  • 8. INPUT FILE EXAMPLES
    • 8.1. Overview
    • 8.1. Fluid Dynamics
  • 8.2. Combustion
  • 8.3. Heat Transfer
  • 8.4. Multiphase Flow
  • 8.5. Applications
  • 9. Frequently Asked Questions
    • 9.1. How to set up models for the flashing of pressurized water?
  • 9.2. How to run GASFLOW on Windows?
  • 9.3. How to export/import WSL distribution?
Powered by GitBook
On this page
  • 3.6.1. General Setting
  • 3.6.1. Pressure Iteration
  • 3.6.2. Time-Step Control
  • 3.6.3. Advection Scheme
  • 3.6.4. Control of Time Interval Variables

Was this helpful?

  1. 3. Brief User Guide

3.6. Numerical Control

Previous3.5. Geometry DefinitionNext3.7. Gas Species and Properties

Last updated 2 years ago

Was this helpful?

3.6.1. General Setting

Function: Defining the physical problem time limit, computational time limit and maximum number of cycles.

3.6.1. Pressure Iteration

Function: Defining parameters for controlling the iteration of the pressure Elliptic equation.

The numerical algorithm used in GASFLOW-MPI for solving the coupled fluid mass, momentum, and energy equations includes an implicit pressure iteration phase, which enables the code to simulate compressible flows without the computational time step being limited by the speed of sound. The implicit, iterative calculation is the solution of matrix equations arising from discretization of Poisson-type pressure equations by the linear solvers in PETSc library. The algorithm is constructed such that the true solution is obtained after a finite number of iterations. We have to specify certain error acceptance criteria to terminate the iteration procedure and move on to the next calculation phase.

Note that the matrix solution has to be performed at each time cycle, so it is important to keep the iteration numbers reasonably low for complex, long transient problems.

The accuracy of an iterative solution is indicated by a residual vector r, which would be zero if the solution is exact. In GASFLOW-MPI, the iteration will stop if all the components in r are less than a specified error value.

The code provides the following input variable in NAMELIST group xput:

epsi0 Initial value of ε. Default =1e-5.

the user can specify the maximum number of iterations after which the iteration stops and the calculation continues, regardless of whether the current matrix solution satisfies the convergence criterion. This is done via the following variable in NAMELIST group xput:

itmax Maximum number of iterations (per time cycle) allowed. Default = 1000.

The code prints out iteration and time-step information for each time cycle to a file called cyclinfo.

Where PITER is the number of pressure iterations that have been carried out. DMAX is the largest component in the residual vector r.

3.6.2. Time-Step Control

Function: Defining parameters for controlling the time step during the calculation. Because GASFLOW-MPI solves the time-dependent conservation equations, a calculation proceeds in finite time steps (also called cycles) until the problem end time or the specified maximum number of cycles has been reached.

The end time and maximum number of cycles are defined by the following input variables (all variables discussed in this section are in NAMELIST group xput):

twfin Time (s) at which the problem is finished. Default = 10.

maxcyc Maximum allowable number of cycles. Default = 10.

How fast a problem can be completed depends on the time-step size Δt chosen. The initial, minimum, and maximum values of Δt to be used are defined with the following input variables:

delt0 Beginning time step size (s). Default = 0.02.

deltmin Minimum time step size (s). Default = 1e–4.

deltmax Maximum time step size (s). Default = 1e30.

cflnum Maximum CFL number for convection

cfldiff Maximum CFL number for diffusion

autot=0 Fixed time steps

autot=1 Automatic Control

itdowdt Increase time step size at lower iterations

itupdt Decrease time step size at upper iterations

The maximum and minimum values are used to define a range within which Δt can be varied during the calculation.

An example is shown here for the maximum time step, deltmax, as it is read in the NAMELIST XPUT:

For this example, the maximum time step is held constant at 0.5 s for (0 <= time < 10000), 0.6 s for (0 <= time < 20000), and so on.

Note that we’ve added a small amount of time, 0.1 seconds, to all the even entries in deltmax. This insures that the maximum time step allowed is updated at the requested time.

The numerical method used in GASFLOW-MPI treats most physical processes implicitly in time, except the advection and diffusion terms. Explicit treatment of these terms leads to the fact that the solution procedure is only stable if the time-step size Δt satisfies both the Courant criterion and the diffusion limit. To ensure numerical stability, the code limits Δt as follows:

In GASFLOW-MPI, we have the option for users to define the maximum CFL number using cflnum and cfldiff for Courant and diffusion limit. The default values of cflnum and cfldiff are 0.25 which is also used in GASFLOW serial version. The user could increase cflnum and cfldiff (< 0.99) to allow a bigger time step.

The change of internal energy in each cell in one time step should not exceed the limit, relde. The default of relde is 0.2 meaning 20% of the internal energy in each cell is allowed to change in one time step.

GASFLOW by default will try to adjust Δt to achieve maximum efficiency while satisfying the stability limits. The code increases or decreases Δt for the next computational cycle according to the number of pressure iterations required for convergence in the current cycle.

If the user wants a fixed time-step size, the following input variable should be specified:

autot Option flag for automatic control of time-step size Δt

  • 1.0 means Δt is adjusted by code during calculation (default);

  • 0.0 means the input delt0 is used for Δt thoughout calculation.

3.6.3. Advection Scheme

Function: Options for discretize the convective flux term in each conservation equations ∇(ϕ•u), where ϕ is the conserved quantity (mass density, internal energy, or momentum) and u is the velocity vector.

There are two numerical method:

  • Donor-cell scheme (default): first-order method, simple and fast and does not suffer from the spurious oscillations caused by some higher-order scheme. But, the solution obtained has larger numerical diffusion error then those given by higher-order scheme.

  • Van Leer scheme: second order method, slope-limiting method that has the monotone property.

This can be done via the following input variable in NAMELIST group xput ifvl.

3.6.4. Control of Time Interval Variables

There are certain input array variables that provide time-dependent control of the maximum time step, deltmax, the maximum CFL number, cflnum, the plotting time, pltdt, the printing time, prtdt, the restart dump and 3D visualization time, tddt, and the plotting time history time, thdt. These variables have been extended to arrays with maximum number of elements equaling 20, and are shown here:

deltmax(1:20) maximum allowed time step (NAMELIST xput).

cflnum(1:20) maximum allowed CFL number (NAMELIST xput).

pltdt(1:20) plotting time interval to file profiles.nc (NAMELIST xput).

prtdt(1:20) printing time interval to file gfout (NAMELIST xput).

tddt(1:20) restart dump and 3D visualization time interval to file gfd*.nc (NAMELIST xput).

thdt(1:20) time-history plotting time interval to file plothist.nc (NAMELIST grafic).

When there is only one entry in the above variable arrays, it is treated as a scalar constant, but when there are multiple entries, they are associated in pairs with the odd elements representing the time interval or time step and the even elements representing the upper time limit for that particular time interval or time step.

If the current time exceeds the last time specified in the array deltmax, the last maximum time step size will be held for the remaining simulation time up to twfin. This holds true for all the other variables list above as well.

Example.

How many dumps will be generated up to 50 seconds? 3 up to 2 seconds (at~0.5 s, ~1.0 s, ~1.5 s) and 4 up to 50(at ~11.5 s, ~21.5 s, ~31.5 s, 41.5 s). Why only three up to 2 s? Because the first output is done at time≥0.5 s. The time step will rarely hit 0.5 seconds exactly. Therefore the first input is somewhat delayed. At times> 2 s, the new interval(10 seconds) is already active.

If the user wants a restart dump at approximately 0.5, 1.0, 1.5, 2,0, 12,0, 22.0, 32.0, and 42.0 s, then the easiest way would be to add a small amount to the interval. In the above case, one could use:

and this would insure that the interval 2.0 is reached before the increment is updated.

Example.

pltdt and prtdt can be controlled in a similar fashion.