Difference between revisions of "HPC Adaptive Timestepping"
Chris Huxley (talk | contribs) (Created page with "The HPC solver, by default, uses adaptive timestepping to progress through the simulation. The timestep is adjusted so that it complies with the mathematical stability criteri...") |
Chris Huxley (talk | contribs) |
||
(28 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | =Introduction= | |
− | + | The HPC solver, by default, uses adaptive timestepping to progress through the simulation. The timestep is adjusted so that it complies with the mathematical stability criteria of a 2D SWE explicit solution. In contrast, TUFLOW Classic, being an implicit solution, is not numerically bound by these criteria, and can progress through the simulation using a fixed timestep. Due to the underlying solution scheme, HPC typically uses a smaller timestep than Classic. the following sections outline how TUFLOW HPC automatically selects its adaptive timestep. | |
− | |||
− | |||
− | + | =HPC 2D Timestep= | |
+ | TUFLOW HPC uses adaptive timestepping to maintain stability. There are three primary processes that determine the maximum timestep that an explicit solution to the Shallow Water Equations can use: | ||
+ | * Courant Number, Nu <br> | ||
+ | * Wave Celerity Number, Nc <br> | ||
+ | * Diffusion Number, Nd <br> | ||
{|class="wikitable" style="text-align: center;" | {|class="wikitable" style="text-align: center;" | ||
− | !colspan="4" style="background-color:#005581; height:50px; font-weight:bold; color:white;"| | + | !colspan="4" style="background-color:#005581; height:50px; font-weight:bold; color:white;"|HPC 2D Adaptive Timestep Controlling Numbers |
|- | |- | ||
|style="width: 11%; height:50px;" | <b>Control Number</b>||style="width: 40%;" | <b>Description</b>||style="width: 18%;" | <b>Expression</b>||style="width: 9%;" | <b>Control Number Limit</b> | |style="width: 11%; height:50px;" | <b>Control Number</b>||style="width: 40%;" | <b>Description</b>||style="width: 18%;" | <b>Expression</b>||style="width: 9%;" | <b>Control Number Limit</b> | ||
Line 23: | Line 25: | ||
|- | |- | ||
|style="height:80px;" | Diffusion Number (Nd) | |style="height:80px;" | Diffusion Number (Nd) | ||
− | |This numerical condition relates to the sub-grid scale eddy viscosity term which causes diffusion of momentum. To maintain stability the product of the eddy viscosity coefficient (ν_T) and the timestep (∆𝑡) divided by the square of the grid spacing (∆𝑥2) must remain below 0.3. | + | |This numerical condition relates to the sub-grid scale eddy viscosity term which causes diffusion of momentum. To maintain stability the product of the eddy viscosity coefficient (ν_T) and the timestep (∆𝑡) divided by the square of the grid spacing (∆𝑥2) must remain below 0.3. Models controlled by the diffusion number tend to require a timestep significantly smaller than those controlled by the shallow wave celerity or courant numbers. If you find your model is predominantly diffusion controlled it may be that equivalent solution accuracy can be achieved by selecting a larger cell size. This is worth testing, as it will most likely increase the simulation speed with no loss of result fidelity. |
|[[FILE: Diffusion Number Equation.PNG |250px]] | |[[FILE: Diffusion Number Equation.PNG |250px]] | ||
|<0.3 | |<0.3 | ||
|} | |} | ||
− | The explicit solution scheme | + | In general terms: |
+ | * Courant number relates to velocity relative to the cell size. High velocities will trigger this as the control. | ||
+ | * Celerity Control number relates to water depth relative to cell size. Energy can pass through deeper water faster than shallow water, as such deep water will trigger this control. | ||
+ | * Diffusion control relates diffusion of momentum relating to the sub grid viscosity. Small cells in deep water will trigger this one. | ||
+ | TUFLOW will use the highest timestep possible without exceeding the limits associated with each of the control numbers.<br> | ||
+ | The method TUFLOW HPC uses to calculate a timestep and achieve unconditional stability is as follows: | ||
+ | * The <font color="blue"><tt>Timestep </tt></font> command included in the TUFLOW Control File (TCF) is only used for the first calculation timestep. The specified value should be consistent with what would be appropriate for a TUFLOW Classic model (i.e. 1/2 to 1/5 the 2D cell size). Internally, TUFLOW HPC divides this value by 10 to apply a value that is suitable for an explicit solution scheme. All subsequent calculations are completed using the adaptive timestep approach outlined in the following bullet points. | ||
+ | * The HPC timestep is calculated using the hydraulic conditions from the end of the previous timestep. | ||
+ | * If the hydraulic conditions have changed significantly it is possible for one or more of the Nu, Nc, Nd control number criteria to be violated at one or more locations within the model. For example, a sudden change in rainfall from one timestep to the next (which occurs with stepped rainfall boundaries) would potentially cause a violation. The HPC solver, by default, treats a 20% exceedance of a control number as a violation and will implement a repeat timestep feature. HPC uses a repeat timestep feature to maintain unconditional stability. The repeat timestep feature involves retaining the complete hydraulic solution from the previous (good) timestep. Should a control number anywhere within the model be exceeded by more than 20%, the solution reverts to the retained timestep, the timestep is reduced and then repeated. | ||
+ | * Each timestep is also tested for the occurrence of NaNs. A NaN is “Not a Number” and occurs due to undefined mathematical calculations such as a divide by zero or square root of a negative number. The occurrence of a NaN is also indicative of a sudden instability. Should a NaN occur, the repeat timestep feature is implemented.<br> | ||
+ | * Should a timestep need to be repeated more than ten times consecutively, the solution stops. | ||
+ | * The simulation will also stop if the default minimum permissible timestep of 0.1 seconds has been reached. This value can be manually adjusted using <font color="blue"><tt>Timestep Minimum</tt></font>. <br> | ||
+ | Repeated timesteps are displayed to the Console Window and the number of them for a time interval are provided in the nRS_NaNs and nRS_HCNs columns in the _HPC.csv file output in the results folder. They are also reported to the _messages layer.<br> | ||
+ | Repeated timesteps are an indication the 2D HPC solution is numerically “on-the-edge”. Models that have a high number of repeated timesteps should be sensitivity tested by reducing the control number limits using <font color="blue"><tt>Control Number Factor</tt></font>. For example, repeat the simulation using <font color="blue"><tt>Control Number Factor</tt></font><font color="red"><tt>==</tt></font><tt> 0.8 </tt> and compare the results. If there are acceptably immeasurable changes in the results, then running at the default control number limits can be considered satisfactory. | ||
+ | |||
+ | ''NOTE: Models that require an excessively small 2D timestep to remain stable are symptomatic of models with input topography or boundary condition errors. Please refer to [Tutorial_Module03 | Tutorial Module 03] for discussion on this topic.'' | ||
+ | |||
+ | =HPC 1D Timestep= | ||
+ | HPC links with the 1D solver, ESTRY. When run with HPC (instead of Classic) ESTRY has been reconfigured to automatically act as an adaptive/varying timestep solution, and can step at different multiples of steps to the HPC 2D solver. The ESTRY 1D <font color="blue"><tt>Timestep </tt></font> command for a HPC 1D/2D linked model is the maximum limiting timestep the 1D solver can use, and the 1D and 2D solutions are synchronised based on the size of the "maximum 1D timestep" and the "target 2D timestep": | ||
+ | * If target 2D timestep = maximum 1D timestep: No adjustment is made. | ||
+ | * If target 2D timestep > maximum 1D timestep: the 1D proceeds in two or more steps eventually synchronising with the target 2D timestep. | ||
+ | * If target 2D timestep < Maximum 1D timestep: the 2D timestep is reduced below the target value to synchronise with 1D at a multiple of the 2D timesteps. | ||
+ | Where there is not a one to one synchronisation of the 1D and 2D timesteps, a usually negligible mass error may occur and can be checked by reviewing the CME% values shown on the Console Window, the .tlf file or the _MB.csv file in the same manner as Classic. | ||
+ | <br> | ||
+ | [[File:1d2ddt.png|800px]] | ||
+ | |||
+ | =HPC Timestep Synchronisation= | ||
+ | HPC uses an adaptive timestep derived from the hydraulic conditions during a simulation. This timestepping approach creates a situation where the computational timestep does not always align exactly with the specified map and time series result output intervals. To account for this TUFLOW HPC makes a timestep adjustments to synchronize the computational timestep with output reporting times. When this occurs the minimum timestep (dt) reported in hpc.dt.csv will report a reduced timestep. This adjustment doesn’t have any effect on the hydraulic calculations, and as such, is not reported in the hpc.tlf or shown in the dt map output. The "dtStar" column in the hpc.dt.csv file also reports the calculated 2D target timestep without any result output synchronisation applied. If the hpc.dt.csv file is being used to quality check the health of a simulation, "dtStar" should be used for the analysis, not "dt".<br> | ||
+ | <br> | ||
+ | [[File:dt_sync.png|500px]]<br> | ||
+ | <br> | ||
+ | |||
+ | =HPC Quadtree Adaptive Timestepping= | ||
+ | All the above is applicable to the HPC with Quadtree simulations. In addition the Quadtree solver uses a single adaptive timestep for the entire model at any instance in time. Different timesteps are not applied to the respective different resolution nest levels. If a small cell resolution is nested down in water that is deeper than the cell face length, the Diffusion control number would be the critical limiter that is setting the timestep and the model will run slower than expected. This can be confirmed by reviewing the <u>[[HPC_Model_Review#HPC_dt_Time_Series_Output_.28.2A.hpc.dt.csv.29 | hpc.dt.csv file]]</u> information.<br> | ||
+ | <br> | ||
+ | {{Tips Navigation | ||
+ | |uplink=[[ HPC_Modelling_Guidance | Back to HPC Modelling Guidance]] | ||
+ | }} |
Latest revision as of 15:31, 30 May 2022
Introduction
The HPC solver, by default, uses adaptive timestepping to progress through the simulation. The timestep is adjusted so that it complies with the mathematical stability criteria of a 2D SWE explicit solution. In contrast, TUFLOW Classic, being an implicit solution, is not numerically bound by these criteria, and can progress through the simulation using a fixed timestep. Due to the underlying solution scheme, HPC typically uses a smaller timestep than Classic. the following sections outline how TUFLOW HPC automatically selects its adaptive timestep.
HPC 2D Timestep
TUFLOW HPC uses adaptive timestepping to maintain stability. There are three primary processes that determine the maximum timestep that an explicit solution to the Shallow Water Equations can use:
- Courant Number, Nu
- Wave Celerity Number, Nc
- Diffusion Number, Nd
In general terms:
- Courant number relates to velocity relative to the cell size. High velocities will trigger this as the control.
- Celerity Control number relates to water depth relative to cell size. Energy can pass through deeper water faster than shallow water, as such deep water will trigger this control.
- Diffusion control relates diffusion of momentum relating to the sub grid viscosity. Small cells in deep water will trigger this one.
TUFLOW will use the highest timestep possible without exceeding the limits associated with each of the control numbers.
The method TUFLOW HPC uses to calculate a timestep and achieve unconditional stability is as follows:
- The Timestep command included in the TUFLOW Control File (TCF) is only used for the first calculation timestep. The specified value should be consistent with what would be appropriate for a TUFLOW Classic model (i.e. 1/2 to 1/5 the 2D cell size). Internally, TUFLOW HPC divides this value by 10 to apply a value that is suitable for an explicit solution scheme. All subsequent calculations are completed using the adaptive timestep approach outlined in the following bullet points.
- The HPC timestep is calculated using the hydraulic conditions from the end of the previous timestep.
- If the hydraulic conditions have changed significantly it is possible for one or more of the Nu, Nc, Nd control number criteria to be violated at one or more locations within the model. For example, a sudden change in rainfall from one timestep to the next (which occurs with stepped rainfall boundaries) would potentially cause a violation. The HPC solver, by default, treats a 20% exceedance of a control number as a violation and will implement a repeat timestep feature. HPC uses a repeat timestep feature to maintain unconditional stability. The repeat timestep feature involves retaining the complete hydraulic solution from the previous (good) timestep. Should a control number anywhere within the model be exceeded by more than 20%, the solution reverts to the retained timestep, the timestep is reduced and then repeated.
- Each timestep is also tested for the occurrence of NaNs. A NaN is “Not a Number” and occurs due to undefined mathematical calculations such as a divide by zero or square root of a negative number. The occurrence of a NaN is also indicative of a sudden instability. Should a NaN occur, the repeat timestep feature is implemented.
- Should a timestep need to be repeated more than ten times consecutively, the solution stops.
- The simulation will also stop if the default minimum permissible timestep of 0.1 seconds has been reached. This value can be manually adjusted using Timestep Minimum.
Repeated timesteps are displayed to the Console Window and the number of them for a time interval are provided in the nRS_NaNs and nRS_HCNs columns in the _HPC.csv file output in the results folder. They are also reported to the _messages layer.
Repeated timesteps are an indication the 2D HPC solution is numerically “on-the-edge”. Models that have a high number of repeated timesteps should be sensitivity tested by reducing the control number limits using Control Number Factor. For example, repeat the simulation using Control Number Factor== 0.8 and compare the results. If there are acceptably immeasurable changes in the results, then running at the default control number limits can be considered satisfactory.
NOTE: Models that require an excessively small 2D timestep to remain stable are symptomatic of models with input topography or boundary condition errors. Please refer to [Tutorial_Module03 | Tutorial Module 03] for discussion on this topic.
HPC 1D Timestep
HPC links with the 1D solver, ESTRY. When run with HPC (instead of Classic) ESTRY has been reconfigured to automatically act as an adaptive/varying timestep solution, and can step at different multiples of steps to the HPC 2D solver. The ESTRY 1D Timestep command for a HPC 1D/2D linked model is the maximum limiting timestep the 1D solver can use, and the 1D and 2D solutions are synchronised based on the size of the "maximum 1D timestep" and the "target 2D timestep":
- If target 2D timestep = maximum 1D timestep: No adjustment is made.
- If target 2D timestep > maximum 1D timestep: the 1D proceeds in two or more steps eventually synchronising with the target 2D timestep.
- If target 2D timestep < Maximum 1D timestep: the 2D timestep is reduced below the target value to synchronise with 1D at a multiple of the 2D timesteps.
Where there is not a one to one synchronisation of the 1D and 2D timesteps, a usually negligible mass error may occur and can be checked by reviewing the CME% values shown on the Console Window, the .tlf file or the _MB.csv file in the same manner as Classic.
HPC Timestep Synchronisation
HPC uses an adaptive timestep derived from the hydraulic conditions during a simulation. This timestepping approach creates a situation where the computational timestep does not always align exactly with the specified map and time series result output intervals. To account for this TUFLOW HPC makes a timestep adjustments to synchronize the computational timestep with output reporting times. When this occurs the minimum timestep (dt) reported in hpc.dt.csv will report a reduced timestep. This adjustment doesn’t have any effect on the hydraulic calculations, and as such, is not reported in the hpc.tlf or shown in the dt map output. The "dtStar" column in the hpc.dt.csv file also reports the calculated 2D target timestep without any result output synchronisation applied. If the hpc.dt.csv file is being used to quality check the health of a simulation, "dtStar" should be used for the analysis, not "dt".
HPC Quadtree Adaptive Timestepping
All the above is applicable to the HPC with Quadtree simulations. In addition the Quadtree solver uses a single adaptive timestep for the entire model at any instance in time. Different timesteps are not applied to the respective different resolution nest levels. If a small cell resolution is nested down in water that is deeper than the cell face length, the Diffusion control number would be the critical limiter that is setting the timestep and the model will run slower than expected. This can be confirmed by reviewing the hpc.dt.csv file information.
Up |
---|
Back to HPC Modelling Guidance |