DelNov / T-Flows

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

Program crashes if turbulence model in control file is none or dns #186

Closed mhadziabdic closed 3 months ago

mhadziabdic commented 4 years ago

Dear guys,

If we specify none in control file the program crashes due to this line in Main.f90 169 ! Compute deltas for Spalart-Allmaras models 170 call Turb_Mod_Calculate_Deltas(turb)

I suggest to move these two lines to Turb_Mod/Init.f90 like this 22 ! Compute deltas for Spalart-Allmaras and DES models 23 if(turbulence_model .eq. SPALART_ALLMARAS .or. & 24 turbulence_model .eq. DES_SPALART) then 25 call Turb_Mod_Calculate_Deltas(turb) 26 end if

If we specify dns in control file it crashes due to this line in Save_Results.f90

420 kin_vis_t(:) = 0.0 421 if(turbulence_model .ne. NO_TURBULENCE) then 422 kin_vis_t (-grid % n_bnd_cells:grid % n_cells) = & 423 turb % vis_t(-grid % n_bnd_cells:grid % n_cells) / & 424 flow % viscosity(-grid % n_bnd_cells:grid % n_cells) 425 call Save_Scalar(grid, IN_4, IN_5, "EddyOverMolecularViscosity", & 426 plot_inside, & 427 kin_vis_t(-grid % n_bnd_cells), f8, f9) 428 end if

Program also crashes if we use none or dns and try to collect statistics.

In addition, user function Force has grid argument and there should be flow.

Niceno commented 4 years ago

I will work on this in the afternoon.

Niceno commented 4 years ago

I can't reproduce these issues. I cloned the T-Flows, stayed in development_branch. I took the case from Tests/Laminar/Backstep/Nonorthogonal and all works fine.

Furthermore, if I check User_Mod/Force.f90, it starts as:

subroutine User_Mod_Force(grid, ui, a_matrix, b_vector)

It is called from Compute_Momentum.f90 as:

call User_Mod_Force(grid, ui, a, b)

which looks the same to me.

Could you tell exactly which case did you run when you encountered problems? Are you sure you were in development_branch?