DelNov / T-Flows

Program for Simulation of Turbulent Flows
Other
113 stars 50 forks source link

Load_Boundary_Conditions, Backup_Mod_Load, Initialize_Variables #201

Open Niceno opened 4 years ago

Niceno commented 4 years ago

Dear all,

I was looking at the Main_Pro, and am starting to believe that the order in which we call the subroutines Load_Boundary_Conditions, Backup_Mod_Load, Initialize_Variables is a bit silly.

We currently call them in this order:

1 - Load_Boundary_Conditions 2 - Backup_Mod_Load 3 - Initialize_Variables

First problem is if we want to make a restart, we should avoid that Initialize_Variables is called. And we are currently doing it with an if statement. So it works, but it could have been avoided if Initialize Variables was called before Backup_Mod_Load.

Second problem is, say, you want to use backup files for restart, but in the new simulation you want to change boundary conditions. Currently, we first call Load_Boundary_Conditions and then we call Backup_Mod_Load which will overwrite the new boundary conditions we might want to use in new simulation :-(

I believe a better order would be:

1 - Initialize_Variables - initializes with whatever is specified in control file. 2 - Backup_Mod_Load - if specified, loads whatever it is a user want to load and overwrites initial conditions from step 1. 3 - Load_Boundary_Conditions - if one wants to change boundary conditions after restart, call this function last will overwrite values in boundary cells from step 2.

Please let me know what you think.