diff --git a/Documentation/Syntax/.vim/ftdetect/control.vim b/Documentation/Syntax/.vim/ftdetect/control.vim new file mode 100644 index 000000000..6b16aa478 --- /dev/null +++ b/Documentation/Syntax/.vim/ftdetect/control.vim @@ -0,0 +1 @@ +autocmd BufNewFile,BufRead control* setf control diff --git a/Documentation/Syntax/.vim/syntax/control.vim b/Documentation/Syntax/.vim/syntax/control.vim new file mode 100644 index 000000000..faf1f98bd --- /dev/null +++ b/Documentation/Syntax/.vim/syntax/control.vim @@ -0,0 +1,256 @@ +" Vim syntax file +" Language: control + +au BufNewFile,BufRead control* setf control + +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +" ============================================================================== +" Comments: +syn region controlComment start="\#" end="\n" +syn region controlComment start="\!" end="\n" +syn region controlComment start="%" end="\n" + +" List of keyords was obtained with command: +" cat ../Documentation/all_control_keywords | awk '{print "syn keyword controlKeyword " $1}' | grep -v '|' | grep -v KEYWORD +" ============================================================================== +" Mandatory problem name and boundary conditions +syn keyword controlKeyword PROBLEM_NAME +syn keyword controlKeyword BOUNDARY_CONDITION +syn keyword controlKeyword TYPE +syn keyword controlKeyword VARIABLES +syn keyword controlKeyword VALUES +syn keyword controlKeyword FILE +syn keyword controlKeyword INTERFACE_CONDITION +syn keyword controlKeyword BOUNDARY_CONDITIONS +" Some other non-mandatory but often used kewords +syn keyword controlKeyword INITIAL_CONDITION +syn keyword controlKeyword SYNTHETIC_EDDIES +syn keyword controlKeyword NUMBER_OF_EDDIES +syn keyword controlKeyword MAX_EDDY_RADIUS +syn keyword controlKeyword EDDY_INTENSITY +" Input-output +syn keyword controlKeyword BACKUP_SAVE_INTERVAL +syn keyword controlKeyword LOAD_BACKUP_NAME +syn keyword controlKeyword NUMBER_OF_MONITORING_POINTS +syn keyword controlKeyword MONITORING_POINT_001 +syn keyword controlKeyword MONITORING_POINT_002 +syn keyword controlKeyword MONITORING_POINT_003 +syn keyword controlKeyword MONITORING_POINT_004 +syn keyword controlKeyword MONITORING_POINT_005 +syn keyword controlKeyword MONITORING_POINT_006 +syn keyword controlKeyword MONITORING_POINT_007 +syn keyword controlKeyword MONITORING_POINT_008 +syn keyword controlKeyword MONITORING_POINT_009 +syn keyword controlKeyword MONITORING_POINT_010 +syn keyword controlKeyword MONITORING_POINT_011 +syn keyword controlKeyword MONITORING_POINT_012 +syn keyword controlKeyword MONITORING_POINT_013 +syn keyword controlKeyword MONITORING_POINT_014 +syn keyword controlKeyword MONITORING_POINT_015 +syn keyword controlKeyword MONITORING_POINT_016 +syn keyword controlKeyword RESULTS_SAVE_INTERVAL +syn keyword controlKeyword SAVE_BACKUP_NAME +syn keyword controlKeyword SAVE_INITIAL_CONDITION +syn keyword controlKeyword SAVE_RESULTS_AT_BOUNDARIES +syn keyword controlKeyword SWARM_SAVE_INTERVAL +syn keyword controlKeyword WALL_TIME_MAX_HOURS +syn keyword controlKeyword PROFILER_INFO +" Numerics +syn keyword controlKeyword ADVECTION_SCHEME_FOR_ENERGY +syn keyword controlKeyword ADVECTION_SCHEME_FOR_MOMENTUM +syn keyword controlKeyword ADVECTION_SCHEME_FOR_SCALARS +syn keyword controlKeyword ADVECTION_SCHEME_FOR_TURBULENCE +syn keyword controlKeyword ADVECTION_SCHEME_FOR_VOF +syn keyword controlKeyword BLENDING_COEFFICIENT_FOR_ENERGY +syn keyword controlKeyword BLENDING_COEFFICIENT_FOR_MOMENTUM +syn keyword controlKeyword BLENDING_COEFFICIENT_FOR_SCALARS +syn keyword controlKeyword BLENDING_COEFFICIENT_FOR_TURBULENCE +syn keyword controlKeyword BLENDING_COEFFICIENT_FOR_VOF +syn keyword controlKeyword CHOI_CORRECTION +syn keyword controlKeyword GRADIENT_METHOD_FOR_ENERGY +syn keyword controlKeyword GRADIENT_METHOD_FOR_MOMENTUM +syn keyword controlKeyword GRADIENT_METHOD_FOR_PRESSURE +syn keyword controlKeyword GRADIENT_METHOD_FOR_SCALARS +syn keyword controlKeyword GRADIENT_METHOD_FOR_TURBULENCE +syn keyword controlKeyword GRADIENT_METHOD_FOR_VOF +syn keyword controlKeyword GRADIENT_METHOD_FOR_WALL_DISTANCE +syn keyword controlKeyword GU_CORRECTION +syn keyword controlKeyword LINEAR_SOLVERS +syn keyword controlKeyword MAX_CORRECTION_CYCLES_BETA_VOF +syn keyword controlKeyword MAX_COURANT_VOF +syn keyword controlKeyword MAX_GAUSS_GRADIENTS_ITERATIONS +syn keyword controlKeyword MAX_ITERATIONS_FOR_ENERGY_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_MOMENTUM_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_POTENTIAL_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_PRESSURE_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_SCALARS_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_TURBULENCE_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_VOF_SOLVER +syn keyword controlKeyword MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER +syn keyword controlKeyword MAX_LEAST_SQUARES_GRADIENTS_ITERATIONS +syn keyword controlKeyword MAX_SIMPLE_ITERATIONS +syn keyword controlKeyword MAX_SMOOTHING_CYCLES_CURVATURE_VOF +syn keyword controlKeyword MAX_SMOOTHING_CYCLES_NORMAL_VOF +syn keyword controlKeyword MAX_SUBSTEP_CYCLES_VOF +syn keyword controlKeyword MAX_THREADS +syn keyword controlKeyword MIN_SIMPLE_ITERATIONS +syn keyword controlKeyword NORMALIZATION_FOR_ENERGY_SOLVER +syn keyword controlKeyword NORMALIZATION_FOR_MOMENTUM_SOLVER +syn keyword controlKeyword NORMALIZATION_FOR_PRESSURE_SOLVER +syn keyword controlKeyword NORMALIZATION_FOR_SIMPLE_ALGORITHM +syn keyword controlKeyword NORMALIZATION_FOR_SCALARS_SOLVER +syn keyword controlKeyword NORMALIZATION_FOR_TURBULENCE_SOLVER +syn keyword controlKeyword NUMBER_OF_PISO_CORRECTIONS +syn keyword controlKeyword NUMBER_OF_TIME_STEPS +syn keyword controlKeyword NUMBER_OF_SWARM_SUB_STEPS +syn keyword controlKeyword PRECONDITIONER_FOR_SYSTEM_MATRIX +syn keyword controlKeyword PRESSURE_MOMENTUM_COUPLING +syn keyword controlKeyword REPORT_VOLUME_BALANCE +syn keyword controlKeyword SIMPLE_UNDERRELAXATION_FOR_ENERGY +syn keyword controlKeyword SIMPLE_UNDERRELAXATION_FOR_MOMENTUM +syn keyword controlKeyword SIMPLE_UNDERRELAXATION_FOR_PRESSURE +syn keyword controlKeyword SIMPLE_UNDERRELAXATION_FOR_SCALARS +syn keyword controlKeyword SIMPLE_UNDERRELAXATION_FOR_TURBULENCE +syn keyword controlKeyword SIMPLE_UNDERRELAXATION_FOR_VOF +syn keyword controlKeyword SKEWNESS_CORRECTION_VOF +syn keyword controlKeyword SOLVER_FOR_ENERGY +syn keyword controlKeyword SOLVER_FOR_MOMENTUM +syn keyword controlKeyword SOLVER_FOR_POTENTIAL +syn keyword controlKeyword SOLVER_FOR_PRESSURE +syn keyword controlKeyword SOLVER_FOR_SCALARS +syn keyword controlKeyword SOLVER_FOR_TURBULENCE +syn keyword controlKeyword SOLVER_FOR_VOF +syn keyword controlKeyword SOLVER_FOR_WALL_DISTANCE +syn keyword controlKeyword TIME_INTEGRATION_SCHEME +syn keyword controlKeyword TIME_STEP +syn keyword controlKeyword TOLERANCE_FOR_GAUSS_GRADIENTS +syn keyword controlKeyword TOLERANCE_FOR_ENERGY_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_MOMENTUM_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_POTENTIAL_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_PRESSURE_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_SIMPLE_ALGORITHM +syn keyword controlKeyword TOLERANCE_FOR_SCALARS_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_TURBULENCE_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_VOF_SOLVER +syn keyword controlKeyword TOLERANCE_FOR_WALL_DISTANCE_SOLVER +" PETSc options +syn keyword controlKeyword PETSC_OPTIONS_FOR_MOMENTUM +syn keyword controlKeyword PETSC_OPTIONS_FOR_PRESSURE +syn keyword controlKeyword PETSC_OPTIONS_FOR_WALL_DISTANCE +syn keyword controlKeyword PETSC_OPTIONS_FOR_POTENTIAL +syn keyword controlKeyword PETSC_OPTIONS_FOR_VOF +syn keyword controlKeyword PETSC_OPTIONS_FOR_ENERGY +syn keyword controlKeyword PETSC_OPTIONS_FOR_SCALARS +syn keyword controlKeyword PETSC_OPTIONS_FOR_TURBULENCE +syn keyword controlKeyword SOLVER +syn keyword controlKeyword PREC +syn keyword controlKeyword PREC_OPTS +syn keyword controlKeyword TOLERANCE +" Physics +syn keyword controlKeyword ANGULAR_VELOCITY_VECTOR +syn keyword controlKeyword BUOYANCY +syn keyword controlKeyword DYNAMIC_VISCOSITY +syn keyword controlKeyword EXTRAPOLATE_TEMPERATURE_EXP +syn keyword controlKeyword GRAVITATIONAL_VECTOR +syn keyword controlKeyword HEAT_CAPACITY +syn keyword controlKeyword HEAT_TRANSFER +syn keyword controlKeyword HYBRID_LES_RANS_SWITCH +syn keyword controlKeyword INTERFACE_TRACKING +syn keyword controlKeyword LATENT_HEAT +syn keyword controlKeyword MASS_DENSITY +syn keyword controlKeyword MASS_FLOW_RATES +syn keyword controlKeyword MASS_TRANSFER +syn keyword controlKeyword MAX_PARTICLES +syn keyword controlKeyword NUMBER_OF_DOMAINS +syn keyword controlKeyword NUMBER_OF_PHASES +syn keyword controlKeyword NUMBER_OF_SCALARS +syn keyword controlKeyword NUMBER_OF_SWARM_SUBSTEPS +syn keyword controlKeyword PARTICLE_TRACKING +syn keyword controlKeyword PHASE_DENSITIES +syn keyword controlKeyword PHASE_VISCOSITIES +syn keyword controlKeyword PHASE_CAPACITIES +syn keyword controlKeyword PHASE_CONDUCTIVITIES +syn keyword controlKeyword POINT_FOR_MONITORING_PLANES +syn keyword controlKeyword POTENTIAL_INITIALIZATION +syn keyword controlKeyword PRESSURE_DROPS +syn keyword controlKeyword REFERENCE_DENSITY +syn keyword controlKeyword REFERENCE_TEMPERATURE +syn keyword controlKeyword ROUGHNESS_COEFFICIENT +syn keyword controlKeyword ROUGH_WALLS +syn keyword controlKeyword SATURATION_TEMPERATURE +syn keyword controlKeyword SCALARS_DIFFUSIVITY +syn keyword controlKeyword SMAGORINSKY_CONSTANT +syn keyword controlKeyword STARTING_TIME_STEP_FOR_SWARM_COMPUTATION +syn keyword controlKeyword STARTING_TIME_STEP_FOR_SWARM_STATISTICS +syn keyword controlKeyword STARTING_TIME_STEP_FOR_TURB_STATISTICS +syn keyword controlKeyword SURFACE_TENSION +syn keyword controlKeyword SWARM_COEFFICIENT_OF_RESTITUTION +syn keyword controlKeyword SWARM_DENSITY +syn keyword controlKeyword SWARM_DIAMETER +syn keyword controlKeyword SWARM_SUBGRID_SCALE_MODEL +syn keyword controlKeyword THERMAL_CONDUCTIVITY +syn keyword controlKeyword TRACK_FRONT +syn keyword controlKeyword TRACK_SURFACE +syn keyword controlKeyword TURBULENCE_MODEL +syn keyword controlKeyword TURBULENCE_MODEL_VARIANT +syn keyword controlKeyword TURBULENT_HEAT_FLUX_MODEL +syn keyword controlKeyword TURBULENT_PRANDTL_NUMBER +syn keyword controlKeyword TURBULENT_SCHMIDT_NUMBER +syn keyword controlKeyword VOLUME_EXPANSION_COEFFICIENT +" Porous regions +syn keyword controlKeyword NUMBER_OF_POROUS_REGIONS +syn keyword controlKeyword POROUS_REGION_001 +syn keyword controlKeyword POROUS_REGION_002 +syn keyword controlKeyword POROUS_REGION_003 +syn keyword controlKeyword POROUS_REGION_004 +syn keyword controlKeyword POROUS_REGION_005 +syn keyword controlKeyword POROUS_REGION_006 +syn keyword controlKeyword POROUS_REGION_007 +syn keyword controlKeyword POROUS_REGION_008 +syn keyword controlKeyword POROUS_REGION_009 +syn keyword controlKeyword POROUS_REGION_010 +syn keyword controlKeyword POROUS_REGION_011 +syn keyword controlKeyword POROUS_REGION_012 +syn keyword controlKeyword POROUS_REGION_013 +syn keyword controlKeyword POROUS_REGION_014 +syn keyword controlKeyword POROUS_REGION_015 +syn keyword controlKeyword POROUS_REGION_016 +syn keyword controlKeyword STL_FILE + +" ============================================================================== +" Numbers (integer must be before the float, otherwise things get messed up) +syn match controlInteger "-\=\<[0-9]*\>" +syn match controlFloat "-\=\d\+\.\d*\([eE][-+]\=\d\+\)\=[fl]\=\>" + +" Intrinsic (these are T-Flows variables) +syn keyword controlIntrinsic u v w t q p kin eps zeta f22 uu vv ww uv uw vw vof vof_c_ang +syn keyword controlIntrinsic c_01 c_02 c_03 c_04 c_05 c_06 q_01 q_02 q_03 q_04 q_05 q_06 +syn keyword controlIntrinsic x y z rx ry rz +syn keyword controlBoundaryConditon wall inflow outflow pressure convective symmetry +syn keyword controlLinearSolvers native petsc cg bicg incomplete_cholesky diagonal none asm hypre +syn keyword controlNumericalParameters simple piso linear parabolic gauss_theorem least_squares +syn keyword controlNumericalParameters central smart luds quick smart gamma minmod blended superbee avl_smart +syn keyword controlNumericalParameters cicsam upwind stacs +syn keyword controlNumericalParameters yes no +syn keyword controlTurbulenceModels k_eps_zeta_f k_eps les_tvm les_wal les_dynamic les_smagorinsky hybrid_les_prandtl +syn keyword controlTurbulenceModels des_spalart spalart_allmaras dns rsm_hanjalic_jakirlic rsm_manceau_hanjalic dns none +syn keyword controlTurbulenceModels high_re low_re ggdh sgdh afm + +" ============================================================================== +" The default methods for highlighting. Can be overridden later. +hi def link controlKeyword Type +hi def link controlComment Comment +hi def link controlInteger Number +hi def link controlFloat Number +hi def link controlIntrinsic Identifier +hi def link controlBoundaryConditon Keyword +hi def link controlLinearSolvers Keyword +hi def link controlNumericalParameters Keyword +hi def link controlTurbulenceModels Keyword + +let b:current_syntax = "control" + diff --git a/Documentation/Syntax/.vim/syntax/fortran.vim b/Documentation/Syntax/.vim/syntax/fortran.vim new file mode 100644 index 000000000..777f1c4bd --- /dev/null +++ b/Documentation/Syntax/.vim/syntax/fortran.vim @@ -0,0 +1,735 @@ +"=====================================================================[T-Flows]= +" The idea here is as follows: +" +" Expand the existing fortran syntax file which comes with vim, with code +" contructs pertinent to T-Flow. Ideally, that should be followed by +" setting or selecting a colorsheme in vim, but defining a color scheme +" seems to be a daunting task. +" +" Rather, fine-tuning of colors in vim is don through .vimrc file, using +" the command highlight (typical format :highlight String ctermfg=Green) +" +" There is a CATCH with setting highlights in .vimrc, though: formatting +" elements in .vimrc should NOT be set in this file!!! (Not sure anymore) +" +" A sample snippet from .vimrc which worked well now follows: +" +" from .vimrc: "---------------------------------------------------------------- +" from .vimrc: " With the following commands, I am trying to tune color scheme +" from .vimrc: " +" from .vimrc: " Commands which might prove to be useful in the future +" from .vimrc: " +" from .vimrc: " Preprocessor directives +" from .vimrc: " :highlight PreProc ctermfg=Red +" from .vimrc: " +" from .vimrc: " Everything else: +" from .vimrc: " :highlight Normal ctermfg=Yellow +" from .vimrc: "---------------------------------------------------------------- +" from .vimrc: +" from .vimrc: " Keyords should be Fortran commands +" from .vimrc: highlight fortranKeyword ctermfg=Yellow +" from .vimrc: +" from .vimrc: " Ghost numbers are not desirable, mark them red +" from .vimrc: highlight fortranNumber ctermfg=Red +" from .vimrc: highlight fortranFloat ctermfg=Red +" from .vimrc: +" from .vimrc: " Constants are better than ghost numbers, mark them blue ... +" from .vimrc: " ... they are safer, they are in effect former ghost numbers +" from .vimrc: highlight fortranConstant ctermfg=Blue +" from .vimrc: +" from .vimrc: " Continuation lines. I like them visible and a bit psychedelic +" from .vimrc: highlight fortranContinueMark ctermfg=Magenta +" from .vimrc: +" from .vimrc: highlight fortranString ctermfg=Gray +" from .vimrc: +" from .vimrc: " Operators ... I don't know, maybe the same as keywords +" from .vimrc: highlight fortranOperator ctermfg=Yellow +" from .vimrc: +" from .vimrc: " Just Comment didn't work, fortranComment did +" from .vimrc: highlight fortranComment ctermfg=LightBlue +" from .vimrc: +" from .vimrc: " Try to over-ride Fortran objects in T-Flows +" from .vimrc: highlight fortranObjectTflows cterm=Bold ctermfg=Green +" from .vimrc: +" from .vimrc: " MPI calls in T-Flows - they are few and far in between, yet dangerous +" from .vimrc: highlight fortranMpiTflows ctermfg=Red +"---------------------------------------------------------------------[T-Flows]- + +" Vim syntax file +" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77) +" Version: (v104) 2021 April 06 +" Maintainer: Ajit J. Thakkar ; +" Usage: For instructions, do :help fortran-syntax from Vim +" Credits: +" Version 0.1 for Fortran 95 was created in April 2000 by Ajit Thakkar from an +" older Fortran 77 syntax file by Mario Eusebio and Preben Guldberg. +" Since then, useful suggestions and contributions have been made, in order, by: +" Andrej Panjkov, Bram Moolenaar, Thomas Olsen, Michael Sternberg, Christian Reile, +" Walter Dieudonne, Alexander Wagner, Roman Bertle, Charles Rendleman, +" Andrew Griffiths, Joe Krahn, Hendrik Merx, Matt Thompson, Jan Hermann, +" Stefano Zaghi, Vishnu V. Krishnan, Judicael Grasset, Takuma Yoshida, +" Eisuke Kawashima, Andre Chalella, and Fritz Reese. + +if exists("b:current_syntax") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +" Choose fortran_dialect using the priority: +" source file directive > buffer-local value > global value > file extension +" first try using directive in first three lines of file +let b:fortran_retype = getline(1)." ".getline(2)." ".getline(3) +if b:fortran_retype =~? '\' + let b:fortran_dialect = "F" +elseif b:fortran_retype =~? '\' + let b:fortran_dialect = "f08" +elseif !exists("b:fortran_dialect") + if exists("g:fortran_dialect") && g:fortran_dialect =~# '\' + " try global variable + let b:fortran_dialect = g:fortran_dialect + else " nothing found, so use default + let b:fortran_dialect = "f08" + endif +endif +unlet! b:fortran_retype +" make sure buffer-local value is not invalid +if b:fortran_dialect !~# '\' + let b:fortran_dialect = "f08" +endif + +" Choose between fixed and free source form if this hasn't been done yet +if !exists("b:fortran_fixed_source") + if b:fortran_dialect == "F" + " F requires free source form + let b:fortran_fixed_source = 0 + elseif exists("fortran_free_source") + " User guarantees free source form for all fortran files + let b:fortran_fixed_source = 0 + elseif exists("fortran_fixed_source") + " User guarantees fixed source form for all fortran files + let b:fortran_fixed_source = 1 + elseif expand("%:e") =~? '^f\%(90\|95\|03\|08\)$' + " Free-form file extension defaults as in Intel ifort, gcc(gfortran), NAG, Pathscale, and Cray compilers + let b:fortran_fixed_source = 0 + elseif expand("%:e") =~? '^\%(f\|f77\|for\)$' + " Fixed-form file extension defaults + let b:fortran_fixed_source = 1 + else + " Modern fortran still allows both free and fixed source form. + " Assume fixed source form unless signs of free source form + " are detected in the first five columns of the first s:lmax lines. + " Detection becomes more accurate and time-consuming if more lines + " are checked. Increase the limit below if you keep lots of comments at + " the very top of each file and you have a fast computer. + let s:lmax = 500 + if ( s:lmax > line("$") ) + let s:lmax = line("$") + endif + let b:fortran_fixed_source = 1 + let s:ln=1 + while s:ln <= s:lmax + let s:test = strpart(getline(s:ln),0,5) + if s:test !~ '^[Cc*]' && s:test !~ '^ *[!#]' && s:test =~ '[^ 0-9\t]' && s:test !~ '^[ 0-9]*\t' + let b:fortran_fixed_source = 0 + break + endif + let s:ln = s:ln + 1 + endwhile + unlet! s:lmax s:ln s:test + endif +endif + +"=====================================================================[T-Flows]= +" Do not ignore the case +" syn case ignore +"---------------------------------------------------------------------[T-Flows]- + +if b:fortran_fixed_source == 1 + syn match fortranConstructName "^\s\{6,}\zs\a\w*\ze\s*:" +else + syn match fortranConstructName "^\s*\zs\a\w*\ze\s*:" +endif +if exists("fortran_more_precise") + syn match fortranConstructName "\(\" +syn match fortranType "\" +syn match fortranType "\" +syn match fortranType "\" +syn match fortranType "\" +syn match fortranType "\" +syn keyword fortranType intrinsic +syn match fortranType "\" +syn keyword fortranStructure dimension +syn keyword fortranStorageClass parameter save +syn match fortranUnitHeader "\" +"=====================================================================[T-Flows]= +" Got rid of the special group for call ... +" syn keyword fortranCall call +"---------------------------------------------------------------------[T-Flows]- +syn match fortranUnitHeader "\" +syn match fortranUnitHeader "\" +syn match fortranUnitHeader "\" +"=====================================================================[T-Flows]= +" ... and added it (call) to the keywords +" syn keyword fortranKeyword return stop +syn keyword fortranKeyword return stop call +"---------------------------------------------------------------------[T-Flows]- +syn keyword fortranConditional else then +syn match fortranConditional "\" +syn match fortranConditionalOb "\" + +syn keyword fortranTodo contained todo fixme + +"Catch errors caused by too many right parentheses +syn region fortranParen transparent start="(" end=")" contains=ALLBUT,fortranParenError,@fortranCommentGroup,cIncluded,@spell +syn match fortranParenError ")" + +syn match fortranOperator "\.\s*n\=eqv\s*\." +syn match fortranOperator "\.\s*\(and\|or\|not\)\s*\." +syn match fortranOperator "\(+\|-\|/\|\*\)" +syn match fortranTypeOb "\" +syn match fortranType "\" + +"Numbers of various sorts +" Integers +syn match fortranNumber display "\<\d\+\(_\a\w*\)\=\>" +" floating point number, without a decimal point +syn match fortranFloatIll display "\<\d\+[deq][-+]\=\d\+\(_\a\w*\)\=\>" +" floating point number, starting with a decimal point +syn match fortranFloatIll display "\.\d\+\([deq][-+]\=\d\+\)\=\(_\a\w*\)\=\>" +" floating point number, no digits after decimal +syn match fortranFloatIll display "\<\d\+\.\([deq][-+]\=\d\+\)\=\(_\a\w*\)\=\>" +" floating point number, D or Q exponents +syn match fortranFloatIll display "\<\d\+\.\d\+\([dq][-+]\=\d\+\)\=\(_\a\w*\)\=\>" +" floating point number +syn match fortranFloat display "\<\d\+\.\d\+\(e[-+]\=\d\+\)\=\(_\a\w*\)\=\>" +" binary number +syn match fortranBinary display "b["'][01]\+["']" +" octal number +syn match fortranOctal display "o["'][0-7]\+["']" +" hexadecimal number +syn match fortranHex display "z["'][0-9A-F]\+["']" +" Numbers in formats +syn match fortranFormatSpec display "\d*f\d\+\.\d\+" +syn match fortranFormatSpec display "\d*e[sn]\=\d\+\.\d\+\(e\d+\>\)\=" +syn match fortranFormatSpec display "\d*\(d\|q\|g\)\d\+\.\d\+\(e\d+\)\=" +syn match fortranFormatSpec display "\d\+x\>" +" The next match cannot be used because it would pick up identifiers as well +" syn match fortranFormatSpec display "\<\(a\|i\)\d\+" + +" Numbers as labels +syn match fortranLabelNumber display "^\d\{1,5}\s"me=e-1 +syn match fortranLabelNumber display "^ \d\{1,4}\s"ms=s+1,me=e-1 +syn match fortranLabelNumber display "^ \d\{1,3}\s"ms=s+2,me=e-1 +syn match fortranLabelNumber display "^ \d\d\=\s"ms=s+3,me=e-1 +syn match fortranLabelNumber display "^ \d\s"ms=s+4,me=e-1 + +if exists("fortran_more_precise") + " Numbers as targets + syn match fortranTarget display "\(\" + syn match fortranTarget display "\(\" + syn match fortranTarget display "\(\" +endif + +syn keyword fortranTypeR external +syn keyword fortranIOR format +syn match fortranKeywordR "\" +syn match fortranKeyword "^\s*\d\+\s\+continue\>" +syn match fortranKeyword "\" +syn match fortranKeywordDel "\" +syn keyword fortranType none + +syn keyword fortranStructure private public intent optional +syn keyword fortranStructure pointer target allocatable +syn keyword fortranStorageClass in out +syn match fortranStorageClass "\" +syn match fortranUnitHeader "\" +syn keyword fortranUnitHeader use only contains +syn keyword fortranUnitHeader result operator assignment +syn match fortranUnitHeader "\" +syn keyword fortranKeyword allocate deallocate nullify cycle exit +syn match fortranConditional "\" +syn keyword fortranConditional case default where elsewhere + +syn match fortranOperator "\(\(>\|<\)=\=\|==\|/=\|=\)" +syn match fortranOperator "=>" + +syn region fortranString start=+"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber +syn keyword fortranIO pad position action delim readwrite +syn keyword fortranIO eor advance nml + +syn keyword fortranKeyword adjustl adjustr all allocated any associated bit_size btest +syn keyword fortranKeyword ceiling count cshift date_and_time digits dot_product eoshift +syn keyword fortranKeyword epsilon exponent floor fraction huge iand ibclr ibits ibset +syn keyword fortranKeyword ieor ior ishft ishftc lbound len_trim matmul maxexponent +syn keyword fortranKeyword maxloc maxval merge minexponent minloc minval modulo mvbits +syn keyword fortranKeyword nearest pack precision present product radix random_number +syn keyword fortranKeyword random_seed range repeat reshape rrspacing +"=====================================================================[T-Flows]= +" Changed a few more functions from Intrinsic to Fortran keywords +"---------------------------------------------------------------------[T-Flows]- +syn keyword fortranKeyword scale scan selected_int_kind selected_real_kind set_exponent +syn keyword fortranKeyword shape size spacing spread sum system_clock tiny transpose +syn keyword fortranKeyword trim ubound unpack verify +syn match fortranIntrinsic "\\(\s*\.\)\@!"me=s+3 +syn match fortranIntrinsic "\\s*[(,]"me=s+4 + +syn match fortranUnitHeader "\" +syn keyword fortranIOR namelist +syn keyword fortranConditionalR while +syn keyword fortranIntrinsicR achar iachar transfer + +syn keyword fortranInclude include +syn keyword fortranStorageClassR sequence + +syn match fortranConditional "\" +syn match fortranType "\" +syn match fortranType "\" +syn match fortranType "\" +if exists("fortran_more_precise") + syn match fortranConstructName "\(\" +endif + +if b:fortran_dialect == "f08" + " F2003 + syn keyword fortranKeyword command_argument_count get_command get_command_argument get_environment_variable + syn keyword fortranKeyword is_iostat_end is_iostat_eor move_alloc new_line selected_char_kind same_type_as + syn keyword fortranKeyword extends_type_of + " ISO_C_binding + syn keyword fortranConstant c_null_char c_alert c_backspace c_form_feed c_new_line c_carriage_return + syn keyword fortranConstant c_horizontal_tab c_vertical_tab c_int c_short c_long c_long_long c_signed_char + syn keyword fortranConstant c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t + syn keyword fortranConstant c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t + syn keyword fortranConstant c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex + syn keyword fortranConstatn c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr + syn keyword fortranIntrinsic iso_c_binding c_loc c_funloc c_associated c_f_pointer c_f_procpointer + syn keyword fortranType c_ptr c_funptr + " ISO_Fortran_env + syn keyword fortranConstant iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit + " IEEE_arithmetic + syn keyword fortranIntrinsic ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode + + syn keyword fortranReadWrite flush wait + syn keyword fortranIO decimal round iomsg + syn keyword fortranType asynchronous nopass non_overridable pass protected volatile extends import + syn keyword fortranType non_intrinsic value bind deferred generic final enumerator + syn match fortranType "\" + syn match fortranType "\" + syn match fortranType "\" + syn match fortranType "\" + syn match fortranConditional "\" + syn match fortranUnitHeader "\" + syn match fortranOperator "\([\|]\)" + + " F2008 + syn keyword fortranKeyword acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn + syn keyword fortranKeyword erf erfc erfc_scaled gamma log_gamma hypot norm2 + syn keyword fortranKeyword atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits + syn keyword fortranKeyword bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image + syn keyword fortranIO newunit + syn keyword fortranType contiguous + syn keyword fortranRepeat concurrent + +"=====================================================================[T-Flows]= +" T-Flows specific +" Start with constants from Const_Mod: + syn keyword fortranConstant PROGRAM_NAME + syn keyword fortranConstant VL SL DL MSI DP SP IP LP RP + syn keyword fortranConstant VERSION_CFN VERSION_DIM VERSION_BACKUP + syn keyword fortranConstant YOCTO ZEPTO ATTO FEMTO PICO NANO MICRO MILI + syn keyword fortranConstant YOTTA ZETTA EXA PETA TERA GIGA MEGA KILO + syn keyword fortranConstant HUGE TINY HUGE_INT EULER PI + syn keyword fortranConstant ONE_THIRD TWO_THIRDS ONE_SIXTH + syn keyword fortranConstant MD MAX_VARS_INTERFACE +" Constants from Tokenizer_Mod + syn keyword fortranConstant MAX_TOKENS +" Constants related to indentation (O think they are defined in a few places - bad! + syn keyword fortranConstant IN_0 IN_1 IN_2 IN_3 IN_4 IN_5 +" Constants from Info_Mod + syn keyword fortranConstant L_LINE L_BOX MAX_USER_LINES +" Constants from Numerics_Mod + syn keyword fortranConstant UPWIND CENTRAL LUDS QUICK SMART GAMMA + syn keyword fortranConstant MINMOD BLENDED SUPERBEE AVL_SMART CICSAM STACS + syn keyword fortranConstant LINEAR PARABOLIC RUNGE_KUTTA_3 + syn keyword fortranConstant SIMPLE PISO CHOI + syn keyword fortranConstant LEAST_SQUARES GAUSS_THEOREM +" Constants from Turb_Mod + syn keyword fortranConstant NO_TURBULENCE_MODEL DNS LES_SMAGORINSKY LES_DYNAMIC + syn keyword fortranConstant LES_WALE LES_TVM K_EPS K_EPS_ZETA_F DES_SPALART + syn keyword fortranConstant SPALART_ALLMARAS RSM_HANJALIC_JAKIRLIC RSM_MANCEAU_HANJALIC + syn keyword fortranConstant HYBRID_LES_RANS HYBRID_LES_PRANDTL STABILIZED SGDH GGDH AFM A_POW B_POW + syn keyword fortranConstant SWITCH_DISTANCE SWITCH_VELOCITY THERMALLY_DRIVEN DENSITY_DRIVEN NO_BUOYANCY +" Constants from Region_Mod + syn keyword fortranConstant INFLOW WALL WALLFL OUTFLOW SYMMETRY CONVECT PRESSURE + syn keyword fortranConstant INSIDE BUFFER PERIODIC_X PERIODIC_Y PERIODIC_Z UNDEFINED +" Constants from various procedures + syn keyword fortranConstant YES NO DEBUG BEGIN +" After the constants, I have alternating definitions of types and objects derived from them + syn keyword fortranTypeTflows Domain_Type Point_Type Block_Type Line_Type Range_Type Read_Controls_Type + syn keyword fortranObjectTflows Dom points blocks lines ranges Read_Control Rc + syn keyword fortranTypeTflows Generate_Type Convert_Type Divide_Type Grid_Type Control_Type Time_Type + syn keyword fortranObjectTflows Generate Convert Divide Grid Prim Dual Control Time + syn keyword fortranTypeTflows Math_Type Sort_Type File_Type String_Type Work_Type Tokenizer_Type + syn keyword fortranObjectTflows Math Sort File String Work Line Tok + syn keyword fortranTypeTflows Comm_Type Backup_Type Field_Type Turb_Type Vof_Type Swarm_Type + syn keyword fortranObjectTflows Comm Global Backup Bac Flow Fld Turb Tur Vof Swarm Swr + syn keyword fortranTypeTflows Bulk_Type Face_Type Iter_Type + syn keyword fortranObjectTflows v_flux Iter + syn keyword fortranTypeTflows Front_Type Surf_Type Elem_Type Side_Type Vert_Type Particle_Type + syn keyword fortranObjectTflows Front Surf Elem side Vert Part + syn keyword fortranTypeTflows Monitor_Type Results_Type Porosity_Type Profiler_Type Message_Type Info_Type + syn keyword fortranObjectTflows Monitor Results Por Profiler Prof Message Info + syn keyword fortranTypeTflows Matrix_Type Vector_Type Solver_Type Native_Type Petsc_Type Process_Type + syn keyword fortranObjectTflows A M vector Sol Nat Pet Process + syn keyword fortranTypeTflows Var_Type + syn keyword fortranObjectTflows u v w ui uj uk p t kin eps zeta f22 uu vv ww uv vw uw ut vt wt t2 vis phi +" Items which follow are not really objects, but I don't know where else to put them + syn keyword fortranObjectTflows This_Proc N_Procs First_Proc Sequential_Run Parallel_Run +" Macros might need a special group of their own. + syn keyword fortranMacroTflows Boundary_Regions Boundary_And_Inside_Regions Boundary_Inside_And_Buffer_Regions + syn keyword fortranMacroTflows All_Regions Faces_In_Region Faces_In_Domain + syn keyword fortranMacroTflows Cells_In_Region Cells_In_Domain Cells_In_Domain_And_Buffers Cells_In_Buffers + syn keyword fortranMacroTflows Assert Unused +" Finally, a few global functions which I don't really like in the code + syn keyword fortranGlobalTflows Adjust_Dim Adjust_First_Dim Swap_Int Swap_Real +"---------------------------------------------------------------------[T-Flows]- + +"==============================================================[MPI in T-Flows]= +" Here are MPI calls from T-Flows +" Note that they are not set in this file at all, only in the .vimrc + syn keyword fortranMpiTflows Mpi_Init Mpi_Comm_Size Mpi_Comm_Rank Mpi_Barrier Mpi_Finalize + syn keyword fortranMpiTflows Mpi_Allreduce Mpi_File_Close Mpi_File Mpi_File_Set_View Mpi_Sendrecv_Replace + syn keyword fortranMpiTflows Mpi_Send Mpi_Sendrecv Mpi_Status Mpi_Recv Mpi_Write + syn keyword fortranMpiTflows Mpi_Type_Create_Indexed_Block Mpi_Type_Commit + syn keyword fortranMpiTflows Mpi_File_Open Mpi_File_Read + syn keyword fortranMpiTflows MPI_COMM_WORLD MPI_CHARACTER MPI_INFO_NULL MPI_STATUS_IGNORE MPI_IN_PLACE + syn keyword fortranMpiTflows MPI_INTEGER MPI_LOGICAL MPI_DOUBLE_PRECISION MPI_REAL + syn keyword fortranMpiTflows MPI_LOR MPI_SUM MPI_MAX MPI_MIN MPI_MODE_WRONLY MPI_MODE_CREATE +"--------------------------------------------------------------[MPI in T-Flows]- + +" CUDA fortran + syn keyword fortranTypeCUDA host global device value + syn keyword fortranTypeCUDA shared constant pinned texture + syn keyword fortranTypeCUDA dim1 dim2 dim3 dim4 + syn keyword fortranTypeCUDA cudadeviceprop cuda_count_kind cuda_stream_kind + syn keyword fortranTypeCUDA cudaEvent cudaFuncAttributes cudaArrayPtr + syn keyword fortranTypeCUDA cudaSymbol cudaChannelFormatDesc cudaPitchedPtr + syn keyword fortranTypeCUDA cudaExtent cudaMemcpy3DParms + syn keyword fortranTypeCUDA cudaFuncCachePreferNone cudaFuncCachePreferShared + syn keyword fortranTypeCUDA cudaFuncCachePreferL1 cudaLimitStackSize + syn keyword fortranTypeCUDA cudaLimitPrintfSize cudaLimitMallocHeapSize + syn keyword fortranTypeCUDA cudaSharedMemBankSizeDefault cudaSharedMemBankSizeFourByte cudaSharedMemBankSizeEightByte + syn keyword fortranTypeCUDA cudaEventDefault cudaEventBlockingSync cudaEventDisableTiming + syn keyword fortranTypeCUDA cudaMemcpyHostToDevice cudaMemcpyDeviceToHost + syn keyword fortranTypeCUDA cudaMemcpyDeviceToDevice + syn keyword fortranTypeCUDA cudaErrorNotReady cudaSuccess cudaErrorInvalidValue + syn keyword fortranTypeCUDA c_devptr + + syn match fortranStringCUDA "blockidx%[xyz]" + syn match fortranStringCUDA "blockdim%[xyz]" + syn match fortranStringCUDA "griddim%[xyz]" + syn match fortranStringCUDA "threadidx%[xyz]" + + syn keyword fortranIntrinsicCUDA warpsize syncthreads syncthreads_and syncthreads_count syncthreads_or threadfence threadfence_block threadfence_system gpu_time allthreads anythread ballot + syn keyword fortranIntrinsicCUDA atomicadd atomicsub atomicmax atomicmin atomicand atomicor atomicxor atomicexch atomicinc atomicdec atomiccas sizeof __shfl __shfl_up __shfl_down __shfl_xor + syn keyword fortranIntrinsicCUDA cudaChooseDevice cudaDeviceGetCacheConfig cudaDeviceGetLimit cudaDeviceGetSharedMemConfig cudaDeviceReset cudaDeviceSetCacheConfig cudaDeviceSetLimit cudaDeviceSetSharedMemConfig cudaDeviceSynchronize cudaGetDevice cudaGetDeviceCount cudaGetDeviceProperties cudaSetDevice cudaSetDeviceFlags cudaSetValidDevices + syn keyword fortranIntrinsicCUDA cudaThreadExit cudaThreadSynchronize cudaGetLastError cudaGetErrorString cudaPeekAtLastError cudaStreamCreate cudaStreamDestroy cudaStreamQuery cudaStreamSynchronize cudaStreamWaitEvent cudaEventCreate cudaEventCreateWithFlags cudaEventDestroy cudaEventElapsedTime cudaEventQuery cudaEventRecord cudaEventSynchronize + syn keyword fortranIntrinsicCUDA cudaFuncGetAttributes cudaFuncSetCacheConfig cudaFuncSetSharedMemConfig cudaSetDoubleForDevice cudaSetDoubleForHost cudaFree cudaFreeArray cudaFreeHost cudaGetSymbolAddress cudaGetSymbolSize + syn keyword fortranIntrinsicCUDA cudaHostAlloc cudaHostGetDevicePointer cudaHostGetFlags cudaHostRegister cudaHostUnregister cudaMalloc cudaMallocArray cudaMallocHost cudaMallocPitch cudaMalloc3D cudaMalloc3DArray + syn keyword fortranIntrinsicCUDA cudaMemcpy cudaMemcpyArraytoArray cudaMemcpyAsync cudaMemcpyFromArray cudaMemcpyFromSymbol cudaMemcpyFromSymbolAsync cudaMemcpyPeer cudaMemcpyPeerAsync cudaMemcpyToArray cudaMemcpyToSymbol cudaMemcpyToSymbolAsync cudaMemcpy2D cudaMemcpy2DArrayToArray cudaMemcpy2DAsync cudaMemcpy2DFromArray cudaMemcpy2DToArray cudaMemcpy3D cudaMemcpy3DAsync + syn keyword fortranIntrinsicCUDA cudaMemGetInfo cudaMemset cudaMemset2D cudaMemset3D cudaDeviceCanAccessPeer cudaDeviceDisablePeerAccess cudaDeviceEnablePeerAccess cudaPointerGetAttributes cudaDriverGetVersion cudaRuntimeGetVersion + + syn region none matchgroup=fortranType start="<<<" end=">>>" contains=ALLBUT,none +endif + +syn cluster fortranCommentGroup contains=fortranTodo + +if (b:fortran_fixed_source == 1) + if !exists("fortran_have_tabs") + " Fixed format requires a textwidth of 72 for code, + " but some vendor extensions allow longer lines + if exists("fortran_extended_line_length") + syn match fortranSerialNumber excludenl "^.\{133,}$"lc=132 + elseif exists("fortran_cardimage_line_length") + syn match fortranSerialNumber excludenl "^.\{81,}$"lc=80 + else + syn match fortranSerialNumber excludenl "^.\{73,}$"lc=72 + endif + "Flag left margin errors + syn match fortranLabelError "^.\{-,4}[^0-9 ]" contains=fortranTab + syn match fortranLabelError "^.\{4}\d\S" + endif + syn match fortranComment excludenl "^[!c*].*$" contains=@fortranCommentGroup,@spell + syn match fortranLeftMargin transparent "^ \{5}" + syn match fortranContinueMark display "^.\{5}\S"lc=5 +else + syn match fortranContinueMark display "&" +endif + +syn match fortranComment excludenl "!.*$" contains=@fortranCommentGroup,@spell +syn match fortranOpenMP excludenl "^\s*!\$\(OMP\)\=&\=\s.*$" + +"cpp is often used with Fortran +syn match cPreProc "^\s*#\s*\(define\|ifdef\)\>.*" +syn match cPreProc "^\s*#\s*\(elif\|if\)\>.*" +syn match cPreProc "^\s*#\s*\(ifndef\|undef\)\>.*" +syn match cPreCondit "^\s*#\s*\(else\|endif\)\>.*" +syn region cIncluded contained start=+"[^("]+ skip=+\\\\\|\\"+ end=+"+ contains=fortranLeftMargin,fortranContinueMark,fortranSerialNumber +"syn region cIncluded contained start=+"[^("]+ skip=+\\\\\|\\"+ end=+"+ +syn match cIncluded contained "<[^>]*>" +syn match cInclude "^\s*#\s*include\>\s*["<]" contains=cIncluded + +"Synchronising limits assume that comment and continuation lines are not mixed +if exists("fortran_fold") || exists("fortran_more_precise") + syn sync fromstart +elseif (b:fortran_fixed_source == 0) + syn sync linecont "&" minlines=30 +else + syn sync minlines=30 +endif + +if exists("fortran_fold") + + if (b:fortran_fixed_source == 1) + syn region fortranProgram transparent fold keepend start="^\s*program\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\|$\)" contains=ALLBUT,fortranModule + syn region fortranModule transparent fold keepend start="^\s*submodule\s\+(\a\w*\s*\(:\a\w*\s*\)*)\s*\z\(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\|$\)" contains=ALLBUT,fortranProgram,fortranModule + syn region fortranModule transparent fold keepend start="^\s*module\s\+\(procedure\)\@!\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\|$\)" contains=ALLBUT,fortranProgram + syn region fortranFunction transparent fold keepend extend start="^\s*\(elemental \|pure \|impure \|module \|recursive \)\=\s*\(\(\(real \|integer \|logical \|complex \|double \s*precision \)\s*\((\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\|type\s\+(\s*\w\+\s*) \|character \((\(\s*len\s*=\)\=\s*\d\+\s*)\|(\(\s*kind\s*=\)\=\s*\w\+\s*)\)\=\)\=\s*function\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\)" contains=ALLBUT,fortranProgram,fortranModule + syn region fortranSubroutine transparent fold keepend extend start="^\s*\(elemental \|pure \|impure \|module \|recursive \)\=\s*subroutine\s\+\z(\a\w*\)" skip="^\([!c*]\|\s*#\).*$" excludenl end="\\)\=\)" contains=ALLBUT,fortranProgram,fortranModule + syn region fortranBlockData transparent fold keepend start="\) integer :: i, j, k character(len=SL) :: name_in real, dimension(5,5) :: small_matrix +!------------------------[Avoid unused parent warning]-------------------------! !==============================================================================! !----------------------------------------------! diff --git a/Documentation/all_control_keywords b/Documentation/all_control_keywords index 9287c37fa..40e97f147 100644 --- a/Documentation/all_control_keywords +++ b/Documentation/all_control_keywords @@ -14,8 +14,10 @@ SAVE_BACKUP_NAME | skip | name of backup file you want to create SAVE_INITIAL_CONDITION | yes | no SAVE_RESULTS_AT_BOUNDARIES | yes | no + SAVE_RESULTS_UNITS | yes | no SWARM_SAVE_INTERVAL | 60 | any integer > 0 WALL_TIME_MAX_HOURS | 168.0 | any number + PROFILER_INFO | percents | seconds ======================================================================================================================== Numerics ------------------------------------------------------------------------------------------------------------------------ @@ -57,6 +59,7 @@ MAX_SMOOTHING_CYCLES_CURVATURE_VOF | 2 | an integer up to 5 makes sense MAX_SMOOTHING_CYCLES_NORMAL_VOF | 0 | an integer up to 5 should be fine MAX_SUBSTEP_CYCLES_VOF | 100 | any integer + MAX_THREADS | 2 | integers, up to number of cores MIN_SIMPLE_ITERATIONS | 3 | any integer, but better > 2 NORMALIZATION_FOR_ENERGY_SOLVER | 1.0 | any real number, but mostly it is 1.0 NORMALIZATION_FOR_MOMENTUM_SOLVER | 1.0 | any real number, but mostly it is 1.0 @@ -66,6 +69,7 @@ NORMALIZATION_FOR_TURBULENCE_SOLVER | 1.0 | any real number, but mostly it is 1.0 NUMBER_OF_PISO_CORRECTIONS | 3 | any integer up to 10 is reasonable NUMBER_OF_TIME_STEPS | 1200 | any integer, multiples of 30 make sense + NUMBER_OF_SWARM_SUB_STEPS | 12 | any integer, but I would say up to 20 PRECONDITIONER_FOR_SYSTEM_MATRIX | incomplete_cholesky | diagonal, none PRESSURE_MOMENTUM_COUPLING | simple | piso REPORT_VOLUME_BALANCE | no | yes @@ -76,14 +80,14 @@ SIMPLE_UNDERRELAXATION_FOR_TURBULENCE | 0.7 | from 0 to 1, more around 0.5 SIMPLE_UNDERRELAXATION_FOR_VOF | 0.5 | from 0 to 1, around 0.7 should be OK SKEWNESS_CORRECTION_VOF | no | yes - SOLVER_FOR_ENERGY | bicg | cg, cgs - SOLVER_FOR_MOMENTUM | bicg | cg, cgs - SOLVER_FOR_POTENTIAL | cg | bicg, cgs - SOLVER_FOR_PRESSURE | cg | bicg, cgs - SOLVER_FOR_SCALARS | bicg | cg, cgs - SOLVER_FOR_TURBULENCE | bicg | cg, cgs - SOLVER_FOR_VOF | bicg | cg, cgs - SOLVER_FOR_WALL_DISTANCE | cg | cgs, bicg + SOLVER_FOR_ENERGY | bicg | cg + SOLVER_FOR_MOMENTUM | bicg | cg + SOLVER_FOR_POTENTIAL | cg | bicg + SOLVER_FOR_PRESSURE | cg | bicg + SOLVER_FOR_SCALARS | bicg | cg + SOLVER_FOR_TURBULENCE | bicg | cg + SOLVER_FOR_VOF | bicg | cg + SOLVER_FOR_WALL_DISTANCE | cg | bicg TIME_INTEGRATION_SCHEME | linear | parabolic TIME_STEP | 1.0e-2 | any real number, usually < 0.1 TOLERANCE_FOR_GAUSS_GRADIENTS | 1.0e-3 | any small number, but < 1.0e-3 is OK @@ -122,14 +126,14 @@ PARTICLE_TRACKING | no | yes PHASE_DENSITIES | 1.0, 1.0 | two physical properties - densities PHASE_VISCOSITIES | 1.0, 1.0 | two viscosities for two phases - PHASE_CAPACITY | 1.0, 1.0 | thermal capacities for two phases + PHASE_CAPACITIES | 1.0, 1.0 | thermal capacities for two phases PHASE_CONDUCTIVITIES | 1.0, 1.0 | thermal conductivities for two phases POINT_FOR_MONITORING_PLANES | 0.0, 0.0, 0.0 | see MONITORING_POINT above POTENTIAL_INITIALIZATION | no | yes PRESSURE_DROPS | 0.0, 0.0, 0.0 | any triplet of real numbers REFERENCE_DENSITY | 0.0 | real number > 0.0 REFERENCE_TEMPERATURE | 0.0 | real number > 0.0 - ROUGHNESS_COEFFICIENT | 0.0 + ROUGHNESS_COEFFICIENT | 0.0 | real number >= 0.0 ROUGH_WALLS | no | yes SATURATION_TEMPERATURE | 100.0 | depends on liquid and pressure SCALARS_DIFFUSIVITY | 1.0-6 | physical property, usually around 1.0e-9 diff --git a/Sources/Convert/Convert_Mod.f90 b/Sources/Convert/Convert_Mod.f90 index 340dfc4e1..1ede22562 100644 --- a/Sources/Convert/Convert_Mod.f90 +++ b/Sources/Convert/Convert_Mod.f90 @@ -1,8 +1,15 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Convert_Mod !------------------------------------------------------------------------------! !----------------------------------[Modules]-----------------------------------! use Stl_Mod +# ifdef __INTEL_COMPILER + use Ifport ! Intel's module for fseek and ftell +# endif !------------------------------------------------------------------------------! ! Collection of functions used in the Convert program. In honesty, it was ! ! introduced to get rid of the Fortran header files with interfaces which, ! @@ -15,6 +22,7 @@ module Convert_Mod ! Convert type ! !------------------! type Convert_Type + contains procedure :: Allocate_Memory procedure :: Calculate_Geometry @@ -30,9 +38,9 @@ module Convert_Mod procedure :: Load_Gmsh procedure :: Load_Obj procedure :: Logo_Con - procedure :: N_Bnd_Cells_In_Color - procedure :: N_Edges_In_Bnd_Color - procedure :: N_Nodes_In_Bnd_Color + procedure :: N_Bnd_Cells_In_Region + procedure :: N_Edges_In_Region + procedure :: N_Nodes_In_Region procedure :: N_Sharp_Corners procedure :: N_Sharp_Edges procedure :: Sort_Face_Nodes @@ -162,9 +170,9 @@ module Convert_Mod # include "Convert_Mod/Load_Gmsh.f90" # include "Convert_Mod/Load_Obj.f90" # include "Convert_Mod/Logo_Con.f90" -# include "Convert_Mod/N_Bnd_Cells_In_Color.f90" -# include "Convert_Mod/N_Edges_In_Bnd_Color.f90" -# include "Convert_Mod/N_Nodes_In_Bnd_Color.f90" +# include "Convert_Mod/N_Bnd_Cells_In_Region.f90" +# include "Convert_Mod/N_Edges_In_Region.f90" +# include "Convert_Mod/N_Nodes_In_Region.f90" # include "Convert_Mod/N_Sharp_Corners.f90" # include "Convert_Mod/N_Sharp_Edges.f90" # include "Convert_Mod/Sort_Face_Nodes.f90" diff --git a/Sources/Convert/Convert_Mod/Allocate_Memory.f90 b/Sources/Convert/Convert_Mod/Allocate_Memory.f90 index 3bed11d27..b530407d2 100644 --- a/Sources/Convert/Convert_Mod/Allocate_Memory.f90 +++ b/Sources/Convert/Convert_Mod/Allocate_Memory.f90 @@ -9,6 +9,8 @@ subroutine Allocate_Memory(Convert, Grid) type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer, parameter :: F = 3 ! workaround to allocate more memory for bnds +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Allocate memory @@ -25,8 +27,8 @@ subroutine Allocate_Memory(Convert, Grid) call Grid % Allocate_Faces(Grid % n_faces, 0) end if - allocate(Grid % bnd_cond % color(-Grid % n_bnd_cells * F:-1)) - Grid % bnd_cond % color = 0 + allocate(Grid % region % at_cell(-Grid % n_bnd_cells * F:-1)) + Grid % region % at_cell = 0 ! (Dirty) trick to allocate additional memory for cities Grid % n_bnd_cells = Grid % n_bnd_cells / F diff --git a/Sources/Convert/Convert_Mod/Calculate_Geometry.f90 b/Sources/Convert/Convert_Mod/Calculate_Geometry.f90 index a676085b0..00a06140b 100644 --- a/Sources/Convert/Convert_Mod/Calculate_Geometry.f90 +++ b/Sources/Convert/Convert_Mod/Calculate_Geometry.f90 @@ -10,24 +10,6 @@ subroutine Calculate_Geometry(Convert, Grid, ask) ! One of the most distinct differences is the treatment of periodicity. ! ! Here, periodic faces are created from existing (internal) ones, whereas ! ! in Generate_Mod, they are added to existing cells. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Convert_Type) :: Convert - type(Grid_Type) :: Grid - integer, intent(in) :: ask -!-----------------------------------[Locals]-----------------------------------! - integer :: c, c1, c2, n, n1, n2, s, b, i, j - integer :: c11, c12, c21, c22, s1, s2, bou_cen, cnt_bnd, cnt_per - integer :: color_per, n_per, number_faces - real :: xs2, ys2, zs2 - real :: t, tot_surf, dis, min_dis, max_dis - real :: v(3), k(3), v_o(3), v_r(3), theta ! for rotation - real, allocatable :: b_coor_1(:), b_coor_2(:), b_coor_3(:) - integer, allocatable :: b_face(:) - character(SL) :: answer - real :: factor, prod -!==============================================================================! ! ! ! n3 ! ! +---------------!---------------+ ! @@ -105,6 +87,25 @@ subroutine Calculate_Geometry(Convert, Grid, ask) ! t = ----------------------------------------------------------- ! ! rx*sx + ry*sy + rz*sz ! ! ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Convert_Type) :: Convert + type(Grid_Type) :: Grid + integer, intent(in) :: ask +!-----------------------------------[Locals]-----------------------------------! + integer :: c, c1, c2, n, n1, n2, s, b, i, j + integer :: c11, c12, c21, c22, s1, s2, bou_cen, cnt_bnd, cnt_per + integer :: reg_per, n_per, number_faces + real :: xs2, ys2, zs2 + real :: t, tot_surf, dis, min_dis, max_dis + real :: v(3), k(3), v_o(3), v_r(3), theta ! for rotation + real, allocatable :: b_coor_1(:), b_coor_2(:), b_coor_3(:) + integer, allocatable :: b_face(:) + character(SL) :: answer + real :: factor, prod +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! call Profiler % Start('Calculate_Geometry') @@ -288,7 +289,7 @@ subroutine Calculate_Geometry(Convert, Grid, ask) answer = '' do while(answer .ne. 'SKIP') - call Grid % Print_Bnd_Cond_List() + call Grid % Print_Regions_List() n_per = 0 print *, '#==============================================================' print *, '# Enter the ordinal number(s) of periodic-boundary condition(s)' @@ -300,13 +301,13 @@ subroutine Calculate_Geometry(Convert, Grid, ask) call String % To_Upper_Case(answer) if( answer .eq. 'SKIP' ) then - color_per = 0 + reg_per = 0 exit end if - read(Line % tokens(1), *) color_per - if( color_per > Grid % n_bnd_cond ) then - print *, '# Critical error: boundary condition ', color_per, & + read(Line % tokens(1), *) reg_per + if( reg_per > Grid % n_bnd_regions ) then + print *, '# Critical error: boundary condition ', reg_per, & ' doesn''t exist!' print *, '# Exiting! ' stop @@ -322,7 +323,7 @@ subroutine Calculate_Geometry(Convert, Grid, ask) do s = 1, Grid % n_faces c2 = Grid % faces_c(2,s) if(c2 < 0) then - if(Grid % bnd_cond % color(c2) .eq. color_per) then + if(Grid % region % at_cell(c2) .eq. reg_per) then cnt_per = cnt_per + 1 ! This is a dot product of surface vector and vector 1.0, 1.0, 1,0 @@ -354,7 +355,7 @@ subroutine Calculate_Geometry(Convert, Grid, ask) do s = 1, Grid % n_faces c2 = Grid % faces_c(2,s) if(c2 < 0) then - if(Grid % bnd_cond % color(c2) .eq. color_per) then + if(Grid % region % at_cell(c2) .eq. reg_per) then v_o(1) = Grid % xf(s) v_o(2) = Grid % yf(s) v_o(3) = Grid % zf(s) @@ -465,7 +466,7 @@ subroutine Calculate_Geometry(Convert, Grid, ask) cnt_bnd = 0 Grid % new_c = 0 do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .ne. color_per) then + if(Grid % region % at_cell(c) .ne. reg_per) then cnt_bnd = cnt_bnd + 1 Grid % new_c(c) = -cnt_bnd end if @@ -477,7 +478,7 @@ subroutine Calculate_Geometry(Convert, Grid, ask) Grid % xc(Grid % new_c(c)) = Grid % xc(c) Grid % yc(Grid % new_c(c)) = Grid % yc(c) Grid % zc(Grid % new_c(c)) = Grid % zc(c) - Grid % bnd_cond % color(Grid % new_c(c)) = Grid % bnd_cond % color(c) + Grid % region % at_cell(Grid % new_c(c)) = Grid % region % at_cell(c) end if end do @@ -493,38 +494,38 @@ subroutine Calculate_Geometry(Convert, Grid, ask) Grid % n_bnd_cells = cnt_bnd print *, '# Kept boundary cells: ', Grid % n_bnd_cells - !--------------------------------------------------------------------! - ! Remove boundary condition with color_per and compress the rest ! - !--------------------------------------------------------------------! - if(color_per < Grid % n_bnd_cond) then + !------------------------------------------------------------------! + ! Remove boundary condition with reg_per and compress the rest ! + !------------------------------------------------------------------! + if(reg_per < Grid % n_bnd_regions) then - ! Set the color of boundary selected to be periodic to zero + ! Set the regions of boundary selected to be periodic to zero do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .eq. color_per) then - Grid % bnd_cond % color(c) = 0 + if(Grid % region % at_cell(c) .eq. reg_per) then + Grid % region % at_cell(c) = 0 end if end do ! Shift the rest of the boundary cells - do b = 1, Grid % n_bnd_cond - 1 - if(b .ge. color_per) then + do b = 1, Grid % n_bnd_regions - 1 + if(b .ge. reg_per) then ! Correct the names - Grid % bnd_cond % name(b) = Grid % bnd_cond % name (b+1) + Grid % region % name(b) = Grid % region % name (b+1) - ! Correct all boundary colors too + ! Correct all boundary regions too do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .eq. (b+1)) then - Grid % bnd_cond % color(c) = b + if(Grid % region % at_cell(c) .eq. (b+1)) then + Grid % region % at_cell(c) = b end if end do end if end do else - Grid % bnd_cond % name(Grid % n_bnd_cond) = '' + Grid % region % name(Grid % n_bnd_regions) = '' end if - Grid % n_bnd_cond = Grid % n_bnd_cond - 1 + Grid % n_bnd_regions = Grid % n_bnd_regions - 1 end do ! while answer .ne. 'SKIP' end if ! ask == 0 diff --git a/Sources/Convert/Convert_Mod/Create_Dual.f90 b/Sources/Convert/Convert_Mod/Create_Dual.f90 index aaa072551..d7c00ff75 100644 --- a/Sources/Convert/Convert_Mod/Create_Dual.f90 +++ b/Sources/Convert/Convert_Mod/Create_Dual.f90 @@ -14,7 +14,7 @@ subroutine Create_Dual(Convert, Prim, Dual) integer :: n_p, n_d, f_d, b_d, f_p, c_p, cnt integer, allocatable :: full_edge_n (:,:) ! edges, nodes integer, allocatable :: full_edge_fb(:) ! edges' faces at boundary - integer, allocatable :: full_edge_bc(:) ! edges' faces boundary colors + integer, allocatable :: full_edge_bc(:) ! edges' faces boundary regions integer, allocatable :: comp_edge_f(:) ! compressed edge first integer, allocatable :: comp_edge_l(:) ! compressed edge last integer, allocatable :: cell_to_node(:) @@ -33,7 +33,7 @@ subroutine Create_Dual(Convert, Prim, Dual) !==============================================================================! ! Alias(es) - n_bc = Prim % n_bnd_cond + n_bc = Prim % n_bnd_regions !-----------------------------! ! ! @@ -87,7 +87,7 @@ subroutine Create_Dual(Convert, Prim, Dual) if(c2 > 0) then full_edge_bc(Prim % n_edges) = 0 ! not a boundary face else - full_edge_bc(Prim % n_edges) = Prim % bnd_cond % color(c2) ! store color + full_edge_bc(Prim % n_edges) = Prim % region % at_cell(c2) ! store reg end if end do end do @@ -191,11 +191,10 @@ subroutine Create_Dual(Convert, Prim, Dual) ! numbers and names ! ! ! !-------------------------! - Dual % n_bnd_cond = Prim % n_bnd_cond - allocate(Dual % bnd_cond % name(Dual % n_bnd_cond)) - do bc = 1, Prim % n_bnd_cond - Dual % bnd_cond % name(bc) = Prim % bnd_cond % name(bc) - call String % To_Upper_Case(Dual % bnd_cond % name(bc)) + call Dual % Allocate_Regions(Prim % n_bnd_regions) + do bc = 1, Prim % n_bnd_regions + Dual % region % name(bc) = Prim % region % name(bc) + call String % To_Upper_Case(Dual % region % name(bc)) end do !----------------------------------! @@ -217,9 +216,9 @@ subroutine Create_Dual(Convert, Prim, Dual) ! Count boundary cells (and boundary faces) for the Dual grid ! (Remember that nodes in Prim correspond to cells in Dual) Dual % n_bnd_cells = 0 - do bc = 1, Prim % n_bnd_cond + do bc = 1, Prim % n_bnd_regions Dual % n_bnd_cells = Dual % n_bnd_cells & - + Convert % N_Nodes_In_Bnd_Color(Prim, bc, node_data) + + Convert % N_Nodes_In_Region(Prim, bc, node_data) end do Dual % n_faces = Prim % n_edges & ! for faces inside + Dual % n_bnd_cells ! for faces on the boundary @@ -361,14 +360,14 @@ subroutine Create_Dual(Convert, Prim, Dual) curr_f_d = Prim % n_edges curr_b_d = 0 - do bc = 1, Prim % n_bnd_cond + do bc = 1, Prim % n_bnd_regions - !----------------------------------------------------! - ! Call this to mark boundary cells in this color ! - !----------------------------------------------------! - dual_f_here = Convert % N_Nodes_In_Bnd_Color(Prim, bc, node_data) - unused = Convert % N_Bnd_Cells_In_Color(Prim, bc, cell_data) - unused = Convert % N_Edges_In_Bnd_Color(Prim, bc, edge_data) + !-----------------------------------------------------! + ! Call this to mark boundary cells in this region ! + !-----------------------------------------------------! + dual_f_here = Convert % N_Nodes_In_Region(Prim, bc, node_data) + unused = Convert % N_Bnd_Cells_In_Region(Prim, bc, cell_data) + unused = Convert % N_Edges_In_Region(Prim, bc, edge_data) !-----------------------------------------! ! Find Dual's boundary face, and Dual ! @@ -391,7 +390,7 @@ subroutine Create_Dual(Convert, Prim, Dual) Dual % cells_n_nodes(b_d) = Dual % cells_n_nodes(b_d) + 1 call Adjust_First_Dim(Dual % cells_n_nodes(b_d), Dual % cells_n) Dual % cells_n(Dual % cells_n_nodes(b_d), b_d) = cell_to_node(c) - Dual % bnd_cond % color(b_d) = bc + Dual % region % at_cell(b_d) = bc ! Store node_to_face (for the next step, adding edges) node_to_face(n_p) = f_d diff --git a/Sources/Convert/Convert_Mod/Find_Faces.f90 b/Sources/Convert/Convert_Mod/Find_Faces.f90 index db0432a28..8a7916615 100644 --- a/Sources/Convert/Convert_Mod/Find_Faces.f90 +++ b/Sources/Convert/Convert_Mod/Find_Faces.f90 @@ -22,13 +22,15 @@ subroutine Find_Faces(Convert, Grid) type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: c, c1, c2, n1, n2, n3, f_nod(4) - integer :: n_match, i_fac, match_nodes(-1:8) - integer :: i1, i2, i_nod, cnt + integer :: n_match, i_fac, max_fac, match_nodes(-1:8) + integer :: i1, i2, i_nod, max_nod, cnt integer :: fn(6,4) integer, allocatable :: face_n1(:) integer, allocatable :: face_n2(:) integer, allocatable :: face_n3(:) integer, allocatable :: face_cell(:), starts(:), ends(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! call Profiler % Start('Find_Faces') @@ -44,6 +46,30 @@ subroutine Find_Faces(Convert, Grid) allocate(starts (Grid % n_cells*6)); starts (:) = 0 allocate(ends (Grid % n_cells*6)); ends (:) = 0 + !---------------------------------------------------! + ! Find max number of cells' faces for this grid ! + !---------------------------------------------------! + max_fac = 0 + do c = 1, Grid % n_cells + if(Grid % cells_n_nodes(c) .eq. 4) max_fac = max(max_fac, 4) + if(Grid % cells_n_nodes(c) .eq. 5) max_fac = max(max_fac, 5) + if(Grid % cells_n_nodes(c) .eq. 6) max_fac = max(max_fac, 5) + if(Grid % cells_n_nodes(c) .eq. 8) max_fac = max(max_fac, 6) + end do + Assert(max_fac .ne. 0) + + !---------------------------------------------------! + ! Find max number of faces' nodes for this grid ! + !---------------------------------------------------! + max_nod = 0 + do c = 1, Grid % n_cells + if(Grid % cells_n_nodes(c) .eq. 4) max_nod = max(max_nod, 3) + if(Grid % cells_n_nodes(c) .eq. 5) max_nod = max(max_nod, 4) + if(Grid % cells_n_nodes(c) .eq. 6) max_nod = max(max_nod, 4) + if(Grid % cells_n_nodes(c) .eq. 8) max_nod = max(max_nod, 4) + end do + Assert(max_nod .ne. 0) + !---------------------------------------------------! ! Fill the generic coordinates with some values ! !---------------------------------------------------! @@ -52,11 +78,11 @@ subroutine Find_Faces(Convert, Grid) if(Grid % cells_n_nodes(c) .eq. 5) fn = PYR if(Grid % cells_n_nodes(c) .eq. 6) fn = WED if(Grid % cells_n_nodes(c) .eq. 8) fn = HEX - do i_fac = 1, 6 - if(Grid % cells_bnd_color(i_fac, c) .eq. 0) then + do i_fac = 1, max_fac + if(Grid % cells_bnd_region(i_fac, c) .eq. 0) then ! Fetch face nodes (-1 becomes HUGE_INT and it will be the biggest) - do i_nod = 1, 4 + do i_nod = 1, max_nod f_nod(i_nod) = HUGE_INT if(fn(i_fac, i_nod) > 0) then f_nod(i_nod) = Grid % cells_n(fn(i_fac, i_nod), c) @@ -87,8 +113,6 @@ subroutine Find_Faces(Convert, Grid) !------------------------------------------------! ! Anotate cell faces with same coordinates ! - ! (I am afraid that this might be influenced ! - ! by the numerical round-off errors) ! !------------------------------------------------! cnt = 1 starts(1) = 1 @@ -107,8 +131,10 @@ subroutine Find_Faces(Convert, Grid) ! Main loop to fill the faces_c structure ! ! ! !---------------------------------------------! - call Adjust_First_Dim(6, Grid % cells_c) ! i_fac goes to 6 - call Adjust_First_Dim(4, Grid % faces_n) ! i_nod goes to 4 + call Adjust_First_Dim(max_fac, Grid % cells_c) ! i_fac goes to max_fac + call Adjust_First_Dim(max_nod, Grid % faces_n) ! i_nod goes to max_nod + Assert(maxval(maxval(Grid % cells_c, dim=2), dim=1) == 0) + do n3 = 1, cnt if(starts(n3) .ne. ends(n3)) then do i1=starts(n3),ends(n3) @@ -144,7 +170,7 @@ subroutine Find_Faces(Convert, Grid) if(Grid % cells_n_nodes(c1) .eq. 5) fn = PYR if(Grid % cells_n_nodes(c1) .eq. 6) fn = WED if(Grid % cells_n_nodes(c1) .eq. 8) fn = HEX - do i_fac = 1, 6 + do i_fac = 1, max_fac if(Grid % cells_c(i_fac, c1) .eq. 0 .and. & ! not set yet ( max( match_nodes(fn(i_fac, 1)),0 ) + & max( match_nodes(fn(i_fac, 2)),0 ) + & @@ -154,7 +180,7 @@ subroutine Find_Faces(Convert, Grid) Grid % faces_c(1,Grid % n_faces) = c1 Grid % faces_c(2,Grid % n_faces) = c2 Grid % faces_n_nodes(Grid % n_faces) = n_match - do i_nod = 1, 4 + do i_nod = 1, max_nod if(fn(i_fac, i_nod) > 0) then Grid % faces_n(i_nod,Grid % n_faces) = & Grid % cells_n(fn(i_fac, i_nod), c1) diff --git a/Sources/Convert/Convert_Mod/Find_Parents.f90 b/Sources/Convert/Convert_Mod/Find_Parents.f90 index 81294ac58..b367fe64e 100644 --- a/Sources/Convert/Convert_Mod/Find_Parents.f90 +++ b/Sources/Convert/Convert_Mod/Find_Parents.f90 @@ -12,12 +12,14 @@ subroutine Find_Parents(Convert, Grid) type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: fn(6,4), i_fac, j_fac, i_nod, i_cel, c1, c2 - integer :: nodes(4), n_match, dir, bc, cnt_c, cnt_f + integer :: nodes(4), n_match, n_match_tot, dir, bc, cnt_c, cnt_f integer :: n_face_nodes ! number of nodes in a face integer :: n_cell_faces ! number of faces in a cell logical, allocatable :: is_node_bnd(:) integer, allocatable :: cell_near_bnd(:) integer, allocatable :: cr1(:), cr2(:), cr3(:), w1(:), w2(:) ! for sorting +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! call Profiler % Start('Find_Parents') @@ -37,7 +39,7 @@ subroutine Find_Parents(Convert, Grid) file=__FILE__, line=__LINE__) end if - allocate(is_node_bnd(Grid % n_nodes)); is_node_bnd(:) = .false. + allocate(is_node_bnd (Grid % n_nodes)); is_node_bnd(:) = .false. allocate(cell_near_bnd(Grid % n_cells)); cell_near_bnd(:) = 0 !--------------------------------------------------------------! @@ -47,7 +49,7 @@ subroutine Find_Parents(Convert, Grid) ! Mark all nodes on the boundary is_node_bnd(:) = .false. do c2 = -Grid % n_bnd_cells, -1 - if( Grid % bnd_cond % color(c2) .gt. 0 ) then + if( Grid % region % at_cell(c2) .gt. 0 ) then do i_nod = 1, Grid % cells_n_nodes(c2) ! 3 or 4 is_node_bnd( Grid % cells_n(i_nod, c2) ) = .true. end do @@ -83,8 +85,9 @@ subroutine Find_Parents(Convert, Grid) !----------------------! ! Real work begins ! !----------------------! + n_match_tot = 0 - do bc = 1, Grid % n_bnd_cond + do bc = Boundary_Regions() cr1(:) = HUGE_INT cr2(:) = HUGE_INT @@ -94,7 +97,7 @@ subroutine Find_Parents(Convert, Grid) cnt_f = 0 do c2 = -Grid % n_bnd_cells, -1 - if( Grid % bnd_cond % color(c2) .eq. bc ) then + if( Grid % region % at_cell(c2) .eq. bc ) then ! Increase total face count cnt_f = cnt_f + 1 @@ -180,15 +183,32 @@ subroutine Find_Parents(Convert, Grid) c1 = w1(j_fac) dir = w2(j_fac) end if - Grid % cells_bnd_color(dir, c1) = bc + Grid % cells_bnd_region(dir, c1) = bc end if end if end do + print *, '# Number of matches: ', n_match + n_match_tot = n_match_tot + n_match end do ! bc + if(n_match_tot .ne. Grid % n_bnd_cells) then + call Message % Warning(80, & + 'Number of boundary cells found here is not the same as ' // & + 'the number of boundary cells prescribed in Gmsh. Possible ' // & + 'cause for it is that some internal faces in Gmsh are ' // & + 'marked as boundary conditions (physical groups). \n \n ' // & + 'It might also be that you deleted some volumes in Gmsh ' // & + 'intentionally to ensure conformal mappings for simulations '// & + 'in multiple domains. If that is the case, it is probably ' // & + 'safe to ignore this warning. \n \n ' // & + 'It is, nonetheless, advised to check the Gmsh mesh for ' // & + 'physical groups.', & + file=__FILE__, line=__LINE__) + end if + call Profiler % Stop('Find_Parents') end subroutine diff --git a/Sources/Convert/Convert_Mod/Grid_Topology.f90 b/Sources/Convert/Convert_Mod/Grid_Topology.f90 index be7e4f17b..6aac2b930 100644 --- a/Sources/Convert/Convert_Mod/Grid_Topology.f90 +++ b/Sources/Convert/Convert_Mod/Grid_Topology.f90 @@ -19,6 +19,8 @@ subroutine Grid_Topology(Convert, Grid) type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: i, j +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! call Profiler % Start('Grid_Topology') @@ -30,13 +32,14 @@ subroutine Grid_Topology(Convert, Grid) Grid % n_faces = 0 do i = 1, Grid % n_cells do j = 1, 6 - if(Grid % cells_bnd_color(j,i) .ne. 0) then + if(Grid % cells_bnd_region(j,i) .ne. 0) then Grid % n_bnd_cells = Grid % n_bnd_cells + 1 - ! Grid % bnd_cond % color - Grid % bnd_cond % color(-Grid % n_bnd_cells) = & - Grid % cells_bnd_color(j,i) + ! Grid % region % at_cell + Grid % region % at_cell(-Grid % n_bnd_cells) & + = Grid % cells_bnd_region(j,i) + ! Faces Grid % n_faces = Grid % n_faces + 1 Grid % faces_c(1,Grid % n_faces) = i diff --git a/Sources/Convert/Convert_Mod/Guess_Format.f90 b/Sources/Convert/Convert_Mod/Guess_Format.f90 index c824fc5d4..a49d10b7f 100644 --- a/Sources/Convert/Convert_Mod/Guess_Format.f90 +++ b/Sources/Convert/Convert_Mod/Guess_Format.f90 @@ -14,6 +14,8 @@ subroutine Guess_Format(Convert, file_name, file_format) character(SL), intent(out) :: file_format !-----------------------------------[Locals]-----------------------------------! integer :: l, fu +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! !----------------------------! diff --git a/Sources/Convert/Convert_Mod/Insert_Buildings.f90 b/Sources/Convert/Convert_Mod/Insert_Buildings.f90 index 000cf0979..cf5c8f7b3 100644 --- a/Sources/Convert/Convert_Mod/Insert_Buildings.f90 +++ b/Sources/Convert/Convert_Mod/Insert_Buildings.f90 @@ -242,8 +242,8 @@ subroutine Insert_Buildings(Convert, Grid) n_ground_cells = 0 do c = 1, Grid % n_cells do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .ne. 0) then - bc_name = trim(Grid % bnd_cond % name(Grid % cells_bnd_color(dir, c))) + if(Grid % cells_bnd_region(dir, c) .ne. 0) then + bc_name = trim(Grid % region % name(Grid % cells_bnd_region(dir, c))) call String % To_Upper_Case(bc_name) if(bc_name(1:8) .eq. 'BUILDING' .or. & bc_name .eq. 'GROUND') then @@ -316,7 +316,7 @@ subroutine Insert_Buildings(Convert, Grid) do c = 1, Grid % n_cells i_work_1(c) = Grid % cells_n_nodes(c) i_work_2(1:8, c) = Grid % cells_n(1:8, c) - i_work_3(1:6, c) = Grid % cells_bnd_color(1:6, c) + i_work_3(1:6, c) = Grid % cells_bnd_region(1:6, c) end do !--------------------------! @@ -346,9 +346,9 @@ subroutine Insert_Buildings(Convert, Grid) ! Do the sorting of data pertinent to cells ! !-----------------------------------------------! do c = 1, Grid % n_cells - Grid % cells_n_nodes (new_c(c)) = i_work_1(c) - Grid % cells_n (1:8, new_c(c)) = i_work_2(1:8, c) - Grid % cells_bnd_color(1:6, new_c(c)) = i_work_3(1:6, c) + Grid % cells_n_nodes (new_c(c)) = i_work_1(c) + Grid % cells_n (1:8, new_c(c)) = i_work_2(1:8, c) + Grid % cells_bnd_region(1:6, new_c(c)) = i_work_3(1:6, c) end do call Sort % Real_By_Index(Grid % n_cells, Grid % xc(1), new_c(1)) call Sort % Real_By_Index(Grid % n_cells, Grid % yc(1), new_c(1)) @@ -386,8 +386,8 @@ subroutine Insert_Buildings(Convert, Grid) cell_in_building(:) = .false. do c = 1, Grid % n_cells do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .ne. 0) then - bc_name = trim(Grid % bnd_cond % name(Grid % cells_bnd_color(dir, c))) + if(Grid % cells_bnd_region(dir, c) .ne. 0) then + bc_name = trim(Grid % region % name(Grid % cells_bnd_region(dir, c))) call String % To_Upper_Case(bc_name) if(bc_name(1:8) .eq. 'BUILDING') then read(bc_name(10:12), *) height @@ -408,8 +408,8 @@ subroutine Insert_Buildings(Convert, Grid) n_chimneys = 0 allocate(cell_in_chimney(Grid % n_cells)) cell_in_chimney(:) = 0 - do bc = 1, Grid % n_bnd_cond - bc_name = trim(Grid % bnd_cond % name(bc)) + do bc = Boundary_Regions() + bc_name = trim(Grid % region % name(bc)) call String % To_Upper_Case(bc_name) if(bc_name(1:7) .eq. 'CHIMNEY') then @@ -420,7 +420,7 @@ subroutine Insert_Buildings(Convert, Grid) do c = 1, Grid % n_cells do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .eq. bc) then + if(Grid % cells_bnd_region(dir, c) .eq. bc) then do cu = c, c + n_hor_layers - 1 if(Grid % zc(cu) - height >= Grid % zc(c)) exit cell_in_chimney(cu) = chimney ! mark cell as in this chimney @@ -474,8 +474,8 @@ subroutine Insert_Buildings(Convert, Grid) !-----------------------------------------------------------! ! Find ground b.c. number (only used to eliminate BUILDING_000) - do bc = 1, Grid % n_bnd_cond - bc_name = trim(Grid % bnd_cond % name(bc)) + do bc = Boundary_Regions() + bc_name = trim(Grid % region % name(bc)) call String % To_Upper_Case(bc_name) if(bc_name .eq. 'GROUND') then ground_bc = bc @@ -483,14 +483,14 @@ subroutine Insert_Buildings(Convert, Grid) end do ! Eliminate building_000 b.c. - do bc = 1, Grid % n_bnd_cond - bc_name = trim(Grid % bnd_cond % name(bc)) + do bc = Boundary_Regions() + bc_name = trim(Grid % region % name(bc)) call String % To_Upper_Case(bc_name) if(bc_name .eq. 'BUILDING_000') then do c = 1, Grid % n_cells do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .eq. bc) then - Grid % cells_bnd_color(dir, c) = ground_bc + if(Grid % cells_bnd_region(dir, c) .eq. bc) then + Grid % cells_bnd_region(dir, c) = ground_bc end if end do end do @@ -498,39 +498,39 @@ subroutine Insert_Buildings(Convert, Grid) end do cnt = 0 - do bc = 1, Grid % n_bnd_cond - bc_name = trim(Grid % bnd_cond % name(bc)) + do bc = Boundary_Regions() + bc_name = trim(Grid % region % name(bc)) call String % To_Upper_Case(bc_name) if(bc_name(1:8) .ne. 'BUILDING') then cnt = cnt + 1 - Grid % bnd_cond % name(cnt) = Grid % bnd_cond % name(bc) + Grid % region % name(cnt) = Grid % region % name(bc) do c = 1, Grid % n_cells do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .eq. bc) then - Grid % cells_bnd_color(dir, c) = cnt + if(Grid % cells_bnd_region(dir, c) .eq. bc) then + Grid % cells_bnd_region(dir, c) = cnt end if end do end do end if end do - Grid % n_bnd_cond = cnt + Grid % n_bnd_regions = cnt ! Shift all by one up (to be able to insert building walls as first) if(buildings_exist) then - do bc = Grid % n_bnd_cond, 1, -1 - Grid % bnd_cond % name(bc+1) = Grid % bnd_cond % name(bc) + do bc = Grid % n_bnd_regions, 1, -1 + Grid % region % name(bc+1) = Grid % region % name(bc) do c = 1, Grid % n_cells do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .eq. bc) then - Grid % cells_bnd_color(dir, c) = bc+1 + if(Grid % cells_bnd_region(dir, c) .eq. bc) then + Grid % cells_bnd_region(dir, c) = bc+1 end if end do end do end do - Grid % n_bnd_cond = Grid % n_bnd_cond + 1 + Grid % n_bnd_regions = Grid % n_bnd_regions + 1 ! Add first boundary condition for walls - Grid % bnd_cond % name(1) = 'BUILDING_WALLS' + Grid % region % name(1) = 'BUILDING_WALLS' end if !------------------------------------------------------------! @@ -552,7 +552,7 @@ subroutine Insert_Buildings(Convert, Grid) do c = 1, Grid % n_cells i_work_1(c) = Grid % cells_n_nodes(c) i_work_2(1:8, c) = Grid % cells_n(1:8, c) - i_work_3(1:6, c) = Grid % cells_bnd_color(1:6, c) + i_work_3(1:6, c) = Grid % cells_bnd_region(1:6, c) end do !------------------------------------------------------! @@ -578,7 +578,7 @@ subroutine Insert_Buildings(Convert, Grid) if(new_c(c) .ne. 0) then Grid % cells_n_nodes (new_c(c)) = i_work_1(c) Grid % cells_n (1:8, new_c(c)) = i_work_2(1:8, c) - Grid % cells_bnd_color(1:6, new_c(c)) = i_work_3(1:6, c) + Grid % cells_bnd_region(1:6, new_c(c)) = i_work_3(1:6, c) end if end do Grid % n_cells = cnt @@ -605,7 +605,7 @@ subroutine Insert_Buildings(Convert, Grid) if(Grid % cells_n_nodes(c) .eq. 8) fn = HEX do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .eq. 0) then + if(Grid % cells_bnd_region(dir, c) .eq. 0) then n_f_nod = 0 f_nod(1:4) = -1 @@ -626,13 +626,13 @@ subroutine Insert_Buildings(Convert, Grid) node_on_building(f_nod(2)) .and. & node_on_building(f_nod(3)) .and. & node_on_building(f_nod(4)) ) then - Grid % cells_bnd_color(dir, c) = 1 + Grid % cells_bnd_region(dir, c) = 1 end if else if( node_on_building(f_nod(1)) .and. & node_on_building(f_nod(2)) .and. & node_on_building(f_nod(3)) ) then - Grid % cells_bnd_color(dir, c) = 1 + Grid % cells_bnd_region(dir, c) = 1 end if end if end if @@ -642,8 +642,8 @@ subroutine Insert_Buildings(Convert, Grid) end if - do bc = 1, Grid % n_bnd_cond - bc_name = trim(Grid % bnd_cond % name(bc)) + do bc = Boundary_Regions() + bc_name = trim(Grid % region % name(bc)) call String % To_Upper_Case(bc_name) if(bc_name(1:7) .eq. 'CHIMNEY') then @@ -657,7 +657,7 @@ subroutine Insert_Buildings(Convert, Grid) if(Grid % cells_n_nodes(c) .eq. 8) fn = HEX do dir = 1, 6 - if(Grid % cells_bnd_color(dir, c) .eq. 0) then + if(Grid % cells_bnd_region(dir, c) .eq. 0) then n_f_nod = 0 f_nod(1:4) = -1 @@ -678,13 +678,13 @@ subroutine Insert_Buildings(Convert, Grid) node_on_chimney(f_nod(2)) .eq. chimney .and. & node_on_chimney(f_nod(3)) .eq. chimney .and. & node_on_chimney(f_nod(4)) .eq. chimney ) then - Grid % cells_bnd_color(dir, c) = bc + Grid % cells_bnd_region(dir, c) = bc end if else if( node_on_chimney(f_nod(1)) .eq. chimney .and. & node_on_chimney(f_nod(2)) .eq. chimney .and. & node_on_chimney(f_nod(3)) .eq. chimney ) then - Grid % cells_bnd_color(dir, c) = bc + Grid % cells_bnd_region(dir, c) = bc end if end if end if diff --git a/Sources/Convert/Convert_Mod/Load_Fluent.f90 b/Sources/Convert/Convert_Mod/Load_Fluent.f90 index f10b628f3..625fe2c84 100644 --- a/Sources/Convert/Convert_Mod/Load_Fluent.f90 +++ b/Sources/Convert/Convert_Mod/Load_Fluent.f90 @@ -9,7 +9,21 @@ subroutine Load_Fluent(Convert, Grid, file_name) type(Grid_Type) :: Grid character(SL) :: file_name !----------------------------------[Calling]-----------------------------------! - integer(DP) :: ftell +# ifdef __NVCOMPILER_LLVM__ + integer :: ftell ! needed for Nvidia compiler +# endif +!------------------------------[Local parameters]------------------------------! + integer, parameter :: MIXED_ZONE = 0 + integer, parameter :: CELL_TRI = 1 + integer, parameter :: CELL_TETRA = 2 + integer, parameter :: CELL_QUAD = 3 + integer, parameter :: CELL_HEXA = 4 + integer, parameter :: CELL_PYRA = 5 + integer, parameter :: CELL_WEDGE = 6 + integer, parameter :: CELL_POLY = 7 + integer, parameter :: FACE_TRI = 3 + integer, parameter :: FACE_QUAD = 4 + integer, parameter :: FACE_POLY = 5 ! an educated guess, but seems good !-----------------------------------[Locals]-----------------------------------! character(SL) :: one_token character(1) :: one_char @@ -17,7 +31,7 @@ subroutine Load_Fluent(Convert, Grid, file_name) integer :: n_tri, n_quad, n_tet, n_hexa, n_pyra, n_wed, n_poly integer :: n_cells, n_bnd_cells, n_faces, n_nodes integer :: n_face_nodes, n_cells_zone - integer :: c, c1, c2, s, n, fu, i, l, pos, length + integer :: c, c1, c2, s, n, fu, i, l, pos, length, error integer :: i_cel, i_nod, j_nod, k_nod, l_nod, i_fac integer :: cell_type, zone_type integer :: cell_f, cell_l, side_f, side_l, node_f, node_l @@ -25,24 +39,12 @@ subroutine Load_Fluent(Convert, Grid, file_name) integer :: n_face_sect ! number of face sections integer :: face_sect_pos(2048) ! where did Fluent store it integer :: face_sect_bnd(2048) ! where does T-Flows store it - integer :: n_bnd_cond ! number of boundary conditions + integer :: n_bnd_reg ! number of boundary conditions logical :: this_sect_bnd ! .true. if bnd cond section logical :: the_end ! end of file reached? logical :: ascii ! is file in ascii format? integer, allocatable :: cell_visited_from(:), cell_types(:) character, allocatable :: very_long_line(:) -!------------------------------[Local parameters]------------------------------! - integer, parameter :: MIXED_ZONE = 0 - integer, parameter :: CELL_TRI = 1 - integer, parameter :: CELL_TETRA = 2 - integer, parameter :: CELL_QUAD = 3 - integer, parameter :: CELL_HEXA = 4 - integer, parameter :: CELL_PYRA = 5 - integer, parameter :: CELL_WEDGE = 6 - integer, parameter :: CELL_POLY = 7 - integer, parameter :: FACE_TRI = 3 - integer, parameter :: FACE_QUAD = 4 - integer, parameter :: FACE_POLY = 5 ! just a guess !==============================================================================! call Profiler % Start('Load_Fluent') @@ -131,7 +133,7 @@ subroutine Load_Fluent(Convert, Grid, file_name) face_sect_pos(:) = 0 face_sect_bnd(:) = 0 n_face_sect = 0 - n_bnd_cond = 0 + n_bnd_reg = 0 n_bnd_cells = 0 n_faces = 0 the_end = .false. @@ -233,10 +235,10 @@ subroutine Load_Fluent(Convert, Grid, file_name) if( this_sect_bnd ) then ! Increase the number of boundary condition sections and ... - n_bnd_cond = n_bnd_cond + 1 + n_bnd_reg = n_bnd_reg + 1 ! ... store mapping of this face section to T-Flows boundary condition - face_sect_bnd(n_face_sect) = n_bnd_cond + face_sect_bnd(n_face_sect) = n_bnd_reg end if end if @@ -250,11 +252,10 @@ subroutine Load_Fluent(Convert, Grid, file_name) end if print '(a34,i9)', ' # Boundary cells from face data: ', n_bnd_cells - print '(a34,i9)', ' # Boundary condition sections: ', n_bnd_cond + print '(a34,i9)', ' # Boundary condition sections: ', n_bnd_reg Grid % n_bnd_cells = n_bnd_cells - Grid % n_bnd_cond = n_bnd_cond - allocate(Grid % bnd_cond % name(n_bnd_cond)) + call Grid % Allocate_Regions(n_bnd_reg) !--------------------------------------------! ! ! @@ -434,7 +435,12 @@ subroutine Load_Fluent(Convert, Grid, file_name) ! Find out the Line length offset = ftell(fu) ! mark offset length = File % Line_Length(fu) ! read the Line - call fseek(fu, offset, 0) ! go back +# ifdef __INTEL_COMPILER + error = fseek(fu, offset, 0) +# else + error = 0 + call fseek(fu, offset, 0) +# endif ! Allocate helping arrays allocate(very_long_line(length)) ! allocate very long Line @@ -652,14 +658,14 @@ subroutine Load_Fluent(Convert, Grid, file_name) n_bnd_cells = n_bnd_cells + 1 Grid % faces_c(1, s) = c2 Grid % faces_c(2, s) = -n_bnd_cells - Grid % bnd_cond % color(-n_bnd_cells) = face_sect_bnd(n_face_sect) + Grid % region % at_cell(-n_bnd_cells) = face_sect_bnd(n_face_sect) ! Case when c2 is a boundary cell else if(c2 .eq. 0) then n_bnd_cells = n_bnd_cells + 1 Grid % faces_c(1, s) = c1 Grid % faces_c(2, s) = -n_bnd_cells - Grid % bnd_cond % color(-n_bnd_cells) = face_sect_bnd(n_face_sect) + Grid % region % at_cell(-n_bnd_cells) = face_sect_bnd(n_face_sect) ! Neither c1 nor c2 are boundary cells else @@ -1085,7 +1091,7 @@ subroutine Load_Fluent(Convert, Grid, file_name) if(face_sect_bnd(n) .ne. 0) then if(face_sect_pos(n) .eq. pos) then call String % To_Upper_Case(one_token) - Grid % bnd_cond % name(face_sect_bnd(n)) = one_token + Grid % region % name(face_sect_bnd(n)) = one_token end if end if end do diff --git a/Sources/Convert/Convert_Mod/Load_Forrest.f90 b/Sources/Convert/Convert_Mod/Load_Forrest.f90 index adae84ece..2638e1ca1 100644 --- a/Sources/Convert/Convert_Mod/Load_Forrest.f90 +++ b/Sources/Convert/Convert_Mod/Load_Forrest.f90 @@ -10,12 +10,14 @@ subroutine Load_Forrest(Convert, Grid, file_name) character(SL) :: file_name !-----------------------------------[Locals]-----------------------------------! type(Stl_Type) :: Forrest - integer :: fu, s, i_nod, v, fac, attempts + integer :: s, i_nod, v, fac, attempts integer :: n_trees, t1, t2, t, n0, n1, n2 real :: f_min_x, f_max_x, f_min_y, f_max_y, f_min_z, f_max_z real :: n(3) real :: delta_x, delta_y, min_dist, tmp real, allocatable :: t_x(:), t_y(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! call Profiler % Start('Load_Forrest') @@ -42,8 +44,6 @@ subroutine Load_Forrest(Convert, Grid, file_name) print '(a,2f9.3)', ' # Forrest span in y directon: ', f_min_y, f_max_y print '(a,2f9.3)', ' # Forrest span in z directon: ', f_min_z, f_max_z - close(fu) - ! Scale the single tree by forrest height Grid(1) % zn(:) = Grid(1) % zn - f_min_z Grid(1) % xn(:) = Grid(1) % xn * (f_max_z - f_min_z) diff --git a/Sources/Convert/Convert_Mod/Load_Gambit.f90 b/Sources/Convert/Convert_Mod/Load_Gambit.f90 index c36b04229..c36a1ac6b 100644 --- a/Sources/Convert/Convert_Mod/Load_Gambit.f90 +++ b/Sources/Convert/Convert_Mod/Load_Gambit.f90 @@ -161,18 +161,17 @@ subroutine Load_Gambit(Convert, Grid, file_name) !-------------------------! ! Boundary conditions ! !-------------------------! - Grid % n_bnd_cond = n_bnd_sect - allocate(Grid % bnd_cond % name(n_bnd_sect)) + call Grid % Allocate_Regions(n_bnd_sect) do j = 1, n_bnd_sect call File % Read_Line(fu) ! BOUNDARY CONDITIONS call File % Read_Line(fu) call String % To_Upper_Case(Line % tokens(1)) - Grid % bnd_cond % name(j) = Line % tokens(1) + Grid % region % name(j) = Line % tokens(1) read(Line % tokens(3),'(i8)') dum1 do i = 1, dum1 read(fu,*) c, dum2, dir - Grid % cells_bnd_color(dir,c) = j + Grid % cells_bnd_region(dir,c) = j end do call File % Read_Line(fu) ! ENDOFSECTION end do @@ -180,7 +179,7 @@ subroutine Load_Gambit(Convert, Grid, file_name) !------------------------------------! ! Pring boundary conditions info ! !------------------------------------! - call Grid % Print_Bnd_Cond_List() + call Grid % Print_Regions_List() close(fu) diff --git a/Sources/Convert/Convert_Mod/Load_Gmsh.f90 b/Sources/Convert/Convert_Mod/Load_Gmsh.f90 index 39547686d..c273e06fd 100644 --- a/Sources/Convert/Convert_Mod/Load_Gmsh.f90 +++ b/Sources/Convert/Convert_Mod/Load_Gmsh.f90 @@ -8,30 +8,81 @@ subroutine Load_Gmsh(Convert, Grid, file_name) class(Convert_Type) :: Convert type(Grid_Type) :: Grid character(SL) :: file_name +!------------------------------[Local parameters]------------------------------! + integer, parameter :: MSH_TRI = 2 + integer, parameter :: MSH_QUAD = 3 + integer, parameter :: MSH_TETRA = 4 + integer, parameter :: MSH_HEXA = 5 + integer, parameter :: MSH_WEDGE = 6 + integer, parameter :: MSH_PYRA = 7 !-----------------------------------[Locals]-----------------------------------! integer :: n_sect, n_elem, n_blocks, n_bnd_sect, n_grps - integer :: n_memb, n_tags, n_crvs, n_nods + integer :: n_memb, n_tags, n_crvs, n_nods, error integer :: i, j, k, c, dim, p_tag, s_tag, type, fu integer :: run, s_tag_max, n_e_0d, n_e_1d, n_e_2d, n_e_3d integer, allocatable :: n(:), new(:) integer, allocatable :: phys_tags(:), p_tag_corr(:), n_bnd_cells(:) character(SL), allocatable :: phys_names(:) logical :: ascii ! is file in ascii format? - logical :: the_end ! did it reach the end -!------------------------------[Local parameters]------------------------------! - integer, parameter :: MSH_TRI = 2 - integer, parameter :: MSH_QUAD = 3 - integer, parameter :: MSH_TETRA = 4 - integer, parameter :: MSH_HEXA = 5 - integer, parameter :: MSH_WEDGE = 6 - integer, parameter :: MSH_PYRA = 7 + integer :: pos + integer :: pos_physicalnames = -1 + integer :: pos_entities = -1 + integer :: pos_nodes = -1 + integer :: pos_elements = -1 + integer(1) :: byte(0:3) !==============================================================================! call Profiler % Start('Load_Gmsh') - ! Open the file in binary mode, because it just might be + !-------------------------------------------------------! + ! ! + ! Open the file in binary mode for initial analyzis ! + ! ! + !-------------------------------------------------------! call File % Open_For_Reading_Binary(file_name, fu) + !-----------------------------------------------------------! + ! A very rudimentary way to find beginnings of sections ! + !-----------------------------------------------------------! + pos = 0 + do + read(fu, end=2) byte(0); pos = pos + 1 + if(char(byte(0)) .eq. '$') then + read(fu, end=2) byte(1); pos = pos + 1 + read(fu, end=2) byte(2); pos = pos + 1 + read(fu, end=2) byte(3); pos = pos + 1 + if(char(byte(1)) .eq. 'E' .and. & + char(byte(2)) .eq. 'n' .and. & + char(byte(3)) .eq. 'd') then + do i = 1, len(Line % whole) + read(fu, end=2) byte(0); pos = pos + 1 + if(byte(0) .eq. 10) exit + end do + Line % whole = '' + do i = 1, len(Line % whole) + read(fu, end=2) byte(0); pos = pos + 1 + if(byte(0) .eq. 10) exit + if(byte(0) .ne. 13) Line % whole(i:i) = char(byte(0)) + end do + if(Line % whole .eq. '$PhysicalNames') pos_physicalnames = pos + if(Line % whole .eq. '$Entities') pos_entities = pos + if(Line % whole .eq. '$Nodes') pos_nodes = pos + if(Line % whole .eq. '$Elements') pos_elements = pos + end if + end if + end do +2 continue + + ! Error trap + if(pos_physicalnames .eq. -1) then + call Message % Error(60, & + "This is bad. PhysicalNames don't seem to be defined in the " // & + ".msh file. Maybe you forgot to define boundary conditions " // & + "(called physical groups) in Gmsh?", & + file=__FILE__, line=__LINE__) + end if + print *, '# Broswed the file in binary format and read ', pos, ' bytes' + !----------------------------------------! ! Gmsh can't handle polyhedral grids ! !----------------------------------------! @@ -41,10 +92,8 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Check format fo the file ! !------------------------------! rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$MeshFormat') exit - end do + call File % Read_Line(fu) + Assert(Line % tokens(1) == '$MeshFormat') call File % Read_Line(fu) if(Line % tokens(1) .ne. '4.1') then call Message % Error(60, & @@ -56,7 +105,17 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! My guess is that second tokens says it is binary (1) or not (0) ascii = .true. if(Line % tokens(2) .eq. '1') ascii = .false. - ! Line which follows contains some crap, but who cares? + + !------------------------------------------! + ! ! + ! Once you know the format of the file ! + ! close it and open again if ASCII ! + ! ! + !------------------------------------------! + if(ascii) then + close(fu) + call File % Open_For_Reading_Ascii(file_name, fu) + end if !----------------------------------------------! ! ! @@ -73,19 +132,13 @@ subroutine Load_Gmsh(Convert, Grid, file_name) !-------------------------------------------------! n_blocks = 0 n_bnd_sect = 0 - the_end = .false. rewind(fu) - do - call File % Read_Line(fu, reached_end=the_end) - if(Line % tokens(1) .eq. '$PhysicalNames') exit - if(the_end) then - call Message % Error(60, & - "This is bad. PhysicalNames don't seem to be defined in the " // & - ".msh file. Maybe you forgot to define boundary conditions " // & - "(called physical groups) in Gmsh?", & - file=__FILE__, line=__LINE__) - end if - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_physicalnames, 0) +# else + error = 0 + call fseek(fu, pos_physicalnames, 0) +# endif call File % Read_Line(fu) read(Line % tokens(1), *) n_sect allocate(phys_names(n_sect)) @@ -109,16 +162,17 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! ! !--------------------------! rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$Nodes') exit - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_nodes, 0) +# else + call fseek(fu, pos_nodes, 0) +# endif if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 4) read(Line % tokens(4), *) Grid % n_nodes ! 2 and 4 store number of nodes else call File % Read_Binary_Int8_Array(fu, 4) - Grid % n_nodes = int8_array(4) + Grid % n_nodes = int(int8_array(4)) end if print *,'# Number of nodes: ', Grid % n_nodes @@ -128,16 +182,17 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! ! !--------------------------------------! rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$Elements') exit - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_elements, 0) +# else + call fseek(fu, pos_elements, 0) +# endif if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 4) read(Line % tokens(4), *) n_elem ! both 2 and 4 store number of elements else call File % Read_Binary_Int8_Array(fu, 4) - n_elem = int8_array(4) + n_elem = int(int8_array(4)) end if allocate(new(n_elem)) new(:) = 0 @@ -151,22 +206,23 @@ subroutine Load_Gmsh(Convert, Grid, file_name) if(run .eq. 1) s_tag_max = 0 rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$Entities') exit - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_entities, 0) +# else + call fseek(fu, pos_entities, 0) +# endif if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 4) read(Line % tokens(1), *) n_e_0d ! number of 0D entities (points) read(Line % tokens(2), *) n_e_1d ! number of 1D entities (lines) read(Line % tokens(3), *) n_e_2d ! number of 2D entities (faces) read(Line % tokens(4), *) n_e_3d ! number of 3D entities (volumes) else call File % Read_Binary_Int8_Array(fu, 4) - n_e_0d = int8_array(1) ! number of 0D entities (points) - n_e_1d = int8_array(2) ! number of 1D entities (lines) - n_e_2d = int8_array(3) ! number of 2D entities (faces) - n_e_3d = int8_array(4) ! number of 3D entities (volumes) + n_e_0d = int(int8_array(1)) ! number of 0D entities (points) + n_e_1d = int(int8_array(2)) ! number of 1D entities (lines) + n_e_2d = int(int8_array(3)) ! number of 2D entities (faces) + n_e_3d = int(int8_array(4)) ! number of 3D entities (volumes) end if !--------------------------! @@ -174,7 +230,7 @@ subroutine Load_Gmsh(Convert, Grid, file_name) !--------------------------! if(ascii) then do i = 1, n_e_0d - call File % Read_Line(fu) + read(fu, *) Line % whole end do else do i = 1, n_e_0d @@ -192,7 +248,7 @@ subroutine Load_Gmsh(Convert, Grid, file_name) !--------------------------! if(ascii) then do i = 1, n_e_1d - call File % Read_Line(fu) + read(fu, *) Line % whole end do else do i = 1, n_e_1d @@ -230,14 +286,14 @@ subroutine Load_Gmsh(Convert, Grid, file_name) call File % Read_Binary_Real8_Array(fu, 6) ! Number of physical tags call File % Read_Binary_Int8_Array (fu, 1) - n_tags = int8_array(1) + n_tags = int(int8_array(1)) do j = 1, n_tags ! read the physical tags you have call File % Read_Binary_Int4_Array (fu, 1) p_tag = int4_array(1) end do ! Number of bounding curves call File % Read_Binary_Int8_Array (fu, 1) - n_crvs = int8_array(1) + n_crvs = int(int8_array(1)) ! Read the bounding curves call File % Read_Binary_Int4_Array (fu, n_crvs) end if @@ -268,20 +324,20 @@ subroutine Load_Gmsh(Convert, Grid, file_name) Grid % n_bnd_cells = 0 Grid % n_cells = 0 rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$Elements') exit - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_elements, 0) +# else + call fseek(fu, pos_elements, 0) +# endif !-------------------------------! ! Read the number of groups ! !-------------------------------! if(ascii) then - call File % Read_Line(fu) - read(Line % tokens(1),*) n_grps + read(fu, *) n_grps else call File % Read_Binary_Int8_Array(fu, 4) - n_grps = int8_array(1) + n_grps = int(int8_array(1)) end if !-------------------------------------------------------------! @@ -291,29 +347,28 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Read dim, s_tag, type and n_memb <--= this is what you actually need! if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 4) read(Line % tokens(1), *) dim ! dimension of the element read(Line % tokens(2), *) s_tag ! element tag read(Line % tokens(3), *) type ! element type read(Line % tokens(4), *) n_memb ! number of members in the group else call File % Read_Binary_Int4_Array(fu, 3) - dim = int4_array(1) ! dimension of the element - s_tag = int4_array(2) ! element tag - type = int4_array(3) ! element type + dim = int4_array(1) ! dimension of the element + s_tag = int4_array(2) ! element tag + type = int4_array(3) ! element type call File % Read_Binary_Int8_Array(fu, 1) - n_memb = int8_array(1) ! number of members in the group + n_memb = int(int8_array(1)) ! number of members in the group end if ! Read cell number and cell's nodes <--= this is just to carry on do j = 1, n_memb if(ascii) then - call File % Read_Line(fu) - read(Line % tokens(1), *) c ! Gmsh cell number + read(fu, *) c else ! Element tag call File % Read_Binary_Int8_Array(fu, 1) - c = int8_array(1) + c = int(int8_array(1)) ! Node tags if(type .eq. MSH_TRI) call File % Read_Binary_Int8_Array(fu, 3) if(type .eq. MSH_QUAD) call File % Read_Binary_Int8_Array(fu, 4) @@ -340,6 +395,15 @@ subroutine Load_Gmsh(Convert, Grid, file_name) print '(a38,i9)', '# Total number of boundary sections: ', n_bnd_sect print '(a38,i9)', '# Total number of boundary cells: ', Grid % n_bnd_cells + if(n_bnd_sect .eq. 0) then + call Message % Error(60, 'No boundary sections (physical groups in ' // & + 'Gmsh) have been defined. Convert can''t ' // & + 'work with grids like that. ' // & + '\n \n ' // & + 'Define physical groups in Gmsh and retry.', & + file=__FILE__, line=__LINE__) + end if + !--------------------------------------------! ! ! ! Allocate memory for Grid_Mod variables ! @@ -356,20 +420,20 @@ subroutine Load_Gmsh(Convert, Grid, file_name) n_bnd_cells(:) = 0 rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$Elements') exit - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_elements, 0) +# else + call fseek(fu, pos_elements, 0) +# endif !-------------------------------! ! Read the number of groups ! !-------------------------------! if(ascii) then - call File % Read_Line(fu) - read(Line % tokens(1),*) n_grps + read(fu, *) n_grps else call File % Read_Binary_Int8_Array(fu, 4) - n_grps = int8_array(1) + n_grps = int(int8_array(1)) end if !----------------------------------------------------------------! @@ -379,7 +443,7 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Read dim, s_tag, type and n_memb if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 4) read(Line % tokens(1), *) dim ! dimension of the element read(Line % tokens(2), *) s_tag ! element tag read(Line % tokens(3), *) type ! element type @@ -390,7 +454,7 @@ subroutine Load_Gmsh(Convert, Grid, file_name) s_tag = int4_array(2) ! element tag type = int4_array(3) ! element type call File % Read_Binary_Int8_Array(fu, 1) - n_memb = int8_array(1) ! number of members in the group + n_memb = int(int8_array(1)) ! number of members in the group end if ! Treat different cell types now @@ -404,7 +468,7 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Read cell number and cell's nodes do j = 1, n_memb if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 1 + n_nods) read(Line % tokens(1), *) c ! fetch Gmsh cell number c = new(c) ! use T-Flows numbering @@ -418,19 +482,19 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Element tag call File % Read_Binary_Int8_Array(fu, n_nods+1) - c = int8_array(1) ! fetch Gmsh cell number - c = new(c) ! use T-Flows numbering + c = int(int8_array(1)) ! fetch Gmsh cell number + c = new(c) ! use T-Flows numbering Grid % cells_n_nodes(c) = n_nods call Adjust_First_Dim(n_nods, Grid % cells_n) do k = 1, n_nods - Grid % cells_n(k, c) = int8_array(k+1) + Grid % cells_n(k, c) = int(int8_array(k+1)) end do end if if(dim .eq. 2) then - Grid % bnd_cond % color(c) = phys_tags(s_tag) + Grid % region % at_cell(c) = phys_tags(s_tag) n_bnd_cells(phys_tags(s_tag)) = n_bnd_cells(phys_tags(s_tag)) + 1 end if end do @@ -447,20 +511,20 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! ! !--------------------------------! rewind(fu) - do - call File % Read_Line(fu) - if(Line % tokens(1) .eq. '$Nodes') exit - end do +# ifdef __INTEL_COMPILER + error = fseek(fu, pos_nodes, 0) +# else + call fseek(fu, pos_nodes, 0) +# endif !-------------------------------! ! Read the number of groups ! !-------------------------------! if(ascii) then - call File % Read_Line(fu) - read(Line % tokens(1),*) n_grps + read(fu, *) n_grps else call File % Read_Binary_Int8_Array(fu, 4) - n_grps = int8_array(1) + n_grps = int(int8_array(1)) end if !-------------------------------------------------------! @@ -468,35 +532,31 @@ subroutine Load_Gmsh(Convert, Grid, file_name) !-------------------------------------------------------! do i = 1, n_grps if(ascii) then - call File % Read_Line(fu) + read(fu, *) (Line % tokens(k), k = 1, 4) read(Line % tokens(4),*) n_memb ! fetch number of members else call File % Read_Binary_Int4_Array(fu, 3) call File % Read_Binary_Int8_Array(fu, 1) - n_memb = int8_array(1) + n_memb = int(int8_array(1)) end if allocate(n(n_memb)) ! Fetch all node numbers in the group if(ascii) then do j = 1, n_memb - call File % Read_Line(fu) - read(Line % tokens(1),*) n(j) + read(fu, *) n(j) end do else do j = 1, n_memb ! fetch all node numbers call File % Read_Binary_Int8_Array(fu, 1) - n(j) = int8_array(1) + n(j) = int(int8_array(1)) end do end if ! Fetch all node coordinates in the group if(ascii) then do j = 1, n_memb - call File % Read_Line(fu) ! read node coordinates - read(Line % tokens(1),*) Grid % xn(n(j)) - read(Line % tokens(2),*) Grid % yn(n(j)) - read(Line % tokens(3),*) Grid % zn(n(j)) + read(fu, *) Grid % xn(n(j)), Grid % yn(n(j)), Grid % zn(n(j)) end do else do j = 1, n_memb @@ -514,12 +574,11 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Copy boundary condition info ! ! ! !----------------------------------! - Grid % n_bnd_cond = n_bnd_sect - allocate(Grid % bnd_cond % name(n_bnd_sect)) + call Grid % Allocate_Regions(n_bnd_sect) do i = 1, n_bnd_sect - Grid % bnd_cond % name(i) = phys_names(i) - call String % To_Upper_Case(Grid % bnd_cond % name(i)) + Grid % region % name(i) = phys_names(i) + call String % To_Upper_Case(Grid % region % name(i)) end do !------------------------------------! @@ -527,7 +586,7 @@ subroutine Load_Gmsh(Convert, Grid, file_name) ! Print boundary conditions info ! ! ! !------------------------------------! - call Grid % Print_Bnd_Cond_List() + call Grid % Print_Regions_List() close(fu) diff --git a/Sources/Convert/Convert_Mod/Load_Obj.f90 b/Sources/Convert/Convert_Mod/Load_Obj.f90 index a05ae2019..65fbfb338 100644 --- a/Sources/Convert/Convert_Mod/Load_Obj.f90 +++ b/Sources/Convert/Convert_Mod/Load_Obj.f90 @@ -9,11 +9,13 @@ subroutine Load_Obj(Convert, Grid, file_name) type(Grid_Type) :: Grid character(SL) :: file_name !-----------------------------------[Locals]-----------------------------------! - character(SL) :: tok - integer :: fu, s, n, i, i_nod - logical :: the_end - real :: t_min_x, t_max_x, t_min_y, t_max_y, t_min_z, t_max_z - real :: x_o, y_o + character(SL) :: tok + integer :: fu, s, n, i, i_nod + logical :: the_end + real :: t_min_x, t_max_x, t_min_y, t_max_y, t_min_z, t_max_z + real :: x_o, y_o +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! call Profiler % Start('Load_Obj') diff --git a/Sources/Convert/Convert_Mod/Logo_Con.f90 b/Sources/Convert/Convert_Mod/Logo_Con.f90 index 9f13857a6..6d03530d0 100644 --- a/Sources/Convert/Convert_Mod/Logo_Con.f90 +++ b/Sources/Convert/Convert_Mod/Logo_Con.f90 @@ -1,7 +1,11 @@ !==============================================================================! subroutine Logo_Con(Convert) +!------------------------------------------------------------------------------! + implicit none !---------------------------------[Arguments]----------------------------------! class(Convert_Type) :: Convert +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! print *,'#===================================' // & diff --git a/Sources/Convert/Convert_Mod/N_Bnd_Cells_In_Color.f90 b/Sources/Convert/Convert_Mod/N_Bnd_Cells_In_Region.f90 similarity index 79% rename from Sources/Convert/Convert_Mod/N_Bnd_Cells_In_Color.f90 rename to Sources/Convert/Convert_Mod/N_Bnd_Cells_In_Region.f90 index 2f6564981..8d2ae5645 100644 --- a/Sources/Convert/Convert_Mod/N_Bnd_Cells_In_Color.f90 +++ b/Sources/Convert/Convert_Mod/N_Bnd_Cells_In_Region.f90 @@ -1,5 +1,5 @@ !==============================================================================! - integer function N_Bnd_Cells_In_Color(Convert, Grid, bc, cell_data) + integer function N_Bnd_Cells_In_Region(Convert, Grid, bc, cell_data) !------------------------------------------------------------------------------! ! Counts and marks (with cell_data) boundary cells in given boundary color ! !------------------------------------------------------------------------------! @@ -11,6 +11,8 @@ integer function N_Bnd_Cells_In_Color(Convert, Grid, bc, cell_data) integer :: cell_data(-Grid % n_bnd_cells:Grid % n_cells) !-----------------------------------[Locals]-----------------------------------! integer :: c, cnt +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Nullify on entry @@ -18,14 +20,14 @@ integer function N_Bnd_Cells_In_Color(Convert, Grid, bc, cell_data) cell_data(:) = 0 do c = -Grid % n_bnd_cells, -1 - if( Grid % bnd_cond % color(c) .eq. bc ) then + if( Grid % region % at_cell(c) .eq. bc ) then cnt = cnt + 1 cell_data(c) = cell_data(c) + 1 end if end do ! Return a sum of all marked boundary cells - N_Bnd_Cells_In_Color = cnt + N_Bnd_Cells_In_Region = cnt end function diff --git a/Sources/Convert/Convert_Mod/N_Edges_In_Bnd_Color.f90 b/Sources/Convert/Convert_Mod/N_Edges_In_Region.f90 similarity index 94% rename from Sources/Convert/Convert_Mod/N_Edges_In_Bnd_Color.f90 rename to Sources/Convert/Convert_Mod/N_Edges_In_Region.f90 index efd76dbf4..b5d6bf17d 100644 --- a/Sources/Convert/Convert_Mod/N_Edges_In_Bnd_Color.f90 +++ b/Sources/Convert/Convert_Mod/N_Edges_In_Region.f90 @@ -1,5 +1,5 @@ !==============================================================================! - integer function N_Edges_In_Bnd_Color(Convert, Grid, bc, edge_data) + integer function N_Edges_In_Region(Convert, Grid, bc, edge_data) !------------------------------------------------------------------------------! ! Counts and marks (with edge_data) edges in the given boundary color ! !------------------------------------------------------------------------------! @@ -14,6 +14,8 @@ integer function N_Edges_In_Bnd_Color(Convert, Grid, bc, edge_data) real :: norm_1(3), norm_2(3) real :: xs, ys, zs, xe, ye, ze real :: vec_ef(3) ! from edge to face mid-point +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Nullify on entry @@ -106,7 +108,7 @@ integer function N_Edges_In_Bnd_Color(Convert, Grid, bc, edge_data) !------------------------! do e = 1, Grid % n_edges if(Grid % edges_bc(bc, e) .gt. 0) then - if( sum(Grid % edges_bc(1:Grid % n_bnd_cond, e)) .gt. 1 ) then + if( sum(Grid % edges_bc(1:Grid % n_bnd_regions, e)) .gt. 1 ) then if(edge_data(e) .eq. 0) then ! hasn't been marked yet cnt = cnt + 1 edge_data(e) = 1 @@ -116,7 +118,7 @@ integer function N_Edges_In_Bnd_Color(Convert, Grid, bc, edge_data) end do ! Return a sum of all marked nodes - N_Edges_In_Bnd_Color = cnt + N_Edges_In_Region = cnt end function diff --git a/Sources/Convert/Convert_Mod/N_Nodes_In_Bnd_Color.f90 b/Sources/Convert/Convert_Mod/N_Nodes_In_Region.f90 similarity index 83% rename from Sources/Convert/Convert_Mod/N_Nodes_In_Bnd_Color.f90 rename to Sources/Convert/Convert_Mod/N_Nodes_In_Region.f90 index 2dd648708..679c8f1e0 100644 --- a/Sources/Convert/Convert_Mod/N_Nodes_In_Bnd_Color.f90 +++ b/Sources/Convert/Convert_Mod/N_Nodes_In_Region.f90 @@ -1,5 +1,5 @@ !==============================================================================! - integer function N_Nodes_In_Bnd_Color(Convert, Grid, bc, node_data) + integer function N_Nodes_In_Region(Convert, Grid, bc, node_data) !------------------------------------------------------------------------------! ! Counts and marks (with node_data) nodes in the given boundary color ! !------------------------------------------------------------------------------! @@ -11,6 +11,8 @@ integer function N_Nodes_In_Bnd_Color(Convert, Grid, bc, node_data) integer :: node_data(Grid % n_nodes) !-----------------------------------[Locals]-----------------------------------! integer :: c, i_nod, n, cnt +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Nullify on entry @@ -20,7 +22,7 @@ integer function N_Nodes_In_Bnd_Color(Convert, Grid, bc, node_data) ! Browse through all boundary cells and mark nodes ! of those cells in the given boundary condition do c = -Grid % n_bnd_cells, -1 - if( Grid % bnd_cond % color(c) .eq. bc ) then + if( Grid % region % at_cell(c) .eq. bc ) then do i_nod = 1, Grid % cells_n_nodes(c) n = Grid % cells_n(i_nod, c) if(node_data(n) .eq. 0) then ! hasn't been marked yet @@ -32,7 +34,7 @@ integer function N_Nodes_In_Bnd_Color(Convert, Grid, bc, node_data) end do ! Return a sum of all marked nodes - N_Nodes_In_Bnd_Color = cnt + N_Nodes_In_Region = cnt end function diff --git a/Sources/Convert/Convert_Mod/N_Sharp_Corners.f90 b/Sources/Convert/Convert_Mod/N_Sharp_Corners.f90 index c36713368..10ee25f55 100644 --- a/Sources/Convert/Convert_Mod/N_Sharp_Corners.f90 +++ b/Sources/Convert/Convert_Mod/N_Sharp_Corners.f90 @@ -11,6 +11,8 @@ integer function N_Sharp_Corners(Convert, Grid, sharp_corner) !-----------------------------------[Locals]-----------------------------------! integer :: e, cnt, s1, s2, n1, n2, n real :: norm_1(3), norm_2(3) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Nullify on entry diff --git a/Sources/Convert/Convert_Mod/N_Sharp_Edges.f90 b/Sources/Convert/Convert_Mod/N_Sharp_Edges.f90 index 97d44e61b..f1fc65480 100644 --- a/Sources/Convert/Convert_Mod/N_Sharp_Edges.f90 +++ b/Sources/Convert/Convert_Mod/N_Sharp_Edges.f90 @@ -14,6 +14,8 @@ integer function N_Sharp_Edges(Convert, Grid, edge_data) real :: norm_1(3), norm_2(3) real :: xs, ys, zs, xe, ye, ze real :: vec_ef(3) ! from edge to face mid-point +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Nullify on entry @@ -87,7 +89,11 @@ integer function N_Sharp_Edges(Convert, Grid, edge_data) edge_data(e) = -1 else - print '(A,99F12.3)', 'BAD', norm2(vec_ef(1:3)), norm_1, norm_2, dot_product(norm_1(1:3), norm_2(1:3)) + print '(a,99f12.3)', 'BAD', norm2(vec_ef(1:3)), & + norm_1, & + norm_2, & + dot_product(norm_1(1:3), & + norm_2(1:3)) end if end if @@ -102,7 +108,7 @@ integer function N_Sharp_Edges(Convert, Grid, edge_data) ! ! !-------------------------------------------------------------------! do e = 1, Grid % n_edges - if( sum(Grid % edges_bc(1:Grid % n_bnd_cond, e)) .gt. 1 ) then + if( sum(Grid % edges_bc(1:Grid % n_bnd_regions, e)) .gt. 1 ) then if(edge_data(e) .eq. 0) then ! hasn't been marked yet cnt = cnt + 1 edge_data(e) = 1 diff --git a/Sources/Convert/Convert_Mod/Sort_Face_Nodes.f90 b/Sources/Convert/Convert_Mod/Sort_Face_Nodes.f90 index c01e6e6fb..806728192 100644 --- a/Sources/Convert/Convert_Mod/Sort_Face_Nodes.f90 +++ b/Sources/Convert/Convert_Mod/Sort_Face_Nodes.f90 @@ -21,6 +21,8 @@ subroutine Sort_Face_Nodes(Convert, Grid, s, concave_link) integer, allocatable :: order(:) ! integer :: k, ni, nj, nk, min_loc ! real :: vec_ji(3), vec_jk(3), mag_ji, mag_jk, dot_prod +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !==============================================================================! ! Take alias diff --git a/Sources/Convert/Convert_Mod/Triangle_Area_Z.f90 b/Sources/Convert/Convert_Mod/Triangle_Area_Z.f90 index 222ae52d1..c5cf99e39 100644 --- a/Sources/Convert/Convert_Mod/Triangle_Area_Z.f90 +++ b/Sources/Convert/Convert_Mod/Triangle_Area_Z.f90 @@ -5,12 +5,6 @@ real function Triangle_Area_Z(Convert, & xc, yc) !------------------------------------------------------------------------------! ! Area of a tringle in xy plane defined with nodes "a", "b", "c" -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Convert_Type) :: Convert - real, intent(in) :: xa, ya, xb, yb, xc, yc -!==============================================================================! ! ! ! c ! ! / \ ! @@ -20,6 +14,13 @@ real function Triangle_Area_Z(Convert, & ! / \ ! ! a-----------b ! ! ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Convert_Type) :: Convert + real, intent(in) :: xa, ya, xb, yb, xc, yc +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Convert) !------------------------------------------------------------------------------! Triangle_Area_Z = abs(xa * (yb-yc) + xb * (yc-ya) + xc * (ya-yb)) * 0.5 diff --git a/Sources/Convert/Main_Con.f90 b/Sources/Convert/Main_Con.f90 index 6ec3eab83..d211d5435 100644 --- a/Sources/Convert/Main_Con.f90 +++ b/Sources/Convert/Main_Con.f90 @@ -19,7 +19,7 @@ program Convert_Prog character(SL) :: app_up character(SL) :: file_name character(SL) :: file_format ! 'UNKNOWN', 'FLUENT', 'GAMBIT', 'GMSH' - integer :: l, p, g, n_grids + integer :: s, l, p, g, n_grids logical :: city !==============================================================================! @@ -151,10 +151,10 @@ program Convert_Prog call Convert % Calculate_Geometry(Grid(g), g-n_grids) ! if zero, ask ! Keep in mind that Grid_Mod_Calculate_Wall_Distance is ... - ! ... faster if it is called after Grid_Mod_Sort_Faces_Smart - call Grid(g) % Sort_Cells_Smart() + ! ... faster if it is called after Grid_Mod_Sort_Faces_By_Region + call Grid(g) % Sort_Cells_By_Coordinates() - call Grid(g) % Sort_Faces_Smart() + call Grid(g) % Sort_Faces_By_Region() if( (g-n_grids) .eq. 0) then call Grid(g) % Calculate_Wall_Distance() end if @@ -164,13 +164,15 @@ program Convert_Prog call Grid(g) % Initialize_New_Numbers() ! Note #1 about shadows: - ! At this point you have grid % n_faces faces and grid % n_shadows (on top) + ! At this point you have Grid % n_faces faces and Grid % n_shadows (on top) ! and they are pointing to each other. Besides, both real face and its ! shadow have the same c1 and c2, both inside cells with positive indices ! Real faces which do not have shadows have index "0" for shadow. - ! Should check like this: do s = 1, grid % n_faces + grid % n_shadows - ! Should check like this: write(20, '(99i9)') s, grid % faces_s(s) - ! Should check like this: end do + do s = 1, Grid(g) % n_faces + Grid(g) % n_shadows + if(Grid(g) % faces_s(s) .ne. 0) then + Assert(Grid(g) % faces_s(Grid(g) % faces_s(s)) .eq. s) + end if + end do ! Similar note is in Generate, also called Note #1 call Grid(g) % Print_Grid_Statistics() diff --git a/Sources/Convert/makefile b/Sources/Convert/makefile index 971a676a3..e00eaf067 100644 --- a/Sources/Convert/makefile +++ b/Sources/Convert/makefile @@ -8,11 +8,12 @@ # Default options for compilation #------------------------------------- FORTRAN ?= gnu -DEBUG ?= no ASSERT ?= yes +DEBUG ?= no +PROF ?= no REAL ?= double MPI ?= no -OPENMP ?= yes +OMP ?= yes # Directories for objects and modules. (No need to change.) DIR_BINARY = ../../Binaries @@ -29,31 +30,43 @@ PROGRAM_FILE = $(DIR_BINARY)/$(PROGRAM_NAME) # Initialize variables to pass on to preprocessor with # variable T_FLOWS_COMPILATION which, if set to one, # means unit is compiled from T-Flow -# It later adds T_FLOWS_MPI and T_FLOWS_PETSC #---------------------------------------------------------- PASS_ON = -DT_FLOWS_COMPILATION=1 + +#---------------------------------------------------------- +# Add T_FLOWS_PROGRAM, T_FLOWS_ASSERT and T_FLOWS_DEBUG +# and later on it add also T_FLOWS_MPI and T_FLOWS_PETSC +#---------------------------------------------------------- +PASS_ON += -DT_FLOWS_PROGRAM=3 + ifeq ($(ASSERT), yes) PASS_ON += -DT_FLOWS_ASSERT=1 else PASS_ON += -DT_FLOWS_ASSERT=0 endif +ifeq ($(DEBUG), yes) + PASS_ON += -DT_FLOWS_DEBUG=1 +else + PASS_ON += -DT_FLOWS_DEBUG=0 +endif + $(info #=======================================================================) -$(info # Compiling $(PROGRAM_NAME) with compiler $(FORTRAN)) +$(info # Compiling $(PROGRAM_NAME) with $(FORTRAN) compiler ) $(info #-----------------------------------------------------------------------) $(info # Usage: ) $(info # make ) $(info # ) -$(info # ) +$(info # ) $(info # ) $(info # Note: The first item, for each of the options above, is the default. ) $(info # ) $(info # Examples: ) -$(info # make - compile with gnu compiler ) -$(info # make FORTAN=intel - compile with intel compiler ) -$(info # make DEBUG=yes - compile with gnu compiler in debug mode ) -$(info # make ASSERT=no - compile without assert with gnu compiler ) -$(info # make OPENMP=yes - compile with gnu compiler for parallel Convert ) +$(info # make - compile with gnu compiler ) +$(info # make FORTRAN=intel - compile with intel compiler ) +$(info # make DEBUG=yes - compile with gnu compiler in debug mode ) +$(info # make ASSERT=no - compile without assert with gnu compiler ) +$(info # make OMP=yes - compile with gnu compiler for parallel Convert ) $(info #-----------------------------------------------------------------------) #------------------- @@ -65,11 +78,17 @@ ifeq ($(REAL), single) endif #------------------------------------------------------------------------- +# # Compiler and linker options +# #------------------------------------------------------------------------- # Note: Changes only when support to a new Fortran compiler is added. #------------------------------------------------------------------------- +#----------- +# Intel +#----------- + # Fortran == intel ifeq ($(FORTRAN), intel) ifeq ($(FCOMP),) @@ -77,19 +96,30 @@ ifeq ($(FORTRAN), intel) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g -warn -warn all,noexternal \ - -check all -debug all -fpe-all=0 -traceback -cpp + OPT_F_COMP += -O0 -g -traceback else - OPT_F_COMP = -module $(DIR_MODULE) -O3 -cpp + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -g -O2 -shared-intel -debug inline-debug-info \ + -D TBB_USE_THREADING_TOOLS endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -qopenmp + ifeq ($(PROF), yes) + OPT_F_COMP += -qopenmp-link dynamic -parallel-source-info=2 + endif endif +#------------ +# Nvidia +#------------ + # Fortran == nvidia else ifeq ($(FORTRAN), nvidia) ifeq ($(FCOMP),) @@ -97,18 +127,23 @@ else ifeq ($(FORTRAN), nvidia) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp -Mbackslash ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g + OPT_F_COMP += -O0 -g else - OPT_F_COMP = -module $(DIR_MODULE) -O3 + OPT_F_COMP += -O3 endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -mp endif +#--------- +# Gnu +#--------- + # Fortran == gnu else ifeq ($(FCOMP),) @@ -116,24 +151,20 @@ else else FC = $(FCOMP) endif + OPT_F_COMP = -J $(DIR_MODULE) -cpp -ffree-line-length-none ifeq ($(DEBUG), yes) - OPT_F_COMP = -J $(DIR_MODULE) -O0 -g -cpp \ - -ffree-line-length-none -fcheck=all -fwhole-file -fbacktrace \ - -ffpe-trap=invalid,zero,overflow -fimplicit-none \ - -Wall -Wextra -Waliasing -Wampersand -Warray-temporaries \ - -Wc-binding-type -Wcharacter-truncation -Wline-truncation \ - -Wconversion -finit-real=nan -Wintrinsics-std \ - -Wreal-q-constant -Wsurprising -Wtabs -Wunderflow \ - -Wintrinsic-shadow -Wunused-parameter -Walign-commons \ - -Wfunction-elimination -Wrealloc-lhs -Wrealloc-lhs-all \ - -Wtarget-lifetime -Wpedantic -fstack-check + OPT_F_COMP += -O0 -g -fcheck=all -Wunused-parameter -Wall \ + -Wno-integer-division else - OPT_F_COMP = -J $(DIR_MODULE) -O3 -cpp -ffree-line-length-none + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -pg -g endif ifeq ($(REAL), double) OPT_F_COMP += -fdefault-real-8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -fopenmp endif endif @@ -159,8 +190,6 @@ endif #------------------------------------------------------ # Modules' order must obey their dependency # This list should therefore be written "by hand". -# Note: Modules written in lower case -# letters are candidates for deletion. #------------------------------------------------------ #------------- @@ -169,18 +198,20 @@ endif # Modules in shared directories SRC_F_MOD = Const_Mod.f90 \ + Region_Mod.f90 \ String_Mod.f90 \ - Tokenizer_Mod.f90 \ Comm_Mod.f90 \ Assert_Mod.f90 \ + Tokenizer_Mod.f90 \ Message_Mod.f90 \ + Vect_Mod.f90 \ + Control_Mod.f90 \ Profiler_Mod.f90 \ Math_Mod.f90 \ File_Mod.f90 \ Gen_Mod.f90 \ Vtk_Mod.f90 \ Metis_Mod.f90 \ - Boundary_Mod.f90 \ Swap_Mod.f90 \ Sort_Mod.f90 \ Grid_Mod.f90 \ @@ -210,26 +241,13 @@ OBJ_F_MOD = $(SRC_F_MOD:%.f90=$(DIR_OBJECT)/%.o) OBJ_F_FUN = $(SRC_F_FUN:%.f90=$(DIR_OBJECT)/%.o) OBJ = $(OBJ_F_MOD) $(OBJ_F_FUN) -#------------------------------------------------------- -# List of modules currently used for target "clean" -#------------------------------------------------------- -# Note: This doesn't need editing. -#------------------------------------------------------- -SRC_F_MOD_LOW = $(shell echo $(SRC_F_MOD) | tr A-Z a-z) -MOD = $(SRC_F_MOD_LOW:%.f90=$(DIR_MODULE)/%.mod) - #--------------------------------------------------------- # Default rule to build Fortran modules and functions #--------------------------------------------------------- # Note: This doesn't need editing. #--------------------------------------------------------- -# Fortran modules -$(DIR_OBJECT)/%.o: %.f90 %/*.f90 - @echo $(FC) $< - @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< - -# Fortran functions +# Fortran sources $(DIR_OBJECT)/%.o: %.f90 @echo $(FC) $< @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< diff --git a/Sources/Convert/makefile_explicit_dependencies b/Sources/Convert/makefile_explicit_dependencies index 0ac6a1da4..20d71f3c8 100644 --- a/Sources/Convert/makefile_explicit_dependencies +++ b/Sources/Convert/makefile_explicit_dependencies @@ -15,104 +15,109 @@ $(DIR_OBJECT)/Convert_Mod.o \ Convert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/N_Bnd_Cells_In_Color.f90 +# Dependencies for: ./Convert_Mod/Guess_Format.f90 #--------------------------------------------------- -$(DIR_OBJECT)/N_Bnd_Cells_In_Color.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Guess_Format.o:\ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Calculate_Geometry.f90 +# Dependencies for: ./Convert_Mod/Find_Parents.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Calculate_Geometry.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Find_Parents.o:\ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Logo_Con.f90 +# Dependencies for: ./Convert_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Logo_Con.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Convert_Mod.o:\ +$(DIR_OBJECT)/Stl_Mod.o \ +$(DIR_SHARED)/Stl_Mod/*.f90 \ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 \ +Convert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/N_Edges_In_Bnd_Color.f90 +# Dependencies for: ./Message_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/N_Edges_In_Bnd_Color.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Message_Mod.o:\ +$(DIR_OBJECT)/Tokenizer_Mod.o \ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/N_Nodes_In_Bnd_Color.f90 +# Dependencies for: ./Isoap_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/N_Nodes_In_Bnd_Color.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Isoap_Mod.o:\ +$(DIR_OBJECT)/Polyhedron_Mod.o \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 \ +$(DIR_OBJECT)/Iso_Polygons_Mod.o \ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 \ +$(DIR_SHARED)/Isoap_Mod/readme \ +$(DIR_SHARED)/Isoap_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Allocate_Memory.f90 +# Dependencies for: ./File_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Allocate_Memory.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/File_Mod.o:\ +$(DIR_OBJECT)/String_Mod.o \ +$(DIR_SHARED)/String_Mod/*.f90 \ +$(DIR_OBJECT)/Message_Mod.o \ +$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Load_Gambit.f90 +# Dependencies for: ./Region_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Load_Gambit.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Region_Mod.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Create_Dual.f90 +# Dependencies for: ./Gen_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Create_Dual.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Gen_Mod.o:\ +$(DIR_SHARED)/Gen_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/N_Sharp_Corners.f90 +# Dependencies for: ./Sort_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/N_Sharp_Corners.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Sort_Mod.o:\ +$(DIR_OBJECT)/Swap_Mod.o \ +$(DIR_SHARED)/Swap_Mod/*.f90 \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Load_Gmsh.f90 +# Dependencies for: ./Polyhedron_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Load_Gmsh.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Polyhedron_Mod.o:\ +$(DIR_OBJECT)/Work_Mod.o \ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Guess_Format.f90 +# Dependencies for: ./Control_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Guess_Format.o:\ +$(DIR_OBJECT)/Control_Mod.o:\ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Load_Fluent.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Load_Fluent.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_SHARED)/File_Mod/*.f90 \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Insert_Buildings.f90 +# Dependencies for: ./Probe_1d_Cells.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Insert_Buildings.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Probe_1d_Cells.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ @@ -123,75 +128,33 @@ $(DIR_SHARED)/File_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Find_Parents.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Find_Parents.o:\ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Convert_Mod/N_Sharp_Edges.f90 +# Dependencies for: ./Message_Mod/Dashed_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/N_Sharp_Edges.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Dashed_Line.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Grid_Topology.f90 +# Dependencies for: ./Message_Mod/Thin_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Grid_Topology.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Thin_Line.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Find_Faces.f90 +# Dependencies for: ./Message_Mod/Thick_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Find_Faces.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 +$(DIR_OBJECT)/Thick_Line.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Convert_Mod/Sort_Face_Nodes.f90 +# Dependencies for: ./Work_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Sort_Face_Nodes.o:\ +$(DIR_OBJECT)/Work_Mod.o:\ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 -#--------------------------------------------------- -# Dependencies for: ./Convert_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Convert_Mod.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -Convert_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o - -#--------------------------------------------------- -# Dependencies for: ./Sort_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Sort_Mod.o:\ -$(DIR_OBJECT)/Swap_Mod.o \ -$(DIR_SHARED)/Swap_Mod/*.f90 \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 - #--------------------------------------------------- # Dependencies for: ./Probe_1d_Nodes.f90 #--------------------------------------------------- @@ -207,58 +170,46 @@ $(DIR_OBJECT)/File_Mod.o \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Grid_Mod.f90 +# Dependencies for: ./Vect_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Grid_Mod.o:\ -$(DIR_OBJECT)/Vtk_Mod.o \ -$(DIR_SHARED)/Vtk_Mod/*.f90 \ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Metis_Mod.o \ -$(DIR_SHARED)/Metis_Mod/*.f90 \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Boundary_Mod.o - -#--------------------------------------------------- -# Dependencies for: ./File_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/File_Mod.o:\ -$(DIR_OBJECT)/String_Mod.o \ -$(DIR_SHARED)/String_Mod/*.f90 \ -$(DIR_OBJECT)/Message_Mod.o \ -$(DIR_SHARED)/Message_Mod/*.f90 \ -$(DIR_SHARED)/File_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Control_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Control_Mod.o:\ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_SHARED)/Control_Mod/*.f90 \ -$(DIR_SHARED)/Control_Mod/*/*.f90 +$(DIR_OBJECT)/Vect_Mod.o:\ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Profiler_Mod.f90 #--------------------------------------------------- $(DIR_OBJECT)/Profiler_Mod.o:\ $(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Control_Mod.o \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 \ $(DIR_OBJECT)/Comm_Mod.o \ $(DIR_SHARED)/Comm_Mod/*/*.f90 +#--------------------------------------------------- +# Dependencies for: ./Math_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Math_Mod.o:\ +$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o + #--------------------------------------------------- # Dependencies for: ./Swap_Mod.f90 #--------------------------------------------------- $(DIR_OBJECT)/Swap_Mod.o:\ $(DIR_SHARED)/Swap_Mod/*.f90 +#--------------------------------------------------- +# Dependencies for: ./Assert_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Assert_Mod.o:\ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 \ +$(DIR_SHARED)/Assert_Mod/*.f90 + #--------------------------------------------------- # Dependencies for: ./String_Mod.f90 #--------------------------------------------------- @@ -266,9 +217,11 @@ $(DIR_OBJECT)/String_Mod.o:\ $(DIR_SHARED)/String_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_2d.f90 +# Dependencies for: ./Probe_1d_Cells_Nodes.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_2d.o:\ +$(DIR_OBJECT)/Probe_1d_Cells_Nodes.o:\ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ @@ -278,66 +231,66 @@ $(DIR_OBJECT)/File_Mod.o \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Vtk_Mod.f90 +# Dependencies for: ./Grid_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Vtk_Mod.o:\ +$(DIR_OBJECT)/Grid_Mod.o:\ +$(DIR_OBJECT)/Vtk_Mod.o \ $(DIR_SHARED)/Vtk_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o - -#--------------------------------------------------- -# Dependencies for: ./Comm_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Comm_Mod.o:\ -$(DIR_OBJECT)/Const_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Tokenizer_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Tokenizer_Mod.o:\ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Vect_Mod.o \ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Metis_Mod.o \ +$(DIR_SHARED)/Metis_Mod/*.f90 \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Work_Mod.f90 +# Dependencies for: ./Stl_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Work_Mod.o:\ -$(DIR_SHARED)/Work_Mod/*.f90 \ -$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_OBJECT)/Stl_Mod.o:\ +$(DIR_SHARED)/Stl_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Dashed_Line.f90 +# Dependencies for: ./Comm_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Dashed_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Comm_Mod.o:\ +$(DIR_OBJECT)/Const_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thin_Line.f90 +# Dependencies for: ./Iso_Polygons_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thin_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Iso_Polygons_Mod.o:\ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thick_Line.f90 +# Dependencies for: ./Vtk_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thick_Line.o:\ +$(DIR_OBJECT)/Vtk_Mod.o:\ +$(DIR_SHARED)/Vtk_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Boundary_Mod.f90 +# Dependencies for: ./Metis_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Boundary_Mod.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Metis_Mod.o:\ +$(DIR_SHARED)/Metis_Mod/*.f90 \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_1d_Cells_Nodes.f90 +# Dependencies for: ./Probe_2d.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Cells_Nodes.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Probe_2d.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ @@ -347,55 +300,10 @@ $(DIR_OBJECT)/File_Mod.o \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Assert_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Assert_Mod.o:\ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 \ -$(DIR_SHARED)/Assert_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Message_Mod.f90 +# Dependencies for: ./Tokenizer_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Message_Mod.o:\ -$(DIR_OBJECT)/Tokenizer_Mod.o \ +$(DIR_OBJECT)/Tokenizer_Mod.o:\ $(DIR_SHARED)/Tokenizer_Mod/*.f90 \ -$(DIR_SHARED)/Message_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o \ -$(DIR_OBJECT)/Assert_Mod.o \ -$(DIR_SHARED)/Assert_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Math_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Math_Mod.o:\ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o - -#--------------------------------------------------- -# Dependencies for: ./Metis_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Metis_Mod.o:\ -$(DIR_SHARED)/Metis_Mod/*.f90 \ $(DIR_OBJECT)/Assert_Mod.o \ $(DIR_SHARED)/Assert_Mod/*.f90 -#--------------------------------------------------- -# Dependencies for: ./Gen_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Gen_Mod.o:\ -$(DIR_SHARED)/Gen_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Probe_1d_Cells.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Cells.o:\ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o - diff --git a/Sources/Divide/Divide_Mod.f90 b/Sources/Divide/Divide_Mod.f90 index 630cef022..d570a5241 100644 --- a/Sources/Divide/Divide_Mod.f90 +++ b/Sources/Divide/Divide_Mod.f90 @@ -1,3 +1,7 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Divide_Mod !------------------------------------------------------------------------------! diff --git a/Sources/Divide/Divide_Mod/Logo_Div.f90 b/Sources/Divide/Divide_Mod/Logo_Div.f90 index cd5db7148..43db3a25d 100644 --- a/Sources/Divide/Divide_Mod/Logo_Div.f90 +++ b/Sources/Divide/Divide_Mod/Logo_Div.f90 @@ -1,10 +1,11 @@ !==============================================================================! subroutine Logo_Div(Divide) !------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Const_Mod + implicit none !---------------------------------[Arguments]----------------------------------! class(Divide_Type) :: Divide +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Divide) !==============================================================================! print *,'#===================================' // & diff --git a/Sources/Divide/Divide_Mod/Save_Subdomains.f90 b/Sources/Divide/Divide_Mod/Save_Subdomains.f90 index a2a96cdbc..264e9a22d 100644 --- a/Sources/Divide/Divide_Mod/Save_Subdomains.f90 +++ b/Sources/Divide/Divide_Mod/Save_Subdomains.f90 @@ -5,19 +5,34 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) ! ! ! Warning: Unfortunatelly, if you change the order in which cells are ! ! stored here, it might have an impact on map creation for backup file. ! +! ! +! Region-wise, at this point you have: ! +! ! +! Faces: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ! +! ! +! Cells: -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 ! +! ! +! Reg: |<----------- 1 ----------->|<----- 2 ----->|<------ 3 ------>| ! +! ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Divide_Type) :: Divide - type(Grid_Type) :: Grid - integer :: n_buff_layers ! number of buffer layers, keep it here + class(Divide_Type) :: Divide + type(Grid_Type) :: Grid + integer, intent(in) :: n_buff_layers ! number of buffer layers, keep it here +!------------------------------[Local parameters]------------------------------! + integer, parameter :: MARK = -1 !-----------------------------------[Locals]-----------------------------------! - integer :: c, n, s, c1, c2, sub, subo, i_nod, ss, sr, nn !exp:, lev + integer :: c, n, s, c1, c2, sub, subo, i_nod + integer :: ss, sr, nn, reg, bc_indx !exp:, lev integer :: nn_sub ! number of nodes in the subdomain integer :: nc_sub ! number of cells in the subdomain integer :: nf_sub ! number of faces in the subdomain integer :: ns_sub ! number of shadow faces in subdomain integer :: nbc_sub ! number of boundary cells in subdomain +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Divide) + Unused(n_buff_layers) !==============================================================================! !-------------------------------! @@ -49,7 +64,7 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) Grid % old_c(nc_sub) = c do i_nod = 1, abs(Grid % cells_n_nodes(c)) - Grid % new_n(Grid % cells_n(i_nod,c)) = -1 + Grid % new_n(Grid % cells_n(i_nod,c)) = MARK end do end if end do @@ -69,8 +84,8 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) Grid % Comm % cell_proc(c1) .eq. subo) then nn = Grid % faces_n_nodes(s) ss = Grid % faces_s(s) - Grid % new_n(Grid % faces_n(1:nn, s )) = -1 - Grid % new_n(Grid % faces_n(1:nn, ss)) = -1 + Grid % new_n(Grid % faces_n(1:nn, s )) = MARK + Grid % new_n(Grid % faces_n(1:nn, ss)) = MARK end if end if end do @@ -86,8 +101,8 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) do c = 1, Grid % n_cells if(Grid % Comm % cell_proc(c) .eq. subo) then n = abs(Grid % cells_n_nodes(c)) - if( any(Grid % new_n(Grid % cells_n(1:n, c)) .eq. -1) ) then - Grid % new_c(c) = -1 + if( any(Grid % new_n(Grid % cells_n(1:n, c)) .eq. MARK) ) then + Grid % new_c(c) = MARK end if end if end do @@ -97,9 +112,9 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) !exp: !exp: ! Mark nodes on this level ... !exp: do c = 1, Grid % n_cells -!exp: if(Grid % new_c(c) .eq. -1) then +!exp: if(Grid % new_c(c) .eq. MARK) then !exp: do i_nod = 1, abs(Grid % cells_n_nodes(c)) -!exp: Grid % new_n(Grid % cells_n(i_nod,c)) = -1 +!exp: Grid % new_n(Grid % cells_n(i_nod,c)) = MARK !exp: end do !exp: end if !exp: end do @@ -108,8 +123,8 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) !exp: do c = 1, Grid % n_cells !exp: if(Grid % Comm % cell_proc(c) .eq. subo) then !exp: n = abs(Grid % cells_n_nodes(c)) -!exp: if( any(Grid % new_n(Grid % cells_n(1:n, c)) .eq. -1) ) then -!exp: Grid % new_c(c) = -1 +!exp: if( any(Grid % new_n(Grid % cells_n(1:n, c)) .eq. MARK) ) then +!exp: Grid % new_c(c) = MARK !exp: end if !exp: end if !exp: end do @@ -118,7 +133,7 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) ! Renumber cells in buffer "subo" do c = 1, Grid % n_cells if(Grid % Comm % cell_proc(c) .eq. subo .and. & - Grid % new_c(c) .eq. -1) then + Grid % new_c(c) .eq. MARK) then nc_sub = nc_sub + 1 ! increase the number of cells in sub. Grid % new_c(c) = nc_sub ! assign new (local) cell number Grid % old_c(nc_sub) = c @@ -133,7 +148,8 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) ! Boundary cells ! ! ! !--------------------! - nbc_sub = 0 ! number of boundary cells in subdomain + bc_indx = -Grid % n_bnd_cells ! number of boundary cells in subdomain, ... + ! ... start from the smallest possible Grid % new_c(-Grid % n_bnd_cells:-1) = 0 Grid % old_c(-Grid % n_bnd_cells:-1) = 0 @@ -143,18 +159,18 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) do subo = 1, maxval(Grid % Comm % cell_proc(:)) if(subo .ne. sub) then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + Assert(c2 < 0) if( Grid % Comm % cell_proc(c1) .eq. subo .and. & Grid % new_c(c1) .ne. 0) then - nbc_sub = nbc_sub + 1 ! increase n. of bnd. cells - Grid % new_c(c2) = -nbc_sub ! new loc. number of bnd. cell - Grid % old_c(-nbc_sub) = c2 + Grid % new_c(c2) = bc_indx ! new loc. number of bnd. cell + bc_indx = bc_indx + 1 ! increase boundary cell counter end if - end if - end do + end do ! s + end do ! region end if ! subo .ne. sub end do ! subo @@ -162,15 +178,27 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) !----------------------------------------------! ! Step 2: boundary cells in the domain sub ! !----------------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + Assert(c2 < 0) if( Grid % Comm % cell_proc(c1) .eq. sub ) then - nbc_sub = nbc_sub + 1 ! increase n. of bnd. cells - Grid % new_c(c2) = -nbc_sub ! new loc. number of bnd. cell - Grid % old_c(-nbc_sub) = c2 + Grid % new_c(c2) = bc_indx ! new loc. number of bnd. cell + bc_indx = bc_indx + 1 ! increase boundary cell counter end if + end do + end do + + ! At this point, new boundary cell counters go from -Grid % n_bnd_cells + ! That is too low, all indices have to be increased in a way that maximum + ! boundary cell index is -1 + nbc_sub = 0 + do c = -Grid % n_bnd_cells, -1 + if(Grid % new_c(c) .ne. 0) then + Grid % new_c(c) = Grid % new_c(c) - bc_indx + Grid % old_c(Grid % new_c(c)) = c + nbc_sub = nbc_sub + 1 end if end do @@ -191,17 +219,19 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) ! If the faces in the original grid started from ! ! boundary faces, it should be the case here too.) ! !---------------------------------------------------------! - do s = 1, Grid % n_faces ! + n_shadows? probably not, shadows at the end - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Both cells are in the domain - if( Grid % Comm % cell_proc(c1) .eq. sub .and. & - Grid % Comm % cell_proc(c2) .eq. sub ) then - nf_sub = nf_sub + 1 - Grid % new_f(s) = nf_sub - Grid % old_f(nf_sub) = s - end if + do reg = Boundary_And_Inside_Regions() ! shadows? probably not, at the end + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + ! Both cells are in the domain + if( Grid % Comm % cell_proc(c1) .eq. sub .and. & + Grid % Comm % cell_proc(c2) .eq. sub ) then + nf_sub = nf_sub + 1 + Grid % new_f(s) = nf_sub + Grid % old_f(nf_sub) = s + end if + end do end do !-------------------------------------! @@ -211,24 +241,24 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) if(subo .ne. sub) then ! Faces half in the domain, half in the buffers - do s = 1, Grid % n_faces ! + n_shadows? naah, shadows at the end + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - if( (Grid % Comm % cell_proc(c1) .eq. sub) .and. & - (Grid % Comm % cell_proc(c2) .eq. subo) ) then - nf_sub = nf_sub + 1 - Grid % new_f(s) = nf_sub - Grid % old_f(nf_sub) = s - end if - if( (Grid % Comm % cell_proc(c2) .eq. sub) .and. & - (Grid % Comm % cell_proc(c1) .eq. subo) ) then - nf_sub = nf_sub + 1 - Grid % new_f(s) = nf_sub - Grid % old_f(nf_sub) = s - end if - end if ! c2 > 0 - end do ! through faces + + if( (Grid % Comm % cell_proc(c1) .eq. sub) .and. & + (Grid % Comm % cell_proc(c2) .eq. subo) ) then + nf_sub = nf_sub + 1 + Grid % new_f(s) = nf_sub + Grid % old_f(nf_sub) = s + end if + if( (Grid % Comm % cell_proc(c2) .eq. sub) .and. & + (Grid % Comm % cell_proc(c1) .eq. subo) ) then + nf_sub = nf_sub + 1 + Grid % new_f(s) = nf_sub + Grid % old_f(nf_sub) = s + end if + + end do ! through inside faces (region 0) end if ! subo .ne. sub end do ! subo @@ -236,23 +266,29 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) !------------------------------------------------! ! Step 3: All the remaining faces in buffers ! !------------------------------------------------! - do s = 1, Grid % n_faces ! + n_shadows? naah, shadows at the end - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_And_Inside_Regions() ! shadows? probably not, at the end + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! If any of its cells have been marked for saving ... - if(Grid % new_c(c1) .ne. 0 .or. & - Grid % new_c(c2) .ne. 0) then + ! If any of its cells have been marked for saving ... + if(Grid % new_c(c1) .ne. 0 .or. & + Grid % new_c(c2) .ne. 0) then - ! ... but the face hasn't, do it now! - if(Grid % new_f(s) .eq. 0) then - nf_sub = nf_sub + 1 - Grid % new_f(s) = nf_sub - Grid % old_f(nf_sub) = s - end if + ! ... but the face hasn't, do it now! + if(Grid % new_f(s) .eq. 0) then + + ! Neither of the cells should be in this sub, they are in buffers + Assert(Grid % Comm % cell_proc(c1) .ne. sub) + Assert(Grid % Comm % cell_proc(c2) .ne. sub) - end if ! new_c(c) .ne. 0 - end do ! c + nf_sub = nf_sub + 1 + Grid % new_f(s) = nf_sub + Grid % old_f(nf_sub) = s + end if + end if + end do + end do !--------------------------! ! Step 4: shadow faces ! @@ -287,24 +323,24 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) !-------------------------------------! Grid % new_n(1:Grid % n_nodes) = 0 - !-------------------------------------------------! - ! Mark nodes in cells for renumbering with -1 ! - !-------------------------------------------------! + !---------------------------------------------------! + ! Mark nodes in cells for renumbering with MARK ! + !---------------------------------------------------! do c = -Grid % n_bnd_cells, Grid % n_cells if(Grid % new_c(c) > 0) then do i_nod = 1, abs(Grid % cells_n_nodes(c)) - Grid % new_n(Grid % cells_n(i_nod,c)) = -1 + Grid % new_n(Grid % cells_n(i_nod,c)) = MARK end do end if end do - !-------------------------------------------------! - ! Mark nodes in faces for renumbering with -1 ! - !-------------------------------------------------! + !---------------------------------------------------! + ! Mark nodes in faces for renumbering with MARK ! + !---------------------------------------------------! do s = 1, Grid % n_faces + Grid % n_shadows if(Grid % new_f(s) > 0) then do i_nod = 1, Grid % faces_n_nodes(s) - Grid % new_n(Grid % faces_n(i_nod,s)) = -1 + Grid % new_n(Grid % faces_n(i_nod,s)) = MARK end do end if end do @@ -313,7 +349,7 @@ subroutine Save_Subdomains(Divide, Grid, n_buff_layers) ! Renumber marked nodes ! !---------------------------! do n = 1, Grid % n_nodes - if(Grid % new_n(n) .eq. -1) then + if(Grid % new_n(n) .eq. MARK) then nn_sub = nn_sub + 1 Grid % new_n(n) = nn_sub end if diff --git a/Sources/Divide/makefile b/Sources/Divide/makefile index 1b965cc9a..9c46a1698 100644 --- a/Sources/Divide/makefile +++ b/Sources/Divide/makefile @@ -8,11 +8,12 @@ # Default options for compilation #------------------------------------- FORTRAN ?= gnu -DEBUG ?= no ASSERT ?= yes +DEBUG ?= no +PROF ?= no REAL ?= double MPI ?= no -OPENMP ?= no +OMP ?= no # Directories for objects and modules. (No need to change.) DIR_BINARY = ../../Binaries @@ -29,22 +30,34 @@ PROGRAM_FILE = $(DIR_BINARY)/$(PROGRAM_NAME) # Initialize variables to pass on to preprocessor with # variable T_FLOWS_COMPILATION which, if set to one, # means unit is compiled from T-Flow -# It later adds T_FLOWS_MPI and T_FLOWS_PETSC #---------------------------------------------------------- PASS_ON = -DT_FLOWS_COMPILATION=1 + +#---------------------------------------------------------- +# Add T_FLOWS_PROGRAM, T_FLOWS_ASSERT and T_FLOWS_DEBUG +# and later on it add also T_FLOWS_MPI and T_FLOWS_PETSC +#---------------------------------------------------------- +PASS_ON += -DT_FLOWS_PROGRAM=2 + ifeq ($(ASSERT), yes) PASS_ON += -DT_FLOWS_ASSERT=1 else PASS_ON += -DT_FLOWS_ASSERT=0 endif +ifeq ($(DEBUG), yes) + PASS_ON += -DT_FLOWS_DEBUG=1 +else + PASS_ON += -DT_FLOWS_DEBUG=0 +endif + $(info #=======================================================================) -$(info # Compiling $(PROGRAM_NAME) with compiler $(FORTRAN) ) +$(info # Compiling $(PROGRAM_NAME) with $(FORTRAN) compiler ) $(info #-----------------------------------------------------------------------) $(info # Usage: ) $(info # make ) $(info # ) -$(info # ) +$(info # ) $(info # ) $(info # Note: The first item, for each of the options above, is the default. ) $(info # ) @@ -64,11 +77,17 @@ ifeq ($(REAL), single) endif #------------------------------------------------------------------------- +# # Compiler and linker options +# #------------------------------------------------------------------------- # Note: Changes only when support to a new Fortran compiler is added. #------------------------------------------------------------------------- +#----------- +# Intel +#----------- + # Fortran == intel ifeq ($(FORTRAN), intel) ifeq ($(FCOMP),) @@ -76,18 +95,30 @@ ifeq ($(FORTRAN), intel) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g -traceback -cpp + OPT_F_COMP += -O0 -g -traceback else - OPT_F_COMP = -module $(DIR_MODULE) -O3 -cpp + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -g -O2 -shared-intel -debug inline-debug-info \ + -D TBB_USE_THREADING_TOOLS endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -qopenmp + ifeq ($(PROF), yes) + OPT_F_COMP += -qopenmp-link dynamic -parallel-source-info=2 + endif endif +#------------ +# Nvidia +#------------ + # Fortran == nvidia else ifeq ($(FORTRAN), nvidia) ifeq ($(FCOMP),) @@ -95,18 +126,23 @@ else ifeq ($(FORTRAN), nvidia) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp -Mbackslash ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g + OPT_F_COMP += -O0 -g else - OPT_F_COMP = -module $(DIR_MODULE) -O3 + OPT_F_COMP += -O3 endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -mp endif +#--------- +# Gnu +#--------- + # Fortran == gnu else ifeq ($(FCOMP),) @@ -114,23 +150,22 @@ else else FC = $(FCOMP) endif + OPT_F_COMP = -J $(DIR_MODULE) -cpp -ffree-line-length-none ifeq ($(DEBUG), yes) - OPT_F_COMP = -J $(DIR_MODULE) -O0 -g -cpp \ - -ffree-line-length-none -fcheck=all -fwhole-file -fbacktrace \ - -ffpe-trap=invalid,zero,overflow -fimplicit-none \ - -Wall -Wextra -Waliasing -Wampersand -Warray-temporaries \ - -Wc-binding-type -Wcharacter-truncation -Wline-truncation \ - -Wconversion -finit-real=nan -Wintrinsics-std \ - -Wreal-q-constant -Wsurprising -Wtabs -Wunderflow \ - -Wintrinsic-shadow -Wunused-parameter -Walign-commons \ - -Wfunction-elimination -Wrealloc-lhs -Wrealloc-lhs-all \ - -Wtarget-lifetime -Wpedantic -fstack-check + OPT_F_COMP += -O0 -g -fcheck=all -Wunused-parameter -Wall \ + -Wno-integer-division else - OPT_F_COMP = -J $(DIR_MODULE) -O3 -cpp -ffree-line-length-none + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -pg -g endif ifeq ($(REAL), double) OPT_F_COMP += -fdefault-real-8 endif + ifeq ($(OMP), yes) + OPT_F_COMP += -fopenmp + endif endif #----------------------------------------------------------- @@ -154,8 +189,6 @@ endif #------------------------------------------------------ # Modules' order must obey their dependency # This list should therefore be written "by hand". -# Note: Modules written in lower case -# letters are candidates for deletion. #------------------------------------------------------ #------------- @@ -164,18 +197,20 @@ endif # Modules in shared directories SRC_F_MOD = Const_Mod.f90 \ + Region_Mod.f90 \ String_Mod.f90 \ - Tokenizer_Mod.f90 \ Comm_Mod.f90 \ Assert_Mod.f90 \ + Tokenizer_Mod.f90 \ Message_Mod.f90 \ + Vect_Mod.f90 \ + Control_Mod.f90 \ Profiler_Mod.f90 \ Math_Mod.f90 \ File_Mod.f90 \ Gen_Mod.f90 \ Vtk_Mod.f90 \ Metis_Mod.f90 \ - Boundary_Mod.f90 \ Swap_Mod.f90 \ Sort_Mod.f90 \ Grid_Mod.f90 @@ -203,26 +238,13 @@ OBJ_F_MOD = $(SRC_F_MOD:%.f90=$(DIR_OBJECT)/%.o) OBJ_F_FUN = $(SRC_F_FUN:%.f90=$(DIR_OBJECT)/%.o) OBJ = $(OBJ_F_MOD) $(OBJ_F_FUN) -#------------------------------------------------------- -# List of modules currently used for target "clean" -#------------------------------------------------------- -# Note: This doesn't need editing. -#------------------------------------------------------- -SRC_F_MOD_LOW = $(shell echo $(SRC_F_MOD) | tr A-Z a-z) -MOD = $(SRC_F_MOD_LOW:%.f90=$(DIR_MODULE)/%.mod) - #--------------------------------------------------------- # Default rule to build Fortran modules and functions #--------------------------------------------------------- # Note: This doesn't need editing. #--------------------------------------------------------- -# Fortran modules -$(DIR_OBJECT)/%.o: %.f90 %/*.f90 - @echo $(FC) $< - @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< - -# Fortran functions +# Fortran sources $(DIR_OBJECT)/%.o: %.f90 @echo $(FC) $< @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< diff --git a/Sources/Divide/makefile_explicit_dependencies b/Sources/Divide/makefile_explicit_dependencies index 3caf30f18..3985220af 100644 --- a/Sources/Divide/makefile_explicit_dependencies +++ b/Sources/Divide/makefile_explicit_dependencies @@ -1,13 +1,3 @@ -#--------------------------------------------------- -# Dependencies for: ./Divide_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Divide_Mod.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -Divide_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o - #--------------------------------------------------- # Dependencies for: ./Main_Div.f90 #--------------------------------------------------- @@ -16,52 +6,35 @@ $(DIR_OBJECT)/Divide_Mod.o \ Divide_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Divide_Mod/Logo_Div.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Logo_Div.o:\ -$(DIR_OBJECT)/Const_Mod.o - -#--------------------------------------------------- -# Dependencies for: ./Sort_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Sort_Mod.o:\ -$(DIR_OBJECT)/Swap_Mod.o \ -$(DIR_SHARED)/Swap_Mod/*.f90 \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Probe_1d_Nodes.f90 +# Dependencies for: ./Divide_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Nodes.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Divide_Mod.o:\ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 +Divide_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Grid_Mod.f90 +# Dependencies for: ./Message_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Grid_Mod.o:\ -$(DIR_OBJECT)/Vtk_Mod.o \ -$(DIR_SHARED)/Vtk_Mod/*.f90 \ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Metis_Mod.o \ -$(DIR_SHARED)/Metis_Mod/*.f90 \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Boundary_Mod.o +$(DIR_OBJECT)/Message_Mod.o:\ +$(DIR_OBJECT)/Tokenizer_Mod.o \ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Isoap_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Isoap_Mod.o:\ +$(DIR_OBJECT)/Polyhedron_Mod.o \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 \ +$(DIR_OBJECT)/Iso_Polygons_Mod.o \ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 \ +$(DIR_SHARED)/Isoap_Mod/readme \ +$(DIR_SHARED)/Isoap_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./File_Mod.f90 @@ -74,103 +47,149 @@ $(DIR_SHARED)/Message_Mod/*.f90 \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Control_Mod.f90 +# Dependencies for: ./Region_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Control_Mod.o:\ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_SHARED)/Control_Mod/*.f90 \ -$(DIR_SHARED)/Control_Mod/*/*.f90 +$(DIR_OBJECT)/Region_Mod.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Profiler_Mod.f90 +# Dependencies for: ./Gen_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Profiler_Mod.o:\ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 +$(DIR_OBJECT)/Gen_Mod.o:\ +$(DIR_SHARED)/Gen_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Swap_Mod.f90 +# Dependencies for: ./Sort_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Swap_Mod.o:\ -$(DIR_SHARED)/Swap_Mod/*.f90 +$(DIR_OBJECT)/Sort_Mod.o:\ +$(DIR_OBJECT)/Swap_Mod.o \ +$(DIR_SHARED)/Swap_Mod/*.f90 \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./String_Mod.f90 +# Dependencies for: ./Polyhedron_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/String_Mod.o:\ -$(DIR_SHARED)/String_Mod/*.f90 +$(DIR_OBJECT)/Polyhedron_Mod.o:\ +$(DIR_OBJECT)/Work_Mod.o \ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_2d.f90 +# Dependencies for: ./Control_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_2d.o:\ +$(DIR_OBJECT)/Control_Mod.o:\ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Probe_1d_Cells.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Probe_1d_Cells.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 +$(DIR_SHARED)/File_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Vtk_Mod.f90 +# Dependencies for: ./Message_Mod/Dashed_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Vtk_Mod.o:\ -$(DIR_SHARED)/Vtk_Mod/*.f90 \ +$(DIR_OBJECT)/Dashed_Line.o:\ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Comm_Mod.f90 +# Dependencies for: ./Message_Mod/Thin_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Comm_Mod.o:\ -$(DIR_OBJECT)/Const_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 +$(DIR_OBJECT)/Thin_Line.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Tokenizer_Mod.f90 +# Dependencies for: ./Message_Mod/Thick_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Tokenizer_Mod.o:\ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_OBJECT)/Thick_Line.o:\ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- # Dependencies for: ./Work_Mod.f90 #--------------------------------------------------- $(DIR_OBJECT)/Work_Mod.o:\ -$(DIR_SHARED)/Work_Mod/*.f90 \ $(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Dashed_Line.f90 +# Dependencies for: ./Probe_1d_Nodes.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Dashed_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Probe_1d_Nodes.o:\ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thin_Line.f90 +# Dependencies for: ./Vect_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thin_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Vect_Mod.o:\ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thick_Line.f90 +# Dependencies for: ./Profiler_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thick_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Profiler_Mod.o:\ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Control_Mod.o \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 \ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Boundary_Mod.f90 +# Dependencies for: ./Math_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Boundary_Mod.o:\ +$(DIR_OBJECT)/Math_Mod.o:\ +$(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o +#--------------------------------------------------- +# Dependencies for: ./Swap_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Swap_Mod.o:\ +$(DIR_SHARED)/Swap_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Assert_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Assert_Mod.o:\ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./String_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/String_Mod.o:\ +$(DIR_SHARED)/String_Mod/*.f90 + #--------------------------------------------------- # Dependencies for: ./Probe_1d_Cells_Nodes.f90 #--------------------------------------------------- @@ -186,29 +205,52 @@ $(DIR_OBJECT)/File_Mod.o \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Assert_Mod.f90 +# Dependencies for: ./Grid_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Assert_Mod.o:\ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_OBJECT)/Grid_Mod.o:\ +$(DIR_OBJECT)/Vtk_Mod.o \ +$(DIR_SHARED)/Vtk_Mod/*.f90 \ +$(DIR_OBJECT)/Vect_Mod.o \ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Metis_Mod.o \ +$(DIR_SHARED)/Metis_Mod/*.f90 \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod.f90 +# Dependencies for: ./Stl_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Message_Mod.o:\ -$(DIR_OBJECT)/Tokenizer_Mod.o \ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ -$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_OBJECT)/Stl_Mod.o:\ +$(DIR_SHARED)/Stl_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Comm_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Comm_Mod.o:\ $(DIR_OBJECT)/Const_Mod.o \ -$(DIR_OBJECT)/Assert_Mod.o \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_SHARED)/Comm_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Math_Mod.f90 +# Dependencies for: ./Iso_Polygons_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Math_Mod.o:\ -$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Iso_Polygons_Mod.o:\ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Vtk_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Vtk_Mod.o:\ +$(DIR_SHARED)/Vtk_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- @@ -220,21 +262,22 @@ $(DIR_OBJECT)/Assert_Mod.o \ $(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Gen_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Gen_Mod.o:\ -$(DIR_SHARED)/Gen_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Probe_1d_Cells.f90 +# Dependencies for: ./Probe_2d.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Cells.o:\ +$(DIR_OBJECT)/Probe_2d.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_SHARED)/File_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Tokenizer_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Tokenizer_Mod.o:\ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 diff --git a/Sources/Generate/Domain_Mod.f90 b/Sources/Generate/Domain_Mod.f90 index ec42caa57..9e23ac58e 100644 --- a/Sources/Generate/Domain_Mod.f90 +++ b/Sources/Generate/Domain_Mod.f90 @@ -3,11 +3,11 @@ module Domain_Mod !------------------------------------------------------------------------------! ! Domain as the one used in "Generator" ! !------------------------------------------------------------------------------! - use Gen_Mod ! a relict from the past - use Point_Mod, only: Point_Type - use Line_Mod, only: Line_Type - use Block_Mod, only: Block_Type - use Region_Mod, only: Region_Type ! to store boundary conditions + use Gen_Mod ! a relict from the past + use Point_Mod, only: Point_Type + use Line_Mod, only: Line_Type + use Block_Mod, only: Block_Type + use Range_Mod, only: Range_Type ! to store boundary conditions use Grid_Mod !------------------------------------------------------------------------------! implicit none @@ -21,13 +21,28 @@ module Domain_Mod integer :: n_points integer :: n_blocks integer :: n_lines - integer :: n_regions + integer :: n_ranges integer :: n_smooths - type(Point_Type), allocatable :: points(:) - type(Block_Type), allocatable :: blocks(:) - type(Line_Type), allocatable :: lines(:) - type(Region_Type), allocatable :: regions(:) + type(Point_Type), allocatable :: points(:) + type(Block_Type), allocatable :: blocks(:) + type(Line_Type), allocatable :: lines(:) + type(Range_Type), allocatable :: ranges(:) + + contains + procedure :: Allocate_Points + procedure :: Allocate_Blocks + procedure :: Allocate_Lines + procedure :: Allocate_Ranges + procedure :: Calculate_Node_Coordinates + procedure :: Connect_Blocks + procedure :: Connect_Periodicity + procedure :: Distribute_Nodes + procedure :: Distribute_Ranges + procedure :: Find_Line + procedure :: Find_Surface + procedure :: Is_Line_In_Block + procedure :: Laplace end type @@ -39,12 +54,12 @@ module Domain_Mod # include "Domain_Mod/Allocate_Points.f90" # include "Domain_Mod/Allocate_Blocks.f90" # include "Domain_Mod/Allocate_Lines.f90" -# include "Domain_Mod/Allocate_Regions.f90" +# include "Domain_Mod/Allocate_Ranges.f90" # include "Domain_Mod/Calculate_Node_Coordinates.f90" # include "Domain_Mod/Connect_Blocks.f90" # include "Domain_Mod/Connect_Periodicity.f90" # include "Domain_Mod/Distribute_Nodes.f90" -# include "Domain_Mod/Distribute_Regions.f90" +# include "Domain_Mod/Distribute_Ranges.f90" # include "Domain_Mod/Find_Line.f90" # include "Domain_Mod/Find_Surface.f90" # include "Domain_Mod/Is_Line_In_Block.f90" diff --git a/Sources/Generate/Domain_Mod/Allocate_Blocks.f90 b/Sources/Generate/Domain_Mod/Allocate_Blocks.f90 index 62cd886f6..f4bfd047d 100644 --- a/Sources/Generate/Domain_Mod/Allocate_Blocks.f90 +++ b/Sources/Generate/Domain_Mod/Allocate_Blocks.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Domain_Mod_Allocate_Blocks(dom, n) + subroutine Allocate_Blocks(Dom, n) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - integer :: n + class(Domain_Type) :: Dom + integer, intent(in) :: n !==============================================================================! - dom % n_blocks = n - allocate(dom % blocks(n)) + Dom % n_blocks = n + allocate(Dom % blocks(n)) end subroutine diff --git a/Sources/Generate/Domain_Mod/Allocate_Lines.f90 b/Sources/Generate/Domain_Mod/Allocate_Lines.f90 index 3c9226a42..f01dec268 100644 --- a/Sources/Generate/Domain_Mod/Allocate_Lines.f90 +++ b/Sources/Generate/Domain_Mod/Allocate_Lines.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Domain_Mod_Allocate_Lines(dom, n) + subroutine Allocate_Lines(Dom, n) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - integer :: n + class(Domain_Type) :: Dom + integer, intent(in) :: n !==============================================================================! - dom % n_lines = n - allocate(dom % lines(n)) + Dom % n_lines = n + allocate(Dom % lines(n)) end subroutine diff --git a/Sources/Generate/Domain_Mod/Allocate_Points.f90 b/Sources/Generate/Domain_Mod/Allocate_Points.f90 index d35a4e5e0..fd5f38108 100644 --- a/Sources/Generate/Domain_Mod/Allocate_Points.f90 +++ b/Sources/Generate/Domain_Mod/Allocate_Points.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Domain_Mod_Allocate_Points(dom, n) + subroutine Allocate_Points(Dom, n) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - integer :: n + class(Domain_Type) :: Dom + integer, intent(in) :: n !==============================================================================! - dom % n_points = n - allocate(dom % points(n)) + Dom % n_points = n + allocate(Dom % points(n)) end subroutine diff --git a/Sources/Generate/Domain_Mod/Allocate_Regions.f90 b/Sources/Generate/Domain_Mod/Allocate_Ranges.f90 similarity index 70% rename from Sources/Generate/Domain_Mod/Allocate_Regions.f90 rename to Sources/Generate/Domain_Mod/Allocate_Ranges.f90 index 2f430cb9d..a26a143d9 100644 --- a/Sources/Generate/Domain_Mod/Allocate_Regions.f90 +++ b/Sources/Generate/Domain_Mod/Allocate_Ranges.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Domain_Mod_Allocate_Regions(dom, n) + subroutine Allocate_Ranges(Dom, n) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - integer :: n + class(Domain_Type) :: Dom + integer, intent(in) :: n !==============================================================================! - dom % n_regions = n - allocate(dom % regions(n)) + Dom % n_ranges = n + allocate(Dom % ranges(n)) end subroutine diff --git a/Sources/Generate/Domain_Mod/Calculate_Node_Coordinates.f90 b/Sources/Generate/Domain_Mod/Calculate_Node_Coordinates.f90 index 213afa9b6..7f6cbb55e 100644 --- a/Sources/Generate/Domain_Mod/Calculate_Node_Coordinates.f90 +++ b/Sources/Generate/Domain_Mod/Calculate_Node_Coordinates.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) + subroutine Calculate_Node_Coordinates(Dom, Grid) !------------------------------------------------------------------------------! ! Calculate node coordinates inside the domain, block by block. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - type(Grid_Type) :: Grid + class(Domain_Type) :: Dom + type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: fc, b, bl, i, j, k, n, c, ig integer :: l, l1, l2 @@ -28,79 +28,78 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) Grid % n_nodes = 0 ! initialize n.o.n. Grid % n_cells = 0 ! initialize n.o.v. - do b = 1, size(dom % blocks) + do b = 1, size(Dom % blocks) print '(a38,i7)', '# Generating block: ', b - ni=dom % blocks(b) % resolutions(1) - nj=dom % blocks(b) % resolutions(2) - nk=dom % blocks(b) % resolutions(3) + ni = Dom % blocks(b) % resolutions(1) + nj = Dom % blocks(b) % resolutions(2) + nk = Dom % blocks(b) % resolutions(3) ! ( 1 ) n = Grid % n_nodes + ( 1-1)*ni*nj + ( 1-1)*ni + 1 - Grid % xn(n) = dom % points(dom % blocks(b) % corners(1)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(1)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(1)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(1)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(1)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(1)) % z ! ( 2 ) n = Grid % n_nodes + ( 1-1)*ni*nj + ( 1-1)*ni + ni - Grid % xn(n) = dom % points(dom % blocks(b) % corners(2)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(2)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(2)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(2)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(2)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(2)) % z ! ( 3 ) n = Grid % n_nodes + ( 1-1)*ni*nj + (nj-1)*ni + 1 - Grid % xn(n) = dom % points(dom % blocks(b) % corners(3)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(3)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(3)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(3)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(3)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(3)) % z ! ( 4 ) n = Grid % n_nodes + ( 1-1)*ni*nj + (nj-1)*ni + ni - Grid % xn(n) = dom % points(dom % blocks(b) % corners(4)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(4)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(4)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(4)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(4)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(4)) % z ! ( 5 ) ! n = Grid % n_nodes + (nk-1)*ni*nj + ( 1-1)*ni + 1 - Grid % xn(n) = dom % points(dom % blocks(b) % corners(5)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(5)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(5)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(5)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(5)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(5)) % z ! ( 6 ) ! n = Grid % n_nodes + (nk-1)*ni*nj + ( 1-1)*ni + ni - Grid % xn(n) = dom % points(dom % blocks(b) % corners(6)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(6)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(6)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(6)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(6)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(6)) % z ! ( 7 ) ! n = Grid % n_nodes + (nk-1)*ni*nj + (nj-1)*ni + 1 - Grid % xn(n) = dom % points(dom % blocks(b) % corners(7)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(7)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(7)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(7)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(7)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(7)) % z ! ( 8 ) ! n = Grid % n_nodes + (nk-1)*ni*nj + (nj-1)*ni + ni - Grid % xn(n) = dom % points(dom % blocks(b) % corners(8)) % x - Grid % yn(n) = dom % points(dom % blocks(b) % corners(8)) % y - Grid % zn(n) = dom % points(dom % blocks(b) % corners(8)) % z + Grid % xn(n) = Dom % points(Dom % blocks(b) % corners(8)) % x + Grid % yn(n) = Dom % points(Dom % blocks(b) % corners(8)) % y + Grid % zn(n) = Dom % points(Dom % blocks(b) % corners(8)) % z !------------------------------! - ! First on the dom % lines ! + ! First on the Dom % lines ! ! defined point by point ! !------------------------------! - do l=1, size(dom % lines) + do l=1, size(Dom % lines) - bl = Domain_Mod_Is_Line_in_Block(dom, & - dom % lines(l) % points(1), & - dom % lines(l) % points(2), & - b) + bl = Dom % Is_Line_in_Block(Dom % lines(l) % points(1), & + Dom % lines(l) % points(2), & + b) if(bl .eq. b) then do n = 1, 8 - if( dom % lines(l) % points(1) & - .eq. dom % blocks(b) % corners(n) ) l1=n - if( dom % lines(l) % points(2) & - .eq. dom % blocks(b) % corners(n) ) l2=n + if( Dom % lines(l) % points(1) & + .eq. Dom % blocks(b) % corners(n) ) l1=n + if( Dom % lines(l) % points(2) & + .eq. Dom % blocks(b) % corners(n) ) l2=n end do ! Line is defined in the +i direction @@ -112,29 +111,29 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) if( (l1 .eq. 1).or.(l1 .eq. 5) ) then trans(2,1) =1 else - trans(2,1) =dom % blocks(b) % resolutions(2) + trans(2,1) =Dom % blocks(b) % resolutions(2) end if if( (l1 .eq. 1).or.(l1 .eq. 3) ) then trans(3,1) =1 else - trans(3,1) =dom % blocks(b) % resolutions(3) + trans(3,1) =Dom % blocks(b) % resolutions(3) end if ! Line is defined in the -i direction else if( (l2-l1) .eq. -1 ) then - trans(1,1) =dom % blocks(b) % resolutions(1)+1 ! ni from block + 1 + trans(1,1) =Dom % blocks(b) % resolutions(1)+1 ! ni from block + 1 trans(1,2) =-1 trans(2,2) = 0 trans(3,2) = 0 if( (l1 .eq. 2).or.(l1 .eq. 6) ) then trans(2,1) =1 else - trans(2,1) =dom % blocks(b) % resolutions(2) + trans(2,1) =Dom % blocks(b) % resolutions(2) end if if( (l1 .eq. 2).or.(l1 .eq. 4) ) then trans(3,1) =1 else - trans(3,1) =dom % blocks(b) % resolutions(3) + trans(3,1) =Dom % blocks(b) % resolutions(3) end if ! Line is defined in the +j direction @@ -146,29 +145,29 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) if( (l1 .eq. 1).or.(l1 .eq. 5) ) then trans(1,1) =1 else - trans(1,1) =dom % blocks(b) % resolutions(1) + trans(1,1) =Dom % blocks(b) % resolutions(1) end if if( (l1 .eq. 1).or.(l1 .eq. 2) ) then trans(3,1) =1 else - trans(3,1) =dom % blocks(b) % resolutions(3) + trans(3,1) =Dom % blocks(b) % resolutions(3) end if ! Line is defined in the -j direction else if( (l2-l1) .eq. -2 ) then - trans(2,1) =dom % blocks(b) % resolutions(2)+1 ! nj from block + 1 + trans(2,1) =Dom % blocks(b) % resolutions(2)+1 ! nj from block + 1 trans(2,2) =-1 trans(1,2) = 0 trans(3,2) = 0 if( (l1 .eq. 3).or.(l1 .eq. 7) ) then trans(1,1) =1 else - trans(1,1) =dom % blocks(b) % resolutions(1) + trans(1,1) =Dom % blocks(b) % resolutions(1) end if if( (l1 .eq. 3).or.(l1 .eq. 4) ) then trans(3,1) =1 else - trans(3,1) =dom % blocks(b) % resolutions(3) + trans(3,1) =Dom % blocks(b) % resolutions(3) end if ! Line is defined in the +k direction @@ -180,47 +179,47 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) if( (l1 .eq. 1).or.(l1 .eq. 3) ) then trans(1,1) =1 else - trans(1,1) =dom % blocks(b) % resolutions(1) + trans(1,1) =Dom % blocks(b) % resolutions(1) end if if( (l1 .eq. 1).or.(l1 .eq. 2) ) then trans(2,1) =1 else - trans(2,1) =dom % blocks(b) % resolutions(2) + trans(2,1) =Dom % blocks(b) % resolutions(2) end if ! Line is defined in the -k direction else if( (l2-l1) .eq. -4 ) then - trans(3,1) =dom % blocks(b) % resolutions(3) + 1 ! nk from block + 1 + trans(3,1) =Dom % blocks(b) % resolutions(3) + 1 ! nk from block + 1 trans(3,2) =-1 trans(1,2) = 0 trans(2,2) = 0 if( (l1 .eq. 5).or.(l1 .eq. 7) ) then trans(1,1) =1 else - trans(1,1) =dom % blocks(b) % resolutions(1) + trans(1,1) =Dom % blocks(b) % resolutions(1) end if if( (l1 .eq. 5).or.(l1 .eq. 6) ) then trans(2,1) =1 else - trans(2,1) =dom % blocks(b) % resolutions(2) + trans(2,1) =Dom % blocks(b) % resolutions(2) end if end if ! l1-l2 ! Line is defined point by point - if( Math % Approx_Real( dom % lines(l) % weight, 0.0) ) then + if( Math % Approx_Real( Dom % lines(l) % weight, 0.0) ) then print *, '# Line: ', l print *, '# l1= ', l1 print *, '# l2= ', l2 - do ig=1,dom % lines(l) % resolution + do ig=1,Dom % lines(l) % resolution i=trans(1,1)+trans(1,2)*ig j=trans(2,1)+trans(2,2)*ig k=trans(3,1)+trans(3,2)*ig n = Grid % n_nodes + (k-1)*ni*nj + (j-1)*ni + i - Grid % xn(n) = dom % lines(l) % x(ig) - Grid % yn(n) = dom % lines(l) % y(ig) - Grid % zn(n) = dom % lines(l) % z(ig) + Grid % xn(n) = Dom % lines(l) % x(ig) + Grid % yn(n) = Dom % lines(l) % y(ig) + Grid % zn(n) = Dom % lines(l) % z(ig) end do ! Line is defined with a weight factor @@ -228,39 +227,39 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) is=trans(1,1)+trans(1,2) js=trans(2,1)+trans(2,2) ks=trans(3,1)+trans(3,2) - ie=trans(1,1)+trans(1,2)*dom % lines(l) % resolution - je=trans(2,1)+trans(2,2)*dom % lines(l) % resolution - ke=trans(3,1)+trans(3,2)*dom % lines(l) % resolution - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % lines(l) % weight, & + ie=trans(1,1)+trans(1,2)*Dom % lines(l) % resolution + je=trans(2,1)+trans(2,2)*Dom % lines(l) % resolution + ke=trans(3,1)+trans(3,2)*Dom % lines(l) % resolution + call Dom % Distribute_Nodes(Grid, & + b, Dom % lines(l) % weight, & is, js, ks, ie, je, ke) end if end if ! if the block contains - end do ! for the dom % lines + end do ! for the Dom % lines !-----------! ! Lines ! !-----------! do k=1,nk,nk-1 do j=1,nj,nj-1 - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % weights(1), 1,j,k,ni,j,k) + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % weights(1), 1,j,k,ni,j,k) end do end do do k=1,nk,nk-1 do i=1,ni,ni-1 - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % weights(2), i,1,k,i,nj,k) + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % weights(2), i,1,k,i,nj,k) end do end do do j=1,nj,nj-1 do i=1,ni,ni-1 - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % weights(3), i,j,1,i,j,nk) + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % weights(3), i,j,1,i,j,nk) end do end do @@ -268,23 +267,23 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) ! Surfaces... ! ! ! ! I think this is the propper way to calculate surfaces: ! - ! it spans the dom % lines in the direction of higher weigh ! + ! it spans the Dom % lines in the direction of higher weigh ! !---------------------------------------------------------------! ! I (k=1) fc = 1 ! face index k = 1 if( .not. Math % Approx_Real( & - dom % blocks(b) % face_weights(fc,1),1.0 ) ) then + Dom % blocks(b) % face_weights(fc,1),1.0 ) ) then do j=1,nj - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,1), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,1), & 1,j,k,ni,j,k) end do - else ! dom % lines in the j direction + else ! Dom % lines in the j direction do i=1,ni - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,2), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,2), & i,1,k,i,nj,k) end do end if @@ -293,16 +292,16 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) fc = 6 ! face index k = nk if( .not. Math % Approx_Real( & - dom % blocks(b) % face_weights(fc,1),1.0 ) ) then + Dom % blocks(b) % face_weights(fc,1),1.0 ) ) then do j=1,nj - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,1), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,1), & 1,j,k,ni,j,k) end do - else ! dom % lines in the j direction + else ! Dom % lines in the j direction do i=1,ni - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,2), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,2), & i,1,k,i,nj,k) end do end if @@ -311,16 +310,16 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) fc = 5 ! face index i = 1 if( .not. Math % Approx_Real( & - dom % blocks(b) % face_weights(fc,3),1.0 ) ) then + Dom % blocks(b) % face_weights(fc,3),1.0 ) ) then do j=1,nj - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,3), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,3), & i,j,1,i,j,nk) end do - else ! dom % lines in the j direction + else ! Dom % lines in the j direction do k=1,nk - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,2), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,2), & i,1,k,i,nj,k) end do end if @@ -329,16 +328,16 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) fc = 3 ! face index i = ni if( .not. Math % Approx_Real( & - dom % blocks(b) % face_weights(fc,3),1.0 ) ) then + Dom % blocks(b) % face_weights(fc,3),1.0 ) ) then do j=1,nj - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,3), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,3), & i,j,1,i,j,nk) end do - else ! dom % lines in the j direction + else ! Dom % lines in the j direction do k=1,nk - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,2), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,2), & i,1,k,i,nj,k) end do end if @@ -347,16 +346,16 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) fc = 2 ! face index j = 1 if( .not. Math % Approx_Real( & - dom % blocks(b) % face_weights(fc,3),1.0 ) ) then + Dom % blocks(b) % face_weights(fc,3),1.0 ) ) then do i=1,ni - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,3), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,3), & i,j,1,i,j,nk) end do - else ! dom % lines in the i direction + else ! Dom % lines in the i direction do k=1,nk - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,1), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,1), & 1,j,k,ni,j,k) end do end if @@ -365,16 +364,16 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) fc = 4 ! face index j = nj if( .not. Math % Approx_Real( & - dom % blocks(b) % face_weights(fc,3),1.0 ) ) then + Dom % blocks(b) % face_weights(fc,3),1.0 ) ) then do i=1,ni - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,3), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,3), & i,j,1,i,j,nk) end do - else ! dom % lines in the i direction + else ! Dom % lines in the i direction do k=1,nk - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % face_weights(fc,1), & + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % face_weights(fc,1), & 1,j,k,ni,j,k) end do end if @@ -383,27 +382,27 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) ! Volumes ! !-------------! if( .not. Math % Approx_Real( & - dom % blocks(b) % weights(3), 1.0 ) ) then + Dom % blocks(b) % weights(3), 1.0 ) ) then do i=1,ni do j=1,nj - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % weights(3), i,j,1,i,j,nk) + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % weights(3), i,j,1,i,j,nk) end do end do else if( .not. Math % Approx_Real( & - dom % blocks(b) % weights(1), 1.0 ) ) then + Dom % blocks(b) % weights(1), 1.0 ) ) then do k=1,nk do j=1,nj - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % weights(1), 1,j,k,ni,j,k) + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % weights(1), 1,j,k,ni,j,k) end do end do else if( .not. Math % Approx_Real( & - dom % blocks(b) % weights(2), 1.0 ) ) then + Dom % blocks(b) % weights(2), 1.0 ) ) then do k=1,nk do i=1,ni - call Domain_Mod_Distribute_Nodes(dom, Grid, & - b, dom % blocks(b) % weights(2), i,1,k,i,nj,k) + call Dom % Distribute_Nodes(Grid, & + b, Dom % blocks(b) % weights(2), i,1,k,i,nj,k) end do end do else @@ -412,10 +411,10 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) do j=1,nj do k=1,nk n = Grid % n_nodes+(k-1)*ni*nj + (j-1)*ni + i - call Domain_Mod_Laplace(dom, Grid, b, i, j, k, & - ONE_THIRD, ONE_THIRD, ONE_THIRD, & - ONE_THIRD, ONE_THIRD, ONE_THIRD, & - ONE_THIRD, ONE_THIRD, ONE_THIRD) + call Dom % Laplace(Grid, b, i, j, k, & + ONE_THIRD, ONE_THIRD, ONE_THIRD, & + ONE_THIRD, ONE_THIRD, ONE_THIRD, & + ONE_THIRD, ONE_THIRD, ONE_THIRD) end do end do end do @@ -468,11 +467,11 @@ subroutine Domain_Mod_Calculate_Node_Coordinates(dom, Grid) end do ! Old number of nodes and cells - dom % blocks(b) % n_nodes = Grid % n_nodes - dom % blocks(b) % n_cells = Grid % n_cells + Dom % blocks(b) % n_nodes = Grid % n_nodes + Dom % blocks(b) % n_cells = Grid % n_cells Grid % n_nodes = Grid % n_nodes + ni*nj*nk Grid % n_cells = Grid % n_cells + ci*cj*ck - end do ! through dom % blocks + end do ! through Dom % blocks end subroutine diff --git a/Sources/Generate/Domain_Mod/Connect_Blocks.f90 b/Sources/Generate/Domain_Mod/Connect_Blocks.f90 index 5eae3c224..0aebcfdda 100644 --- a/Sources/Generate/Domain_Mod/Connect_Blocks.f90 +++ b/Sources/Generate/Domain_Mod/Connect_Blocks.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Domain_Mod_Connect_Blocks(dom, Grid) + subroutine Connect_Blocks(Dom, Grid) !------------------------------------------------------------------------------! ! Solve the cell connectivity after block by block grid generation ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - type(Grid_Type) :: Grid + class(Domain_Type) :: Dom + type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: i, j, n ! counters integer :: b1, b2 ! block 1 and 2 @@ -14,11 +14,11 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) integer :: n11,n12,n13,n14,n21,n22,n23,n24 ! global node numbers integer :: l11,l12,l13,l14,l21,l22,l23,l24 ! local node numbers integer :: g1, g2, g3, g4 ! generic points - integer :: i1, j1, i2, j2, k1, k2 ! directions in dom % blocks + integer :: i1, j1, i2, j2, k1, k2 ! directions in Dom % blocks integer :: ig, jg, nig, njg ! generic plane - integer :: ci1, cj1, ck1, ci2, cj2, ck2 ! resolution of dom % blocks + integer :: ci1, cj1, ck1, ci2, cj2, ck2 ! resolution of Dom % blocks integer :: c1, c2 ! cells from block 1, 2 - integer :: ni1, nj1, nk1, ni2, nj2, nk2 ! resolution of dom % blocks + integer :: ni1, nj1, nk1, ni2, nj2, nk2 ! resolution of Dom % blocks integer :: n1, n2 ! from block 1, 2 integer :: trans1(3,3), trans2(3,3) integer :: del ! number of deleted nodes @@ -29,8 +29,8 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) Grid % new_n(n) = n end do - ! If number of dom % blocks is equal to one, there is nothing to do - if(size(dom % blocks) .eq. 1) return + ! If number of Dom % blocks is equal to one, there is nothing to do + if(size(Dom % blocks) .eq. 1) return ! Initialize the number of deleted nodes del=0 @@ -40,7 +40,7 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) !-----------------------------------------------------! ! Search through all block and all of their faces ! !-----------------------------------------------------! - do b2 = 2, size(dom % blocks) + do b2 = 2, size(Dom % blocks) do b1 = 1, b2-1 do f2 = 1, 6 ! faces of the second block do f1 = 1, 6 ! faces of the first block @@ -53,14 +53,14 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) end do end do - n11 = dom % blocks(b1) % faces(f1, 1) - n12 = dom % blocks(b1) % faces(f1, 2) - n13 = dom % blocks(b1) % faces(f1, 3) - n14 = dom % blocks(b1) % faces(f1, 4) - n21 = dom % blocks(b2) % faces(f2, 1) - n22 = dom % blocks(b2) % faces(f2, 2) - n23 = dom % blocks(b2) % faces(f2, 3) - n24 = dom % blocks(b2) % faces(f2, 4) + n11 = Dom % blocks(b1) % faces(f1, 1) + n12 = Dom % blocks(b1) % faces(f1, 2) + n13 = Dom % blocks(b1) % faces(f1, 3) + n14 = Dom % blocks(b1) % faces(f1, 4) + n21 = Dom % blocks(b2) % faces(f2, 1) + n22 = Dom % blocks(b2) % faces(f2, 2) + n23 = Dom % blocks(b2) % faces(f2, 3) + n24 = Dom % blocks(b2) % faces(f2, 4) ! Check if they are connected if( ((n11 .eq. n21).and.(n13 .eq. n23)) .or. & @@ -76,108 +76,108 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) ! Find local nodes (1-8) from blocks 1 and 2 on generic surface do n = 1, 8 - if(dom % blocks(b1) % corners(n) .eq. g1) l11=n - if(dom % blocks(b2) % corners(n) .eq. g1) l21=n - if(dom % blocks(b1) % corners(n) .eq. g2) l12=n - if(dom % blocks(b2) % corners(n) .eq. g2) l22=n - if(dom % blocks(b1) % corners(n) .eq. g3) l13=n - if(dom % blocks(b2) % corners(n) .eq. g3) l23=n - if(dom % blocks(b1) % corners(n) .eq. g4) l14=n - if(dom % blocks(b2) % corners(n) .eq. g4) l24=n + if(Dom % blocks(b1) % corners(n) .eq. g1) l11=n + if(Dom % blocks(b2) % corners(n) .eq. g1) l21=n + if(Dom % blocks(b1) % corners(n) .eq. g2) l12=n + if(Dom % blocks(b2) % corners(n) .eq. g2) l22=n + if(Dom % blocks(b1) % corners(n) .eq. g3) l13=n + if(Dom % blocks(b2) % corners(n) .eq. g3) l23=n + if(Dom % blocks(b1) % corners(n) .eq. g4) l14=n + if(Dom % blocks(b2) % corners(n) .eq. g4) l24=n end do ! Direction ig, block 1 if((l14-l11) .eq. +1) then - nig = dom % blocks(b1) % resolutions(1) ! ni from block 1 + nig = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,2)=+1 elseif((l14-l11) .eq. +2) then - nig = dom % blocks(b1) % resolutions(2) ! nj from block 1 + nig = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,2)=+1 elseif((l14-l11) .eq. +4) then - nig = dom % blocks(b1) % resolutions(3) ! nk from block 1 + nig = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,2)=+1 elseif((l14-l11) .eq. -1) then - nig = dom % blocks(b1) % resolutions(1) ! ni from block 1 + nig = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,1)=nig trans1(1,2)=-1 elseif((l14-l11) .eq. -2) then - nig = dom % blocks(b1) % resolutions(2) ! nj from block 1 + nig = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,1)=nig trans1(2,2)=-1 elseif((l14-l11) .eq. -4) then - nig = dom % blocks(b1) % resolutions(3) ! nk from block 1 + nig = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,1)=nig trans1(3,2)=-1 end if ! Direction jg, block 1 if((l12-l11) .eq. +1) then - njg = dom % blocks(b1) % resolutions(1) ! ni from block 1 + njg = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,3)=+1 elseif((l12-l11) .eq. +2) then - njg = dom % blocks(b1) % resolutions(2) ! nj from block 1 + njg = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,3)=+1 elseif((l12-l11) .eq. +4) then - njg = dom % blocks(b1) % resolutions(3) ! nk from block 1 + njg = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,3)=+1 elseif((l12-l11) .eq. -1) then - njg = dom % blocks(b1) % resolutions(1) ! ni from block 1 + njg = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,1)=njg trans1(1,3)=-1 elseif((l12-l11) .eq. -2) then - njg = dom % blocks(b1) % resolutions(2) ! nj from block 1 + njg = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,1)=njg trans1(2,3)=-1 elseif((l12-l11) .eq. -4) then - njg = dom % blocks(b1) % resolutions(3) ! nk from block 1 + njg = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,1)=njg trans1(3,3)=-1 end if ! Direction ig, block 2 if((l24-l21) .eq. +1) then - nig = dom % blocks(b2) % resolutions(1) ! ni from block 2 + nig = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,2)=+1 elseif((l24-l21) .eq. +2) then - nig = dom % blocks(b2) % resolutions(2) ! nj from block 2 + nig = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,2)=+1 elseif((l24-l21) .eq. +4) then - nig = dom % blocks(b2) % resolutions(3) ! nk from block 2 + nig = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,2)=+1 elseif((l24-l21) .eq. -1) then - nig = dom % blocks(b2) % resolutions(1) ! ni from block 2 + nig = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,1)=nig trans2(1,2)=-1 elseif((l24-l21) .eq. -2) then - nig = dom % blocks(b2) % resolutions(2) ! nj from block 2 + nig = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,1)=nig trans2(2,2)=-1 elseif((l24-l21) .eq. -4) then - nig = dom % blocks(b2) % resolutions(3) ! nk from block 2 + nig = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,1)=nig trans2(3,2)=-1 end if ! Direction jg, block 2 if((l22-l21) .eq. +1) then - njg = dom % blocks(b2) % resolutions(1) ! ni from block 2 + njg = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,3)=+1 elseif((l22-l21) .eq. +2) then - njg = dom % blocks(b2) % resolutions(2) ! nj from block 2 + njg = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,3)=+1 elseif((l22-l21) .eq. +4) then - njg = dom % blocks(b2) % resolutions(3) ! nk from block 2 + njg = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,3)=+1 elseif((l22-l21) .eq. -1) then - njg = dom % blocks(b2) % resolutions(1) ! ni from block 2 + njg = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,1)=njg trans2(1,3)=-1 elseif((l22-l21) .eq. -2) then - njg = dom % blocks(b2) % resolutions(2) ! nj from block 2 + njg = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,1)=njg trans2(2,3)=-1 elseif((l22-l21) .eq. -4) then - njg = dom % blocks(b2) % resolutions(3) ! nk from block 2 + njg = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,1)=njg trans2(3,3)=-1 end if @@ -185,36 +185,36 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) ! Set the constant directions if(f1 .eq. 1) trans1(3,1)=1 if(f1 .eq. 2) trans1(2,1)=1 - if(f1 .eq. 3) trans1(1,1)=dom % blocks(b1) % resolutions(1)-1 - if(f1 .eq. 4) trans1(2,1)=dom % blocks(b1) % resolutions(2)-1 + if(f1 .eq. 3) trans1(1,1)=Dom % blocks(b1) % resolutions(1)-1 + if(f1 .eq. 4) trans1(2,1)=Dom % blocks(b1) % resolutions(2)-1 if(f1 .eq. 5) trans1(1,1)=1 - if(f1 .eq. 6) trans1(3,1)=dom % blocks(b1) % resolutions(3)-1 + if(f1 .eq. 6) trans1(3,1)=Dom % blocks(b1) % resolutions(3)-1 if(f2 .eq. 1) trans2(3,1)=1 if(f2 .eq. 2) trans2(2,1)=1 - if(f2 .eq. 3) trans2(1,1)=dom % blocks(b2) % resolutions(1)-1 - if(f2 .eq. 4) trans2(2,1)=dom % blocks(b2) % resolutions(2)-1 + if(f2 .eq. 3) trans2(1,1)=Dom % blocks(b2) % resolutions(1)-1 + if(f2 .eq. 4) trans2(2,1)=Dom % blocks(b2) % resolutions(2)-1 if(f2 .eq. 5) trans2(1,1)=1 - if(f2 .eq. 6) trans2(3,1)=dom % blocks(b2) % resolutions(3)-1 + if(f2 .eq. 6) trans2(3,1)=Dom % blocks(b2) % resolutions(3)-1 - ! Finally conect the two dom % blocks + ! Finally conect the two Dom % blocks do jg=1,njg-1 ! through cells only do ig=1,nig-1 ! through cells only - ci1=dom % blocks(b1) % resolutions(1)-1 - cj1=dom % blocks(b1) % resolutions(2)-1 - ck1=dom % blocks(b1) % resolutions(3)-1 - ci2=dom % blocks(b2) % resolutions(1)-1 - cj2=dom % blocks(b2) % resolutions(2)-1 - ck2=dom % blocks(b2) % resolutions(3)-1 + ci1=Dom % blocks(b1) % resolutions(1)-1 + cj1=Dom % blocks(b1) % resolutions(2)-1 + ck1=Dom % blocks(b1) % resolutions(3)-1 + ci2=Dom % blocks(b2) % resolutions(1)-1 + cj2=Dom % blocks(b2) % resolutions(2)-1 + ck2=Dom % blocks(b2) % resolutions(3)-1 i1 = trans1(1,1) + trans1(1,2)*ig + trans1(1,3)*jg j1 = trans1(2,1) + trans1(2,2)*ig + trans1(2,3)*jg k1 = trans1(3,1) + trans1(3,2)*ig + trans1(3,3)*jg i2 = trans2(1,1) + trans2(1,2)*ig + trans2(1,3)*jg j2 = trans2(2,1) + trans2(2,2)*ig + trans2(2,3)*jg k2 = trans2(3,1) + trans2(3,2)*ig + trans2(3,3)*jg - c1 = dom % blocks(b1) % n_cells & + c1 = Dom % blocks(b1) % n_cells & + (k1-1)*ci1*cj1 + (j1-1)*ci1 + i1 - c2 = dom % blocks(b2) % n_cells & + c2 = Dom % blocks(b2) % n_cells & + (k2-1)*ci2*cj2 + (j2-1)*ci2 + i2 Grid % cells_c(f1,c1) = c2 Grid % cells_c(f2,c2) = c1 @@ -232,21 +232,21 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) ! Conect the nodes do jg=1,njg ! through nodes do ig=1,nig ! through nodes - ni1=dom % blocks(b1) % resolutions(1) - nj1=dom % blocks(b1) % resolutions(2) - nk1=dom % blocks(b1) % resolutions(3) - ni2=dom % blocks(b2) % resolutions(1) - nj2=dom % blocks(b2) % resolutions(2) - nk2=dom % blocks(b2) % resolutions(3) + ni1=Dom % blocks(b1) % resolutions(1) + nj1=Dom % blocks(b1) % resolutions(2) + nk1=Dom % blocks(b1) % resolutions(3) + ni2=Dom % blocks(b2) % resolutions(1) + nj2=Dom % blocks(b2) % resolutions(2) + nk2=Dom % blocks(b2) % resolutions(3) i1 = trans1(1,1) + trans1(1,2)*ig + trans1(1,3)*jg j1 = trans1(2,1) + trans1(2,2)*ig + trans1(2,3)*jg k1 = trans1(3,1) + trans1(3,2)*ig + trans1(3,3)*jg i2 = trans2(1,1) + trans2(1,2)*ig + trans2(1,3)*jg j2 = trans2(2,1) + trans2(2,2)*ig + trans2(2,3)*jg k2 = trans2(3,1) + trans2(3,2)*ig + trans2(3,3)*jg - n1 = dom % blocks(b1) % n_nodes & + n1 = Dom % blocks(b1) % n_nodes & + (k1-1)*ni1*nj1 + (j1-1)*ni1 + i1 - n2 = dom % blocks(b2) % n_nodes & + n2 = Dom % blocks(b2) % n_nodes & + (k2-1)*ni2*nj2 + (j2-1)*ni2 + i2 Grid % new_n(n2) = Grid % new_n(n1) end do @@ -259,8 +259,8 @@ subroutine Domain_Mod_Connect_Blocks(dom, Grid) end do ! b1 ! Update node numbers - do n = dom % blocks(b2) % n_nodes + 1, & - dom % blocks(b2) % n_nodes + ni2*nj2*nk2 + do n = Dom % blocks(b2) % n_nodes + 1, & + Dom % blocks(b2) % n_nodes + ni2*nj2*nk2 if(Grid % new_n(n) .ne. n) del = del + 1 if(Grid % new_n(n) .eq. n) Grid % new_n(n) = Grid % new_n(n) - del end do diff --git a/Sources/Generate/Domain_Mod/Connect_Periodicity.f90 b/Sources/Generate/Domain_Mod/Connect_Periodicity.f90 index e1e0a26c8..e7448dd7d 100644 --- a/Sources/Generate/Domain_Mod/Connect_Periodicity.f90 +++ b/Sources/Generate/Domain_Mod/Connect_Periodicity.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Domain_Mod_Connect_Periodicity(dom, Grid) + subroutine Connect_Periodicity(Dom, Grid) !------------------------------------------------------------------------------! ! Solve the cell connectivity for periodic boundary conditions. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - type(Grid_Type) :: Grid + class(Domain_Type) :: Dom + type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: i, j, n, p ! counters integer :: b1, b2 ! block 1 and 2 @@ -14,17 +14,17 @@ subroutine Domain_Mod_Connect_Periodicity(dom, Grid) integer :: n11,n12,n13,n14,n21,n22,n23,n24 ! global node numbers integer :: p11,p12,p13,p14,p21,p22,p23,p24 ! global node numbers integer :: l11,l12,l13,l14,l21,l22,l23,l24 ! local node numbers - integer :: i1, j1, i2, j2, k1, k2 ! directions in dom % blocks - integer :: ig, jg, nig, njg ! generic plane - integer :: ci1, cj1, ck1, ci2, cj2, ck2 ! resolution of dom % blocks + integer :: i1, j1, i2, j2, k1, k2 ! directions in Dom % blocks + integer :: ig, jg, nig, njg ! generic plane + integer :: ci1, cj1, ck1, ci2, cj2, ck2 ! resolution of Dom % blocks integer :: c1, c2 ! cells from block 1, 2 - integer :: ni1, nj1, nk1, ni2, nj2, nk2 ! resolution of dom % blocks + integer :: ni1, nj1, nk1, ni2, nj2, nk2 ! resolution of Dom % blocks integer :: n1, n2 ! from block 1, 2 integer :: n3, i3, new integer :: trans1(3,3), trans2(3,3) !==============================================================================! - ! Initialise twin_n. + ! Initialise twin_n do n = 1, Grid % max_n_nodes twin_n(n,0) = 0 end do @@ -32,13 +32,13 @@ subroutine Domain_Mod_Connect_Periodicity(dom, Grid) !-----------------------------------------------------! ! Search through all block and all of their faces ! !-----------------------------------------------------! - do p = 1, n_periodic_cond - do b2 = 1, size(dom % blocks) - do b1 = 1, size(dom % blocks) + do p = 1, n_periodic_cond + do b2 = 1, size(Dom % blocks) + do b1 = 1, size(Dom % blocks) do f2 = 1, 6 ! faces of the second block do f1 = 1, 6 ! faces of the first block - ! Initialize the transformation matrixes + ! Initialize the transformation matrixes do i=1,3 do j=1,3 trans1(i,j)=0 @@ -46,141 +46,141 @@ subroutine Domain_Mod_Connect_Periodicity(dom, Grid) end do end do - n11 = dom % blocks(b1) % faces(f1, 1) - n12 = dom % blocks(b1) % faces(f1, 2) - n13 = dom % blocks(b1) % faces(f1, 3) - n14 = dom % blocks(b1) % faces(f1, 4) - n21 = dom % blocks(b2) % faces(f2, 1) - n22 = dom % blocks(b2) % faces(f2, 2) - n23 = dom % blocks(b2) % faces(f2, 3) - n24 = dom % blocks(b2) % faces(f2, 4) + n11 = Dom % blocks(b1) % faces(f1, 1) + n12 = Dom % blocks(b1) % faces(f1, 2) + n13 = Dom % blocks(b1) % faces(f1, 3) + n14 = Dom % blocks(b1) % faces(f1, 4) + n21 = Dom % blocks(b2) % faces(f2, 1) + n22 = Dom % blocks(b2) % faces(f2, 2) + n23 = Dom % blocks(b2) % faces(f2, 3) + n24 = Dom % blocks(b2) % faces(f2, 4) p11=periodic_cond(p, 1) p12=periodic_cond(p, 2) p13=periodic_cond(p, 3) - p14=periodic_cond(p, 4) + p14=periodic_cond(p, 4) p21=periodic_cond(p, 5) p22=periodic_cond(p, 6) p23=periodic_cond(p, 7) p24=periodic_cond(p, 8) - ! Check if they are connected - if( ( ((n11 .eq. p11).and.(n13 .eq. p13)) .or. & - ((n11 .eq. p14).and.(n13 .eq. p12)) .or. & - ((n11 .eq. p13).and.(n13 .eq. p11)) .or. & - ((n11 .eq. p12).and.(n13 .eq. p14)) ) & - .and. & - ( ((n21 .eq. p21).and.(n23 .eq. p23)) .or. & - ((n21 .eq. p24).and.(n23 .eq. p22)) .or. & - ((n21 .eq. p23).and.(n23 .eq. p21)) .or. & - ((n21 .eq. p22).and.(n23 .eq. p24)) ) ) then + ! Check if they are connected + if( ( ((n11 .eq. p11).and.(n13 .eq. p13)) .or. & + ((n11 .eq. p14).and.(n13 .eq. p12)) .or. & + ((n11 .eq. p13).and.(n13 .eq. p11)) .or. & + ((n11 .eq. p12).and.(n13 .eq. p14)) ) & + .and. & + ( ((n21 .eq. p21).and.(n23 .eq. p23)) .or. & + ((n21 .eq. p24).and.(n23 .eq. p22)) .or. & + ((n21 .eq. p23).and.(n23 .eq. p21)) .or. & + ((n21 .eq. p22).and.(n23 .eq. p24)) ) ) then ! Find local nodes (1-8) from blocks 1 and 2 on generic surface do n=1,8 - if(dom % blocks(b1) % corners(n) .eq. p11) l11=n - if(dom % blocks(b1) % corners(n) .eq. p12) l12=n - if(dom % blocks(b1) % corners(n) .eq. p13) l13=n - if(dom % blocks(b1) % corners(n) .eq. p14) l14=n - if(dom % blocks(b2) % corners(n) .eq. p21) l21=n - if(dom % blocks(b2) % corners(n) .eq. p22) l22=n - if(dom % blocks(b2) % corners(n) .eq. p23) l23=n - if(dom % blocks(b2) % corners(n) .eq. p24) l24=n + if(Dom % blocks(b1) % corners(n) .eq. p11) l11=n + if(Dom % blocks(b1) % corners(n) .eq. p12) l12=n + if(Dom % blocks(b1) % corners(n) .eq. p13) l13=n + if(Dom % blocks(b1) % corners(n) .eq. p14) l14=n + if(Dom % blocks(b2) % corners(n) .eq. p21) l21=n + if(Dom % blocks(b2) % corners(n) .eq. p22) l22=n + if(Dom % blocks(b2) % corners(n) .eq. p23) l23=n + if(Dom % blocks(b2) % corners(n) .eq. p24) l24=n end do print '(a31,2i7)', '# Periodicity between blocks: ', b1, b2 ! Direction ig, block 1 if((l14-l11) .eq. +1) then - nig = dom % blocks(b1) % resolutions(1) ! ni from block 1 + nig = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,2)=+1 elseif((l14-l11) .eq. +2) then - nig = dom % blocks(b1) % resolutions(2) ! nj from block 1 + nig = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,2)=+1 - elseif((l14-l11) .eq. +4) then - nig = dom % blocks(b1) % resolutions(3) ! nk from block 1 + elseif((l14-l11) .eq. +4) then + nig = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,2)=+1 - elseif((l14-l11) .eq. -1) then - nig = dom % blocks(b1) % resolutions(1) ! ni from block 1 + elseif((l14-l11) .eq. -1) then + nig = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,1)=nig trans1(1,2)=-1 - elseif((l14-l11) .eq. -2) then - nig = dom % blocks(b1) % resolutions(2) ! nj from block 1 + elseif((l14-l11) .eq. -2) then + nig = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,1)=nig trans1(2,2)=-1 - elseif((l14-l11) .eq. -4) then - nig = dom % blocks(b1) % resolutions(3) ! nk from block 1 + elseif((l14-l11) .eq. -4) then + nig = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,1)=nig trans1(3,2)=-1 end if - ! Direction jg, block 1 - if((l12-l11) .eq. +1) then - njg = dom % blocks(b1) % resolutions(1) ! ni from block 1 + ! Direction jg, block 1 + if((l12-l11) .eq. +1) then + njg = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,3)=+1 elseif((l12-l11) .eq. +2) then - njg = dom % blocks(b1) % resolutions(2) ! nj from block 1 + njg = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,3)=+1 elseif((l12-l11) .eq. +4) then - njg = dom % blocks(b1) % resolutions(3) ! nk from block 1 + njg = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,3)=+1 elseif((l12-l11) .eq. -1) then - njg = dom % blocks(b1) % resolutions(1) ! ni from block 1 + njg = Dom % blocks(b1) % resolutions(1) ! ni from block 1 trans1(1,1)=njg trans1(1,3)=-1 elseif((l12-l11) .eq. -2) then - njg = dom % blocks(b1) % resolutions(2) ! nj from block 1 + njg = Dom % blocks(b1) % resolutions(2) ! nj from block 1 trans1(2,1)=njg trans1(2,3)=-1 elseif((l12-l11) .eq. -4) then - njg = dom % blocks(b1) % resolutions(3) ! nk from block 1 + njg = Dom % blocks(b1) % resolutions(3) ! nk from block 1 trans1(3,1)=njg trans1(3,3)=-1 end if ! Direction ig, block 2 if((l24-l21) .eq. +1) then - nig = dom % blocks(b2) % resolutions(1) ! ni from block 2 + nig = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,2)=+1 elseif((l24-l21) .eq. +2) then - nig = dom % blocks(b2) % resolutions(2) ! nj from block 2 + nig = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,2)=+1 - elseif((l24-l21) .eq. +4) then - nig = dom % blocks(b2) % resolutions(3) ! nk from block 2 + elseif((l24-l21) .eq. +4) then + nig = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,2)=+1 - elseif((l24-l21) .eq. -1) then - nig = dom % blocks(b2) % resolutions(1) ! ni from block 2 + elseif((l24-l21) .eq. -1) then + nig = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,1)=nig trans2(1,2)=-1 - elseif((l24-l21) .eq. -2) then - nig = dom % blocks(b2) % resolutions(2) ! nj from block 2 + elseif((l24-l21) .eq. -2) then + nig = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,1)=nig trans2(2,2)=-1 - elseif((l24-l21) .eq. -4) then - nig = dom % blocks(b2) % resolutions(3) ! nk from block 2 + elseif((l24-l21) .eq. -4) then + nig = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,1)=nig trans2(3,2)=-1 end if - ! Direction jg, block 2 - if((l22-l21) .eq. +1) then - njg = dom % blocks(b2) % resolutions(1) ! ni from block 2 + ! Direction jg, block 2 + if((l22-l21) .eq. +1) then + njg = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,3)=+1 elseif((l22-l21) .eq. +2) then - njg = dom % blocks(b2) % resolutions(2) ! nj from block 2 + njg = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,3)=+1 elseif((l22-l21) .eq. +4) then - njg = dom % blocks(b2) % resolutions(3) ! nk from block 2 + njg = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,3)=+1 elseif((l22-l21) .eq. -1) then - njg = dom % blocks(b2) % resolutions(1) ! ni from block 2 + njg = Dom % blocks(b2) % resolutions(1) ! ni from block 2 trans2(1,1)=njg trans2(1,3)=-1 elseif((l22-l21) .eq. -2) then - njg = dom % blocks(b2) % resolutions(2) ! nj from block 2 + njg = Dom % blocks(b2) % resolutions(2) ! nj from block 2 trans2(2,1)=njg trans2(2,3)=-1 elseif((l22-l21) .eq. -4) then - njg = dom % blocks(b2) % resolutions(3) ! nk from block 2 + njg = Dom % blocks(b2) % resolutions(3) ! nk from block 2 trans2(3,1)=njg trans2(3,3)=-1 end if @@ -188,36 +188,36 @@ subroutine Domain_Mod_Connect_Periodicity(dom, Grid) ! Set the constant directions if(f1 .eq. 1) trans1(3,1)=1 if(f1 .eq. 2) trans1(2,1)=1 - if(f1 .eq. 3) trans1(1,1)=dom % blocks(b1) % resolutions(1)-1 - if(f1 .eq. 4) trans1(2,1)=dom % blocks(b1) % resolutions(2)-1 + if(f1 .eq. 3) trans1(1,1)=Dom % blocks(b1) % resolutions(1)-1 + if(f1 .eq. 4) trans1(2,1)=Dom % blocks(b1) % resolutions(2)-1 if(f1 .eq. 5) trans1(1,1)=1 - if(f1 .eq. 6) trans1(3,1)=dom % blocks(b1) % resolutions(3)-1 + if(f1 .eq. 6) trans1(3,1)=Dom % blocks(b1) % resolutions(3)-1 if(f2 .eq. 1) trans2(3,1)=1 if(f2 .eq. 2) trans2(2,1)=1 - if(f2 .eq. 3) trans2(1,1)=dom % blocks(b2) % resolutions(1)-1 - if(f2 .eq. 4) trans2(2,1)=dom % blocks(b2) % resolutions(2)-1 + if(f2 .eq. 3) trans2(1,1)=Dom % blocks(b2) % resolutions(1)-1 + if(f2 .eq. 4) trans2(2,1)=Dom % blocks(b2) % resolutions(2)-1 if(f2 .eq. 5) trans2(1,1)=1 - if(f2 .eq. 6) trans2(3,1)=dom % blocks(b2) % resolutions(3)-1 + if(f2 .eq. 6) trans2(3,1)=Dom % blocks(b2) % resolutions(3)-1 ! Finally conect the two periodic boundaries do jg=1,njg-1 ! through cells only do ig=1,nig-1 ! through cells only - ci1=dom % blocks(b1) % resolutions(1)-1 - cj1=dom % blocks(b1) % resolutions(2)-1 - ck1=dom % blocks(b1) % resolutions(3)-1 - ci2=dom % blocks(b2) % resolutions(1)-1 - cj2=dom % blocks(b2) % resolutions(2)-1 - ck2=dom % blocks(b2) % resolutions(3)-1 + ci1=Dom % blocks(b1) % resolutions(1)-1 + cj1=Dom % blocks(b1) % resolutions(2)-1 + ck1=Dom % blocks(b1) % resolutions(3)-1 + ci2=Dom % blocks(b2) % resolutions(1)-1 + cj2=Dom % blocks(b2) % resolutions(2)-1 + ck2=Dom % blocks(b2) % resolutions(3)-1 i1 = trans1(1,1)+trans1(1,2)*ig+trans1(1,3)*jg j1 = trans1(2,1)+trans1(2,2)*ig+trans1(2,3)*jg - k1 = trans1(3,1)+trans1(3,2)*ig+trans1(3,3)*jg + k1 = trans1(3,1)+trans1(3,2)*ig+trans1(3,3)*jg i2 = trans2(1,1)+trans2(1,2)*ig+trans2(1,3)*jg j2 = trans2(2,1)+trans2(2,2)*ig+trans2(2,3)*jg k2 = trans2(3,1)+trans2(3,2)*ig+trans2(3,3)*jg - c1 = dom % blocks(b1) % n_cells & + c1 = Dom % blocks(b1) % n_cells & + (k1-1)*ci1*cj1 + (j1-1)*ci1 + i1 - c2 = dom % blocks(b2) % n_cells & + c2 = Dom % blocks(b2) % n_cells & + (k2-1)*ci2*cj2 + (j2-1)*ci2 + i2 Grid % cells_c(f1,c1) = c2 Grid % cells_c(f2,c2) = c1 @@ -230,26 +230,26 @@ subroutine Domain_Mod_Connect_Periodicity(dom, Grid) if(trans1(3,1) > 1) trans1(3,1)=trans1(3,1)+1 if(trans2(1,1) > 1) trans2(1,1)=trans2(1,1)+1 if(trans2(2,1) > 1) trans2(2,1)=trans2(2,1)+1 - if(trans2(3,1) > 1) trans2(3,1)=trans2(3,1)+1 + if(trans2(3,1) > 1) trans2(3,1)=trans2(3,1)+1 - ! Conect the nodes - do jg=1,njg ! through nodes + ! Conect the nodes + do jg=1,njg ! through nodes do ig=1,nig ! through nodes - ni1=dom % blocks(b1) % resolutions(1) - nj1=dom % blocks(b1) % resolutions(2) - nk1=dom % blocks(b1) % resolutions(3) - ni2=dom % blocks(b2) % resolutions(1) - nj2=dom % blocks(b2) % resolutions(2) - nk2=dom % blocks(b2) % resolutions(3) + ni1=Dom % blocks(b1) % resolutions(1) + nj1=Dom % blocks(b1) % resolutions(2) + nk1=Dom % blocks(b1) % resolutions(3) + ni2=Dom % blocks(b2) % resolutions(1) + nj2=Dom % blocks(b2) % resolutions(2) + nk2=Dom % blocks(b2) % resolutions(3) i1 = trans1(1,1) + trans1(1,2)*ig + trans1(1,3)*jg j1 = trans1(2,1) + trans1(2,2)*ig + trans1(2,3)*jg k1 = trans1(3,1) + trans1(3,2)*ig + trans1(3,3)*jg i2 = trans2(1,1) + trans2(1,2)*ig + trans2(1,3)*jg j2 = trans2(2,1) + trans2(2,2)*ig + trans2(2,3)*jg k2 = trans2(3,1) + trans2(3,2)*ig + trans2(3,3)*jg - n1 = dom % blocks(b1) % n_nodes & + n1 = Dom % blocks(b1) % n_nodes & + (k1-1)*ni1*nj1 + (j1-1)*ni1 + i1 - n2 = dom % blocks(b2) % n_nodes & + n2 = Dom % blocks(b2) % n_nodes & + (k2-1)*ni2*nj2 + (j2-1)*ni2 + i2 n1 = Grid % new_n(n1) n2 = Grid % new_n(n2) @@ -265,34 +265,34 @@ subroutine Domain_Mod_Connect_Periodicity(dom, Grid) twin_n(n2,0)=twin_n(n2,0)+1 twin_n(n2,twin_n(n2,0))=n1 -1 end do ! jg +1 end do ! jg end do ! ig - end if ! are they connected ? + end if ! are they connected ? end do ! f1 end do ! f2 end do ! b1 - end do ! b2 + end do ! b2 end do ! p periods !---------------------! - ! Twin of my twin ! + ! Twin of my twin ! ! is also my twin ! !---------------------! do n1=1,Grid % n_nodes do i1=1,twin_n(n1,0) - n2=twin_n(n1,i1) + n2=twin_n(n1,i1) do i2=1,twin_n(n2,0) n3=twin_n(n2,i2) ! twins from n2 new=n3 - do i3=1,twin_n(n1,0) - if( (twin_n(n1,i3) .eq. n3) .or. (n3 .eq. n1) ) new=0 + do i3=1,twin_n(n1,0) + if( (twin_n(n1,i3) .eq. n3) .or. (n3 .eq. n1) ) new=0 end do - if(new .eq. n3) then + if(new .eq. n3) then twin_n(n1,0)=twin_n(n1,0)+1 twin_n(n1,twin_n(n1,0))=n3 - end if + end if end do end do end do diff --git a/Sources/Generate/Domain_Mod/Distribute_Nodes.f90 b/Sources/Generate/Domain_Mod/Distribute_Nodes.f90 index 7eb5fef0a..e4867de8d 100644 --- a/Sources/Generate/Domain_Mod/Distribute_Nodes.f90 +++ b/Sources/Generate/Domain_Mod/Distribute_Nodes.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Domain_Mod_Distribute_Nodes(dom, Grid, b, w, & - is, js, ks, ie, je, ke) + subroutine Distribute_Nodes(Dom, Grid, b, w, & + is, js, ks, ie, je, ke) !------------------------------------------------------------------------------! ! Places the nodes on the line defined with local block position ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom + class(Domain_Type) :: Dom type(Grid_Type) :: Grid integer, intent(in) :: b, is, js, ks, ie, je, ke real, intent(in) :: w @@ -17,9 +17,9 @@ subroutine Domain_Mod_Distribute_Nodes(dom, Grid, b, w, & real :: x0, y0, z0, delx, dely, delz, t, dt, ddt, pr, xi !==============================================================================! - ni = dom % blocks(b) % resolutions(1) - nj = dom % blocks(b) % resolutions(2) - nk = dom % blocks(b) % resolutions(3) + ni = Dom % blocks(b) % resolutions(1) + nj = Dom % blocks(b) % resolutions(2) + nk = Dom % blocks(b) % resolutions(3) x0 = Grid % xn(Grid % n_nodes+(ks-1)*ni*nj+(js-1)*ni+is) y0 = Grid % yn(Grid % n_nodes+(ks-1)*ni*nj+(js-1)*ni+is) diff --git a/Sources/Generate/Domain_Mod/Distribute_Ranges.f90 b/Sources/Generate/Domain_Mod/Distribute_Ranges.f90 new file mode 100644 index 000000000..f70107aa0 --- /dev/null +++ b/Sources/Generate/Domain_Mod/Distribute_Ranges.f90 @@ -0,0 +1,116 @@ +!==============================================================================! + subroutine Distribute_Ranges(Dom, Grid) +!------------------------------------------------------------------------------! +! Distribute ranges (defined in .dom file) to boundary conditions ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Domain_Type) :: Dom + type(Grid_Type) :: Grid +!-----------------------------------[Locals]-----------------------------------! + integer :: b, i, j, k, n, c, r + integer :: n_bnd ! number of boundary conditions + integer :: is, js, ks, ie, je, ke, face + integer :: ci, cj, ck + logical :: found +!==============================================================================! + + !-----------------------------------------! + ! Insertion of the boundary condition ! + ! and materials information ! + !-----------------------------------------! + + ! This is too much memory but that's OK + ! (+1 is to store the default values) + call Grid % Allocate_Regions(Dom % n_ranges) + + ! Initialize number of boundary conditions + n_bnd = 0 + + do n = 1, Dom % n_ranges + + b = Dom % ranges(n) % block + + ! Block resolution + ci = Dom % blocks(b) % resolutions(1)-1 + cj = Dom % blocks(b) % resolutions(2)-1 + ck = Dom % blocks(b) % resolutions(3)-1 + + ! Default values + is = 1 + ie = ci + js = 1 + je = cj + ks = 1 + ke = ck + + ! Boundary conditions prescribed with mnemonics + if(Dom % ranges(n) % face .eq. 'IMIN') then + ie = 1 + face = 5 + else if(Dom % ranges(n) % face .eq. 'IMAX') then + is = ci + face = 3 + else if(Dom % ranges(n) % face .eq. 'JMIN') then + je = 1 + face = 2 + else if(Dom % ranges(n) % face .eq. 'JMAX') then + js = cj + face = 4 + else if(Dom % ranges(n) % face .eq. 'KMIN') then + ke = 1 + face = 1 + else if(Dom % ranges(n) % face .eq. 'KMAX') then + ks = ck + face = 6 + + ! Boundary conditions prescribed explicitly + ! (error prone and difficult, but might be usefull) + else + is = Dom % ranges(n) % is + js = Dom % ranges(n) % js + ks = Dom % ranges(n) % ks + ie = Dom % ranges(n) % ie + je = Dom % ranges(n) % je + ke = Dom % ranges(n) % ke + face = 0 + if( (is .eq. ie).and.(is .eq. 1) ) face = 5 + if( (is .eq. ie).and.(is .eq. ci) ) face = 3 + if( (js .eq. je).and.(js .eq. 1) ) face = 2 + if( (js .eq. je).and.(js .eq. cj) ) face = 4 + if( (ks .eq. ke).and.(ks .eq. 1) ) face = 1 + if( (ks .eq. ke).and.(ks .eq. ck) ) face = 6 + end if + + ! Store boundary condition + if(face .ne. 0) then + + found = .false. + do r=1,n_bnd + if( Grid % region % name(r) .eq. & + Dom % ranges(n) % name ) found = .true. + end do + if( .not. found) then + n_bnd = n_bnd + 1 + Grid % region % name(n_bnd) = Dom % ranges(n) % name + end if + + do i=is,ie + do j=js,je + do k=ks,ke + c = Dom % blocks(b) % n_cells + (k-1)*ci*cj + (j-1)*ci + i + Grid % cells_c(face,c) = -n_bnd + end do + end do + end do + + end if + + end do ! n_ranges + + ! Store the number of boundary conditions + Grid % n_bnd_regions = n_bnd + + call Grid % Print_Regions_List() + + end subroutine diff --git a/Sources/Generate/Domain_Mod/Distribute_Regions.f90 b/Sources/Generate/Domain_Mod/Distribute_Regions.f90 deleted file mode 100644 index 0e760bf18..000000000 --- a/Sources/Generate/Domain_Mod/Distribute_Regions.f90 +++ /dev/null @@ -1,116 +0,0 @@ -!==============================================================================! - subroutine Domain_Mod_Distribute_Regions(dom, Grid) -!------------------------------------------------------------------------------! -! Distribute regions (defined in .dom file) to boundary conditions ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - type(Grid_Type) :: Grid -!-----------------------------------[Locals]-----------------------------------! - integer :: b, i, j, k, n, c, r - integer :: n_bnd ! number of boundary conditions - integer :: is, js, ks, ie, je, ke, face - integer :: ci, cj, ck - logical :: found -!==============================================================================! - - !-----------------------------------------! - ! Insertion of the boundary condition ! - ! and materials information ! - !-----------------------------------------! - - ! This is too much memory but that's OK - ! (+1 is to store the default values) - allocate(Grid % bnd_cond % name(dom % n_regions + 1)) - - ! Initialize number of boundary conditions - n_bnd = 0 - - do n = 1, dom % n_regions - - b = dom % regions(n) % block - - ! Block resolution - ci = dom % blocks(b) % resolutions(1)-1 - cj = dom % blocks(b) % resolutions(2)-1 - ck = dom % blocks(b) % resolutions(3)-1 - - ! Default values - is = 1 - ie = ci - js = 1 - je = cj - ks = 1 - ke = ck - - ! Boundary conditions prescribed with mnemonics - if(dom % regions(n) % face .eq. 'IMIN') then - ie=1 - face = 5 - else if(dom % regions(n) % face .eq. 'IMAX') then - is=ci - face = 3 - else if(dom % regions(n) % face .eq. 'JMIN') then - je=1 - face = 2 - else if(dom % regions(n) % face .eq. 'JMAX') then - js=cj - face = 4 - else if(dom % regions(n) % face .eq. 'KMIN') then - ke=1 - face = 1 - else if(dom % regions(n) % face .eq. 'KMAX') then - ks=ck - face = 6 - - ! Boundary conditions prescribed explicitly - ! (error prone and difficult, but might be usefull) - else - is = dom % regions(n) % is - js = dom % regions(n) % js - ks = dom % regions(n) % ks - ie = dom % regions(n) % ie - je = dom % regions(n) % je - ke = dom % regions(n) % ke - face = 0 - if( (is .eq. ie).and.(is .eq. 1) ) face=5 - if( (is .eq. ie).and.(is .eq. ci) ) face=3 - if( (js .eq. je).and.(js .eq. 1) ) face=2 - if( (js .eq. je).and.(js .eq. cj) ) face=4 - if( (ks .eq. ke).and.(ks .eq. 1) ) face=1 - if( (ks .eq. ke).and.(ks .eq. ck) ) face=6 - end if - - ! Store boundary condition - if(face .ne. 0) then - - found = .false. - do r=1,n_bnd - if( Grid % bnd_cond % name(r) .eq. & - dom % regions(n) % name ) found = .true. - end do - if( .not. found) then - n_bnd = n_bnd + 1 - Grid % bnd_cond % name(n_bnd) = dom % regions(n) % name - end if - - do i=is,ie - do j=js,je - do k=ks,ke - c = dom % blocks(b) % n_cells + (k-1)*ci*cj + (j-1)*ci + i - Grid % cells_c(face,c) = -n_bnd - end do - end do - end do - - end if - - end do ! n_regions - - ! Store the number of boundary conditions - Grid % n_bnd_cond = n_bnd - - call Grid % Print_Bnd_Cond_List() - - end subroutine diff --git a/Sources/Generate/Domain_Mod/Find_Line.f90 b/Sources/Generate/Domain_Mod/Find_Line.f90 index 9fc11e083..c955a6caf 100644 --- a/Sources/Generate/Domain_Mod/Find_Line.f90 +++ b/Sources/Generate/Domain_Mod/Find_Line.f90 @@ -1,25 +1,25 @@ !==============================================================================! - subroutine Domain_Mod_Find_Line(dom, n1, n2, res) + subroutine Find_Line(Dom, n1, n2, res) !------------------------------------------------------------------------------! ! Searches for a smallest block where the line defined by n1-n2 is. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom + class(Domain_Type) :: Dom integer, intent(in) :: n1, n2 integer, intent(out) :: res !-----------------------------------[Locals]-----------------------------------! integer :: b, l1, l2 !==============================================================================! - do b = 1, size(dom % blocks) + do b = 1, size(Dom % blocks) do l1 = 1, 8 do l2 = 1, 8 - if( (dom % blocks(b) % corners(l1) .eq. n1) .and. & - (dom % blocks(b) % corners(l2) .eq. n2) ) then - if( iabs(l2-l1) .eq. 1 ) res = dom % blocks(b) % resolutions(1) - if( iabs(l2-l1) .eq. 2 ) res = dom % blocks(b) % resolutions(2) - if( iabs(l2-l1) .eq. 4 ) res = dom % blocks(b) % resolutions(3) + if( (Dom % blocks(b) % corners(l1) .eq. n1) .and. & + (Dom % blocks(b) % corners(l2) .eq. n2) ) then + if( iabs(l2-l1) .eq. 1 ) res = Dom % blocks(b) % resolutions(1) + if( iabs(l2-l1) .eq. 2 ) res = Dom % blocks(b) % resolutions(2) + if( iabs(l2-l1) .eq. 4 ) res = Dom % blocks(b) % resolutions(3) goto 1 end if end do diff --git a/Sources/Generate/Domain_Mod/Find_Surface.f90 b/Sources/Generate/Domain_Mod/Find_Surface.f90 index 1de22116a..f5d380ecb 100644 --- a/Sources/Generate/Domain_Mod/Find_Surface.f90 +++ b/Sources/Generate/Domain_Mod/Find_Surface.f90 @@ -1,23 +1,23 @@ !==============================================================================! - subroutine Domain_Mod_Find_Surface(dom, n1, n2, n3, n4, block, face) + subroutine Find_Surface(Dom, n1, n2, n3, n4, block, face) !------------------------------------------------------------------------------! ! Searches for a block where the surface defined by n1, n2, n3, n4 is. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom + class(Domain_Type) :: Dom integer, intent(in) :: n1, n2, n3, n4 integer, intent(out) :: block, face !-----------------------------------[Locals]-----------------------------------! integer :: b, fc, p1, p2, p3, p4 !==============================================================================! - do b = 1, size(dom % blocks) + do b = 1, size(Dom % blocks) do fc = 1, 6 - p1=dom % blocks(b) % faces(fc, 1) - p2=dom % blocks(b) % faces(fc, 2) - p3=dom % blocks(b) % faces(fc, 3) - p4=dom % blocks(b) % faces(fc, 4) + p1 = Dom % blocks(b) % faces(fc, 1) + p2 = Dom % blocks(b) % faces(fc, 2) + p3 = Dom % blocks(b) % faces(fc, 3) + p4 = Dom % blocks(b) % faces(fc, 4) if( ((p1 .eq. n1).and.(p3 .eq. n3)) .or. & ((p1 .eq. n4).and.(p3 .eq. n2)) .or. & ((p1 .eq. n3).and.(p3 .eq. n1)) .or. & diff --git a/Sources/Generate/Domain_Mod/Is_Line_In_Block.f90 b/Sources/Generate/Domain_Mod/Is_Line_In_Block.f90 index b1f9b5b35..d9205f657 100644 --- a/Sources/Generate/Domain_Mod/Is_Line_In_Block.f90 +++ b/Sources/Generate/Domain_Mod/Is_Line_In_Block.f90 @@ -1,29 +1,29 @@ !==============================================================================! - integer function Domain_Mod_Is_Line_In_Block(dom, n1, n2, b) + integer function Is_Line_In_Block(Dom, n1, n2, b) !------------------------------------------------------------------------------! ! Checks if the line defined n1 and n2 is inside the block b. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - integer :: b, n1, n2 + class(Domain_Type) :: Dom + integer, intent(in) :: b, n1, n2 !-----------------------------------[Locals]-----------------------------------! integer :: l1, l2 !==============================================================================! do l1=1,8 do l2=1,8 - if( (dom % blocks(b) % corners(l1) .eq. n1) .and. & - (dom % blocks(b) % corners(l2) .eq. n2) ) then + if( (Dom % blocks(b) % corners(l1) .eq. n1) .and. & + (Dom % blocks(b) % corners(l2) .eq. n2) ) then goto 1 end if end do end do - Domain_Mod_Is_Line_In_Block = 0 + Is_Line_In_Block = 0 return -1 Domain_Mod_Is_Line_In_Block = b +1 Is_Line_In_Block = b return end function diff --git a/Sources/Generate/Domain_Mod/Laplace.f90 b/Sources/Generate/Domain_Mod/Laplace.f90 index 3f532665a..251dc87a0 100644 --- a/Sources/Generate/Domain_Mod/Laplace.f90 +++ b/Sources/Generate/Domain_Mod/Laplace.f90 @@ -1,32 +1,32 @@ !==============================================================================! - subroutine Domain_Mod_Laplace(dom, Grid, b,i,j,k, wx16, wx24, wx35, & - wy16, wy24, wy35, & - wz16, wz24, wz35) + subroutine Laplace(Dom, Grid, b,i,j,k, wx16, wx24, wx35, & + wy16, wy24, wy35, & + wz16, wz24, wz35) !------------------------------------------------------------------------------! ! Places the nodes inside the block using Laplace-like function ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Domain_Type) :: dom - type(Grid_Type) :: Grid - integer :: b, i, j, k - real :: wx16, wx24, wx35, wy16, wy24, wy35, wz16, wz24, wz35 + class(Domain_Type) :: Dom + type(Grid_Type) :: Grid + integer, intent(in) :: b, i, j, k + real, intent(in) :: wx16, wx24, wx35, wy16, wy24, wy35, wz16, wz24, wz35 !-----------------------------------[Locals]-----------------------------------! real :: xt(8), yt(8), zt(8) integer :: ni, nj, nk, n, n1, n2, n3, n4, n5, n6 - real :: xf1, yf1, zf1, xf2, yf2, zf2, xf3, yf3, zf3 + real :: xf1, yf1, zf1, xf2, yf2, zf2, xf3, yf3, zf3 real :: xf4, yf4, zf4, xf5, yf5, zf5, xf6, yf6, zf6 !==============================================================================! - ni = dom % blocks(b) % resolutions(1) - nj = dom % blocks(b) % resolutions(2) - nk = dom % blocks(b) % resolutions(3) + ni = Dom % blocks(b) % resolutions(1) + nj = Dom % blocks(b) % resolutions(2) + nk = Dom % blocks(b) % resolutions(3) do n=1,8 - xt(n) = dom % points( dom % blocks(b) % corners(n) ) % x - yt(n) = dom % points( dom % blocks(b) % corners(n) ) % y - zt(n) = dom % points( dom % blocks(b) % corners(n) ) % z - end do + xt(n) = Dom % points( Dom % blocks(b) % corners(n) ) % x + yt(n) = Dom % points( Dom % blocks(b) % corners(n) ) % y + zt(n) = Dom % points( Dom % blocks(b) % corners(n) ) % z + end do n = Grid % n_nodes + (k-1)*ni*nj + (j-1)*ni + i diff --git a/Sources/Generate/Generate_Mod.f90 b/Sources/Generate/Generate_Mod.f90 index 3070b693f..1472ce135 100644 --- a/Sources/Generate/Generate_Mod.f90 +++ b/Sources/Generate/Generate_Mod.f90 @@ -1,3 +1,5 @@ +# include "../Shared/Unused.h90" + !==============================================================================! module Generate_Mod !------------------------------------------------------------------------------! diff --git a/Sources/Generate/Generate_Mod/Calculate_Geometry.f90 b/Sources/Generate/Generate_Mod/Calculate_Geometry.f90 index 63297b1af..ca36de8bd 100644 --- a/Sources/Generate/Generate_Mod/Calculate_Geometry.f90 +++ b/Sources/Generate/Generate_Mod/Calculate_Geometry.f90 @@ -11,18 +11,6 @@ subroutine Calculate_Geometry(Generate, Grid, real_run) ! Here, periodic faces are added to the existing (internal) ones, whereas ! ! in Convert_Mod, existing faces are turned into periodic ones. ! !------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Generate_Type) :: Generate - type(Grid_Type) :: Grid - logical, intent(in) :: real_run -!-----------------------------------[Locals]-----------------------------------! - integer :: c, c1, c2, m, s, n_per, nn, nf - real :: xs2, ys2, zs2, t, tot_surf - integer :: fn(6,4) -!------------------------------------------------------------------------------! - include 'Block_Numbering.f90' -!==============================================================================! ! ! ! n3 ! ! +---------------!---------------+ ! @@ -100,6 +88,20 @@ subroutine Calculate_Geometry(Generate, Grid, real_run) ! t = ----------------------------------------------------------- ! ! rx*sx + ry*sy + rz*sz ! ! ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Generate_Type) :: Generate + type(Grid_Type) :: Grid + logical, intent(in) :: real_run +!-----------------------------------[Locals]-----------------------------------! + integer :: c, c1, c2, m, s, n_per, nn, nf + real :: xs2, ys2, zs2, t, tot_surf + integer :: fn(6,4) +!------------------------------------------------------------------------------! + include 'Block_Numbering.f90' +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Generate) !==============================================================================! call Profiler % Start('Calculate_Geometry') diff --git a/Sources/Generate/Generate_Mod/Load_Dom.f90 b/Sources/Generate/Generate_Mod/Load_Dom.f90 index 3f00eb080..20e969574 100644 --- a/Sources/Generate/Generate_Mod/Load_Dom.f90 +++ b/Sources/Generate/Generate_Mod/Load_Dom.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Load_Dom(Generate, dom, smr, ref, Grid) + subroutine Load_Dom(Generate, Dom, smr, ref, Grid) !------------------------------------------------------------------------------! ! Reads: .dom file ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! class(Generate_Type) :: Generate - type(Domain_Type) :: dom + type(Domain_Type) :: Dom type(Smooths_Type) :: smr type(Refines_Type) :: ref type(Grid_Type) :: Grid @@ -21,6 +21,8 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) integer :: fn(6,4) !------------------------------------------------------------------------------! include 'Block_Numbering.f90' +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Generate) !==============================================================================! ! Copy face-node numbering for blocks @@ -59,8 +61,8 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) print *, '#', Grid % max_n_bnd_cells, ' boundary cells' print *, '#', Grid % max_n_faces, ' cell faces' - allocate (Grid % bnd_cond % color(-Grid % max_n_bnd_cells-1:-1)) - Grid % bnd_cond % color = 0 + allocate (Grid % region % at_cell(-Grid % max_n_bnd_cells-1:-1)) + Grid % region % at_cell = 0 ! Variables in Grid_Mod call Grid % Allocate_Nodes(Grid % max_n_nodes) @@ -86,88 +88,88 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) ! Corners ! !-------------! call File % Read_Line(fu) - read(Line % tokens(1), *) dom % n_points ! number of points + read(Line % tokens(1), *) Dom % n_points ! number of points - call Domain_Mod_Allocate_Points(dom, dom % n_points) + call Dom % Allocate_Points(Dom % n_points) - do i = 1, dom % n_points + do i = 1, Dom % n_points call File % Read_Line(fu) - read(Line % tokens(2),*) dom % points(i) % x - read(Line % tokens(3),*) dom % points(i) % y - read(Line % tokens(4),*) dom % points(i) % z + read(Line % tokens(2),*) Dom % points(i) % x + read(Line % tokens(3),*) Dom % points(i) % y + read(Line % tokens(4),*) Dom % points(i) % z end do !------------! ! Blocks ! !------------! call File % Read_Line(fu) - read(Line % tokens(1), *) dom % n_blocks ! number of blocks + read(Line % tokens(1), *) Dom % n_blocks ! number of blocks - call Domain_Mod_Allocate_Blocks(dom, dom % n_blocks) + call Dom % Allocate_Blocks(Dom % n_blocks) ! Initialize weights - do b=1, dom % n_blocks - dom % blocks(b) % weights = 1.0 - dom % blocks(b) % face_weights = 1.0 + do b=1, Dom % n_blocks + Dom % blocks(b) % weights = 1.0 + Dom % blocks(b) % face_weights = 1.0 end do - do b = 1, dom % n_blocks - dom % blocks(b) % corners(0)=1 ! suppose it is properly oriented + do b = 1, Dom % n_blocks + Dom % blocks(b) % corners(0)=1 ! suppose it is properly oriented call File % Read_Line(fu) - read(Line % tokens(2),*) dom % blocks(b) % resolutions(1) - read(Line % tokens(3),*) dom % blocks(b) % resolutions(2) - read(Line % tokens(4),*) dom % blocks(b) % resolutions(3) + read(Line % tokens(2),*) Dom % blocks(b) % resolutions(1) + read(Line % tokens(3),*) Dom % blocks(b) % resolutions(2) + read(Line % tokens(4),*) Dom % blocks(b) % resolutions(3) call File % Read_Line(fu) read(Line % whole, *) & ! block weights - dom % blocks(b) % weights(1), & - dom % blocks(b) % weights(2), & - dom % blocks(b) % weights(3) + Dom % blocks(b) % weights(1), & + Dom % blocks(b) % weights(2), & + Dom % blocks(b) % weights(3) call File % Read_Line(fu) read(Line % whole, *) & - dom % blocks(b) % corners(1), dom % blocks(b) % corners(2), & - dom % blocks(b) % corners(3), dom % blocks(b) % corners(4), & - dom % blocks(b) % corners(5), dom % blocks(b) % corners(6), & - dom % blocks(b) % corners(7), dom % blocks(b) % corners(8) + Dom % blocks(b) % corners(1), Dom % blocks(b) % corners(2), & + Dom % blocks(b) % corners(3), Dom % blocks(b) % corners(4), & + Dom % blocks(b) % corners(5), Dom % blocks(b) % corners(6), & + Dom % blocks(b) % corners(7), Dom % blocks(b) % corners(8) !---------------------------! ! Check if the block is ! ! properly oriented ! !---------------------------! do n=1,8 - xt(n) = dom % points(dom % blocks(b) % corners(n)) % x - yt(n) = dom % points(dom % blocks(b) % corners(n)) % y - zt(n) = dom % points(dom % blocks(b) % corners(n)) % z + xt(n) = Dom % points(Dom % blocks(b) % corners(n)) % x + yt(n) = Dom % points(Dom % blocks(b) % corners(n)) % y + zt(n) = Dom % points(Dom % blocks(b) % corners(n)) % z end do if(Math % Tet_Volume( xt(2),yt(2),zt(2), xt(5),yt(5),zt(5), & xt(3),yt(3),zt(3), xt(1),yt(1),zt(1) ) < 0) then - dom % blocks(b) % corners(0)=-1 ! It's nor properly oriented - call Swap_Int(dom % blocks(b) % corners(2), & - dom % blocks(b) % corners(3)) - call Swap_Int(dom % blocks(b) % corners(6), & - dom % blocks(b) % corners(7)) - call Swap_Real(dom % blocks(b) % weights(1), & - dom % blocks(b) % weights(2)) - dom % blocks(b) % weights(1) = 1.0 / dom % blocks(b) % weights(1) - dom % blocks(b) % weights(2) = 1.0 / dom % blocks(b) % weights(2) - call Swap_Int(dom % blocks(b) % resolutions(1), & - dom % blocks(b) % resolutions(2)) + Dom % blocks(b) % corners(0)=-1 ! It's nor properly oriented + call Swap_Int(Dom % blocks(b) % corners(2), & + Dom % blocks(b) % corners(3)) + call Swap_Int(Dom % blocks(b) % corners(6), & + Dom % blocks(b) % corners(7)) + call Swap_Real(Dom % blocks(b) % weights(1), & + Dom % blocks(b) % weights(2)) + Dom % blocks(b) % weights(1) = 1.0 / Dom % blocks(b) % weights(1) + Dom % blocks(b) % weights(2) = 1.0 / Dom % blocks(b) % weights(2) + call Swap_Int(Dom % blocks(b) % resolutions(1), & + Dom % blocks(b) % resolutions(2)) print *, 'Warning: Block ',b,' was not properly oriented' end if - end do ! through dom % blocks + end do ! through Dom % blocks !-----------------------------! ! Set the corners of each ! ! face of the block ! !-----------------------------! - do b = 1, dom % n_blocks + do b = 1, Dom % n_blocks do i_fac = 1, 6 do n = 1, 4 - dom % blocks(b) % faces(i_fac, n) = & - dom % blocks(b) % corners(fn(i_fac,n)) + Dom % blocks(b) % faces(i_fac, n) = & + Dom % blocks(b) % corners(fn(i_fac,n)) end do end do end do @@ -179,40 +181,39 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) ! or with just a weighting factor. ! !----------------------------------------------! call File % Read_Line(fu) - read(Line % tokens(1), *) dom % n_lines ! number of defined dom % lines + read(Line % tokens(1), *) Dom % n_lines ! number of defined Dom % lines - call Domain_Mod_Allocate_Lines(dom, dom % n_lines) + call Dom % Allocate_Lines(Dom % n_lines) - do l=1, dom % n_lines + do l=1, Dom % n_lines call File % Read_Line(fu) read(Line % tokens(1),*) npnt - read(Line % tokens(2),*) dom % lines(l) % points(1) - read(Line % tokens(3),*) dom % lines(l) % points(2) + read(Line % tokens(2),*) Dom % lines(l) % points(1) + read(Line % tokens(3),*) Dom % lines(l) % points(2) - call Domain_Mod_Find_Line(dom, & - dom % lines(l) % points(1), & - dom % lines(l) % points(2), & - dom % lines(l) % resolution) + call Dom % Find_Line(Dom % lines(l) % points(1), & + Dom % lines(l) % points(2), & + Dom % lines(l) % resolution) ! Does this need a more elegant solution? - allocate(dom % lines(l) % x( dom % lines(l) % resolution )) - allocate(dom % lines(l) % y( dom % lines(l) % resolution )) - allocate(dom % lines(l) % z( dom % lines(l) % resolution )) + allocate(Dom % lines(l) % x( Dom % lines(l) % resolution )) + allocate(Dom % lines(l) % y( Dom % lines(l) % resolution )) + allocate(Dom % lines(l) % z( Dom % lines(l) % resolution )) ! Point by point if(npnt > 0) then - do n=1,dom % lines(l) % resolution + do n=1,Dom % lines(l) % resolution call File % Read_Line(fu) - read(Line % tokens(2),*) dom % lines(l) % x(n) - read(Line % tokens(3),*) dom % lines(l) % y(n) - read(Line % tokens(4),*) dom % lines(l) % z(n) + read(Line % tokens(2),*) Dom % lines(l) % x(n) + read(Line % tokens(3),*) Dom % lines(l) % y(n) + read(Line % tokens(4),*) Dom % lines(l) % z(n) end do ! Weight factor else call File % Read_Line(fu) - read(Line % tokens(1), *) dom % lines(l) % weight + read(Line % tokens(1), *) Dom % lines(l) % weight end if end do @@ -220,11 +221,11 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) !----------------------------------------! ! Copy block weights to face weights ! !----------------------------------------! - do b = 1, dom % n_blocks + do b = 1, Dom % n_blocks do i_fac = 1,6 ! face of the block - dom % blocks(b) % face_weights(i_fac, 1) = dom % blocks(b) % weights(1) - dom % blocks(b) % face_weights(i_fac, 2) = dom % blocks(b) % weights(2) - dom % blocks(b) % face_weights(i_fac, 3) = dom % blocks(b) % weights(3) + Dom % blocks(b) % face_weights(i_fac, 1) = Dom % blocks(b) % weights(1) + Dom % blocks(b) % face_weights(i_fac, 2) = Dom % blocks(b) % weights(2) + Dom % blocks(b) % face_weights(i_fac, 3) = Dom % blocks(b) % weights(3) end do end do @@ -237,14 +238,14 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) do s = 1, nsurf call File % Read_Line(fu) read(Line % whole,*) dum, n1, n2, n3, n4 - call Domain_Mod_Find_Surface(dom, n1, n2, n3, n4, b, i_fac) + call Dom % Find_Surface(n1, n2, n3, n4, b, i_fac) print *, '# block: ', b, ' surf: ', i_fac n = (b-1)*6 + i_fac ! surface number call File % Read_Line(fu) - read(Line % whole, *) dom % blocks(b) % face_weights(i_fac,1), & - dom % blocks(b) % face_weights(i_fac,2), & - dom % blocks(b) % face_weights(i_fac,2) + read(Line % whole, *) Dom % blocks(b) % face_weights(i_fac,1), & + Dom % blocks(b) % face_weights(i_fac,2), & + Dom % blocks(b) % face_weights(i_fac,2) end do !---------------------------------------! @@ -254,10 +255,10 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) ! Nodes & faces n_nodes_check = 0 n_faces_check = 0 - do b = 1, dom % n_blocks - ni = dom % blocks(b) % resolutions(1) - nj = dom % blocks(b) % resolutions(2) - nk = dom % blocks(b) % resolutions(3) + do b = 1, Dom % n_blocks + ni = Dom % blocks(b) % resolutions(1) + nj = Dom % blocks(b) % resolutions(2) + nk = Dom % blocks(b) % resolutions(3) n_nodes_check=n_nodes_check + ni*nj*nk n_faces_check=n_faces_check + ni*nj*nk + 2*( (ni*nj)+(nj*nk)+(ni*nk) ) end do @@ -290,38 +291,37 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) ! Boundary conditions and materials ! !---------------------------------------! call File % Read_Line(fu) - read(Line % tokens(1), *) dom % n_regions ! number of regions (can be bnd. + read(Line % tokens(1), *) Dom % n_ranges ! number of ranges (can be bnd. ! conditions or materials) + call Dom % Allocate_Ranges(Dom % n_ranges) - call Domain_Mod_Allocate_Regions(dom, dom % n_regions) - - do n = 1, dom % n_regions - dom % regions(n) % face='' + do n = 1, Dom % n_ranges + Dom % ranges(n) % face='' call File % Read_Line(fu) if(Line % n_tokens .eq. 7) then - read(Line % whole,*) dum, & - dom % regions(n) % is, & - dom % regions(n) % js, & - dom % regions(n) % ks, & - dom % regions(n) % ie, & - dom % regions(n) % je, & - dom % regions(n) % ke + read(Line % whole,*) dum, & + Dom % ranges(n) % is, & + Dom % ranges(n) % js, & + Dom % ranges(n) % ks, & + Dom % ranges(n) % ie, & + Dom % ranges(n) % je, & + Dom % ranges(n) % ke else if(Line % n_tokens .eq. 2) then read(Line % tokens(1),*) dum read(Line % tokens(2),'(A4)') & - dom % regions(n) % face - call String % To_Upper_Case(dom % regions(n) % face) + Dom % ranges(n) % face + call String % To_Upper_Case(Dom % ranges(n) % face) end if call File % Read_Line(fu) - read(Line % tokens(1), *) dom % regions(n) % block - read(Line % tokens(2), *) dom % regions(n) % name - call String % To_Upper_Case(dom % regions(n) % name) + read(Line % tokens(1), *) Dom % ranges(n) % block + read(Line % tokens(2), *) Dom % ranges(n) % name + call String % To_Upper_Case(Dom % ranges(n) % name) - ! if( dom % blocks(b_cond(n,7)) % points(0) .eq. -1 ) then - ! call Swap_Int( dom % regions(n) % is,dom % regions(n) % js ) - ! call Swap_Int( dom % regions(n) % ie,dom % regions(n) % je ) + ! if( Dom % blocks(b_cond(n,7)) % points(0) .eq. -1 ) then + ! call Swap_Int( Dom % ranges(n) % is,Dom % ranges(n) % js ) + ! call Swap_Int( Dom % ranges(n) % ie,Dom % ranges(n) % je ) ! end if end do @@ -350,9 +350,9 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) call File % Read_Line(fu) read(Line % tokens(1), *) dumi ! used to be number of copy boundaries - !-----------------------------------! - ! Refinement levels and regions ! - !-----------------------------------! + !----------------------------------! + ! Refinement levels and ranges ! + !----------------------------------! call File % Read_Line(fu) read(Line % tokens(1), *) ref % n_levels ! number of refinement levels print '(a38,i7)', '# Number of refinement levels: ', ref % n_levels @@ -362,40 +362,40 @@ subroutine Load_Dom(Generate, dom, smr, ref, Grid) do l = 1, ref % n_levels print *, '# Level: ', l call File % Read_Line(fu) - read(Line % tokens(2), *) ref % n_regions(l) + read(Line % tokens(2), *) ref % n_ranges(l) - ! Browse through regions in level "l" - do n = 1, ref % n_regions(l) + ! Browse through ranges in level "l" + do n = 1, ref % n_ranges(l) call File % Read_Line(fu) read(Line % tokens(3),*) answer call String % To_Upper_Case(answer) - ref % region(l,n) % shape = -1 - if(answer .eq. 'RECTANGLE') ref % region(l,n) % shape = RECTANGLE - if(answer .eq. 'ELIPSOID') ref % region(l,n) % shape = ELIPSOID - if(answer .eq. 'PLANE') ref % region(l,n) % shape = PLANE - if(ref % region(l,n) % shape .eq. -1) then + ref % range(l,n) % shape = -1 + if(answer .eq. 'RECTANGLE') ref % range(l,n) % shape = RECTANGLE + if(answer .eq. 'ELIPSOID') ref % range(l,n) % shape = ELIPSOID + if(answer .eq. 'PLANE') ref % range(l,n) % shape = PLANE + if(ref % range(l,n) % shape .eq. -1) then print *, 'ERROR! Refinement shape not specified well by: ', answer stop end if call File % Read_Line(fu) - read(Line % whole, *) & - ref % region(l,n) % pnt(1) % x, & - ref % region(l,n) % pnt(1) % y, & - ref % region(l,n) % pnt(1) % z, & - ref % region(l,n) % pnt(2) % x, & - ref % region(l,n) % pnt(2) % y, & - ref % region(l,n) % pnt(2) % z + read(Line % whole, *) & + ref % range(l,n) % pnt(1) % x, & + ref % range(l,n) % pnt(1) % y, & + ref % range(l,n) % pnt(1) % z, & + ref % range(l,n) % pnt(2) % x, & + ref % range(l,n) % pnt(2) % y, & + ref % range(l,n) % pnt(2) % z end do end do - !-----------------------! - ! Smoothing regions ! - !-----------------------! + !----------------------! + ! Smoothing ranges ! + !----------------------! call File % Read_Line(fu) - read(Line % tokens(1), *) smr % n_smooths ! number of smoothing regions + read(Line % tokens(1), *) smr % n_smooths ! number of smoothing ranges - print '(a38,i7)', '# Number of (non)smoothing regions: ', smr % n_smooths + print '(a38,i7)', '# Number of (non)smoothing ranges: ', smr % n_smooths call Smooths_Mod_Allocate_Smooths(smr, smr % n_smooths) diff --git a/Sources/Generate/Generate_Mod/Logo_Gen.f90 b/Sources/Generate/Generate_Mod/Logo_Gen.f90 index d82726ca5..d0d6bfdda 100644 --- a/Sources/Generate/Generate_Mod/Logo_Gen.f90 +++ b/Sources/Generate/Generate_Mod/Logo_Gen.f90 @@ -4,6 +4,8 @@ subroutine Logo_Gen(Generate) implicit none !---------------------------------[Arguments]----------------------------------! class(Generate_Type) :: Generate +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Generate) !==============================================================================! print *,'#===================================' // & diff --git a/Sources/Generate/Generate_Mod/Print_Generate_Statistics.f90 b/Sources/Generate/Generate_Mod/Print_Generate_Statistics.f90 index 4f58d0cfa..5973d284a 100644 --- a/Sources/Generate/Generate_Mod/Print_Generate_Statistics.f90 +++ b/Sources/Generate/Generate_Mod/Print_Generate_Statistics.f90 @@ -13,6 +13,8 @@ subroutine Print_Generate_Statistics(Generate, Grid) type(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: i, j, k, numb, nonz, stencw +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Generate) !==============================================================================! print 1, '#================================================' diff --git a/Sources/Generate/Main_Gen.f90 b/Sources/Generate/Main_Gen.f90 index ee10766e7..8ef442521 100644 --- a/Sources/Generate/Main_Gen.f90 +++ b/Sources/Generate/Main_Gen.f90 @@ -15,11 +15,11 @@ program Generate_Prog include '../Shared/Probe_2d.h90' end interface !-----------------------------------[Locals]-----------------------------------! - type(Domain_Type) :: dom ! domain to be used + type(Domain_Type) :: Dom ! domain to be used type(Grid_Type) :: Grid ! Grid which will be generated type(Smooths_Type) :: smooths ! smoothing regions type(Refines_Type) :: refines ! refinement regions and levels - integer :: c ! cell counter + integer :: c, s ! cell counter !==============================================================================! ! Initialize program profler @@ -31,15 +31,15 @@ program Generate_Prog !-------------------------! ! Read the input file ! !-------------------------! - call Generate % Load_Dom(dom, smooths, refines, Grid) + call Generate % Load_Dom(Dom, smooths, refines, Grid) !-----------------------! ! Handle the domain ! !-----------------------! - call Domain_Mod_Calculate_Node_Coordinates(dom, Grid) - call Domain_Mod_Distribute_Regions (dom, Grid) - call Domain_Mod_Connect_Blocks (dom, Grid) - call Domain_Mod_Connect_Periodicity (dom, Grid) + call Dom % Calculate_Node_Coordinates(Grid) + call Dom % Distribute_Ranges (Grid) + call Dom % Connect_Blocks (Grid) + call Dom % Connect_Periodicity (Grid) !--------------------------------! ! From this point on, domain ! @@ -52,10 +52,10 @@ program Generate_Prog call Refines_Mod_Connectivity (refines, Grid, .true.) ! real run call Generate % Calculate_Geometry(Grid, .true.) - call Grid % Sort_Cells_Smart () - call Grid % Sort_Faces_Smart () - call Grid % Calculate_Wall_Distance() - call Grid % Find_Cells_Faces () + call Grid % Sort_Cells_By_Coordinates() + call Grid % Sort_Faces_By_Region () + call Grid % Calculate_Wall_Distance () + call Grid % Find_Cells_Faces () ! Prepare for saving call Grid % Initialize_New_Numbers() @@ -71,9 +71,11 @@ program Generate_Prog ! and they are pointing to each other. Besides, both real face and its ! shadow have the same c1 and c2, both inside cells with positive indices ! Real faces which do not have shadows have "0" for shadow. - ! Checked like this: do s = 1, Grid % n_faces + Grid % n_shadows - ! Checked like this: write(20, '(99i9)') s, Grid % faces_s(s) - ! Checked like this: end do + do s = 1, Grid % n_faces + Grid % n_shadows + if(Grid % faces_s(s) .ne. 0) then + Assert(Grid % faces_s(Grid % faces_s(s)) .eq. s) + end if + end do ! Similar note is in Convert, also called Note #1 !------------------------------! diff --git a/Sources/Generate/Region_Mod.f90 b/Sources/Generate/Range_Mod.f90 similarity index 81% rename from Sources/Generate/Region_Mod.f90 rename to Sources/Generate/Range_Mod.f90 index 6f3b1ebe6..5ae7219a5 100644 --- a/Sources/Generate/Region_Mod.f90 +++ b/Sources/Generate/Range_Mod.f90 @@ -1,5 +1,5 @@ !==============================================================================! - module Region_Mod + module Range_Mod !------------------------------------------------------------------------------! ! This is used to read boundary conditions or materials in "Generator" ! !------------------------------------------------------------------------------! @@ -9,17 +9,17 @@ module Region_Mod implicit none !==============================================================================! - !-----------------! - ! Region type ! - !-----------------! - type Region_Type + !----------------! + ! Range type ! + !----------------! + type Range_Type integer :: block ! to which block it belons ! Enclosing logical cooridnates integer :: is, ie ! start and end in "i" direction - integer :: js, je ! start and end in "i" direction - integer :: ks, ke ! start and end in "i" direction + integer :: js, je ! start and end in "j" direction + integer :: ks, ke ! start and end in "k" direction ! On which face is it ("IMIN", "IMAC", "JMIN", ... character(SL) :: face diff --git a/Sources/Generate/Refines_Mod.f90 b/Sources/Generate/Refines_Mod.f90 index 6ab005203..5a8e0e5d1 100644 --- a/Sources/Generate/Refines_Mod.f90 +++ b/Sources/Generate/Refines_Mod.f90 @@ -36,8 +36,8 @@ module Refines_Mod integer, allocatable :: cell_level(:) ! cells' refinement level logical, allocatable :: cell_marked(:) ! true if cell markered - integer, allocatable :: n_regions(:) ! number refin. regions - type(Shape_Type), allocatable :: region(:,:) ! over levels & regions + integer, allocatable :: n_ranges(:) ! number refin. regions + type(Shape_Type), allocatable :: range(:,:) ! over levels & regions end type diff --git a/Sources/Generate/Refines_Mod/Allocate_Levels.f90 b/Sources/Generate/Refines_Mod/Allocate_Levels.f90 index 29da4e91f..b14539be9 100644 --- a/Sources/Generate/Refines_Mod/Allocate_Levels.f90 +++ b/Sources/Generate/Refines_Mod/Allocate_Levels.f90 @@ -9,7 +9,7 @@ subroutine Refines_Mod_Allocate_Levels(ref, nl) ref % n_levels = nl - allocate(ref % n_regions(nl)) - allocate(ref % region(nl, MAX_SHAPES)) + allocate(ref % n_ranges(nl)) + allocate(ref % range(nl, MAX_SHAPES)) end subroutine diff --git a/Sources/Generate/Refines_Mod/Connectivity.f90 b/Sources/Generate/Refines_Mod/Connectivity.f90 index 3cc6b1e59..eab3bdeba 100644 --- a/Sources/Generate/Refines_Mod/Connectivity.f90 +++ b/Sources/Generate/Refines_Mod/Connectivity.f90 @@ -35,8 +35,8 @@ subroutine Refines_Mod_Connectivity(ref, Grid, real_run) if(Grid % cells_c(m,c) < 0) then Grid % n_bnd_cells = Grid % n_bnd_cells + 1 - ! Remember the boundary color, take positive value for color - Grid % bnd_cond % color(-Grid % n_bnd_cells) = -Grid % cells_c(m,c) + ! Remember the boundary region, take positive value for region + Grid % region % at_cell(-Grid % n_bnd_cells) = -Grid % cells_c(m,c) ! Put new boundary cell into place Grid % cells_c(m,c) = -Grid % n_bnd_cells @@ -111,10 +111,10 @@ subroutine Refines_Mod_Connectivity(ref, Grid, real_run) do c = 1, Grid % n_cells do m = 1, 24 ! neighbour cells if(Grid % cells_c(m,c) < 0) then - Grid % n_bnd_cells = Grid % n_bnd_cells + 1 + Grid % n_bnd_cells = Grid % n_bnd_cells + 1 - ! Restore the boundary color, take positive value for color - Grid % cells_c(m,c) = -Grid % bnd_cond % color(-Grid % n_bnd_cells) + ! Restore the boundary region, take positive value for region + Grid % cells_c(m,c) = -Grid % region % at_cell(-Grid % n_bnd_cells) end if end do end do diff --git a/Sources/Generate/Refines_Mod/Mark_Cells.f90 b/Sources/Generate/Refines_Mod/Mark_Cells.f90 index 432f6d019..d5a44153b 100644 --- a/Sources/Generate/Refines_Mod/Mark_Cells.f90 +++ b/Sources/Generate/Refines_Mod/Mark_Cells.f90 @@ -17,14 +17,14 @@ subroutine Refines_Mod_Mark_Cells(ref, Grid) do lev = 1, ref % n_levels - do reg = 1, ref % n_regions(lev) + do reg = 1, ref % n_ranges(lev) - x1 = ref % region(lev,reg) % pnt(1) % x - y1 = ref % region(lev,reg) % pnt(1) % y - z1 = ref % region(lev,reg) % pnt(1) % z - x8 = ref % region(lev,reg) % pnt(2) % x - y8 = ref % region(lev,reg) % pnt(2) % y - z8 = ref % region(lev,reg) % pnt(2) % z + x1 = ref % range(lev,reg) % pnt(1) % x + y1 = ref % range(lev,reg) % pnt(1) % y + z1 = ref % range(lev,reg) % pnt(1) % z + x8 = ref % range(lev,reg) % pnt(2) % x + y8 = ref % range(lev,reg) % pnt(2) % y + z8 = ref % range(lev,reg) % pnt(2) % z do c = 1, Grid % n_cells n1 = Grid % cells_n(1,c) @@ -49,23 +49,23 @@ subroutine Refines_Mod_Mark_Cells(ref, Grid) Grid % zn(n5) + Grid % zn(n6) + & Grid % zn(n7) + Grid % zn(n8)) - if(ref % region(lev,reg) % shape .eq. ELIPSOID) then + if(ref % range(lev,reg) % shape .eq. ELIPSOID) then if( ( ((x1-x0)/x8)**2 + & ((y1-y0)/y8)**2 + & ((z1-z0)/z8)**2) < 1.0 ) then ref % cell_marked(c) = .true. end if - else if(ref % region(lev,reg) % shape .eq. RECTANGLE) then + else if(ref % range(lev,reg) % shape .eq. RECTANGLE) then if( (x1 < x0) .and. (x0 < x8) .and. & (y1 < y0) .and. (y0 < y8) .and. & (z1 < z0) .and. (z0 < z8) ) then ref % cell_marked(c) = .true. end if - else if(ref % region(lev,reg) % shape .eq. PLANE) then + else if(ref % range(lev,reg) % shape .eq. PLANE) then if( (x0-x1)*x8+(y0-y1)*y8+(z0-z1)*z8 > 0.0 ) then ref % cell_marked(c) = .true. end if - end if + end if end do ! cells end do ! reg diff --git a/Sources/Generate/Smooths_Mod.f90 b/Sources/Generate/Smooths_Mod.f90 index c2961ebec..90f9b03d7 100644 --- a/Sources/Generate/Smooths_Mod.f90 +++ b/Sources/Generate/Smooths_Mod.f90 @@ -14,7 +14,7 @@ module Smooths_Mod !-----------------! type Smooths_Type - integer :: n_smooths ! number of smoothing regions + integer :: n_smooths ! number of smoothing regions integer, allocatable :: iters(:) logical, allocatable :: in_x (:), in_y (:), in_z (:) diff --git a/Sources/Generate/makefile b/Sources/Generate/makefile index 7e2501a1d..754355aed 100644 --- a/Sources/Generate/makefile +++ b/Sources/Generate/makefile @@ -8,11 +8,12 @@ # Default options for compilation #------------------------------------- FORTRAN ?= gnu -DEBUG ?= no ASSERT ?= yes +DEBUG ?= no +PROF ?= no REAL ?= double MPI ?= no -OPENMP ?= yes +OMP ?= yes # Directories for objects and modules. (No need to change.) DIR_BINARY = ../../Binaries @@ -29,22 +30,34 @@ PROGRAM_FILE = $(DIR_BINARY)/$(PROGRAM_NAME) # Initialize variables to pass on to preprocessor with # variable T_FLOWS_COMPILATION which, if set to one, # means unit is compiled from T-Flow -# It later adds T_FLOWS_MPI and T_FLOWS_PETSC #---------------------------------------------------------- PASS_ON = -DT_FLOWS_COMPILATION=1 + +#---------------------------------------------------------- +# Add T_FLOWS_PROGRAM, T_FLOWS_ASSERT and T_FLOWS_DEBUG +# and later on it add also T_FLOWS_MPI and T_FLOWS_PETSC +#---------------------------------------------------------- +PASS_ON += -DT_FLOWS_PROGRAM=1 + ifeq ($(ASSERT), yes) PASS_ON += -DT_FLOWS_ASSERT=1 else PASS_ON += -DT_FLOWS_ASSERT=0 endif +ifeq ($(DEBUG), yes) + PASS_ON += -DT_FLOWS_DEBUG=1 +else + PASS_ON += -DT_FLOWS_DEBUG=0 +endif + $(info #=======================================================================) -$(info # Compiling $(PROGRAM_NAME) with compiler $(FORTRAN) ) +$(info # Compiling $(PROGRAM_NAME) with $(FORTRAN) compiler ) $(info #-----------------------------------------------------------------------) $(info # Usage: ) $(info # make ) $(info # ) -$(info # ) +$(info # ) $(info # ) $(info # Note: The first item, for each of the options above, is the default. ) $(info # ) @@ -53,7 +66,7 @@ $(info # make - compile with gnu compiler ) $(info # make FORTAN=intel - compile with intel compiler ) $(info # make DEBUG=yes - compile with gnu compiler in debug mode ) $(info # make ASSERT=no - compile without assert with gnu compiler ) -$(info # make OPENMP=yes - compile with gnu compiler for parallel Generate ) +$(info # make OMP=yes - compile with gnu compiler for parallel Generate ) $(info #-----------------------------------------------------------------------) #------------------- @@ -65,11 +78,17 @@ ifeq ($(REAL), single) endif #------------------------------------------------------------------------- +# # Compiler and linker options +# #------------------------------------------------------------------------- # Note: Changes only when support to a new Fortran compiler is added. #------------------------------------------------------------------------- +#----------- +# Intel +#----------- + # Fortran == intel ifeq ($(FORTRAN), intel) ifeq ($(FCOMP),) @@ -77,18 +96,30 @@ ifeq ($(FORTRAN), intel) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g -traceback -cpp + OPT_F_COMP += -O0 -g -traceback else - OPT_F_COMP = -module $(DIR_MODULE) -O3 -cpp + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -g -O2 -shared-intel -debug inline-debug-info \ + -D TBB_USE_THREADING_TOOLS endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -qopenmp + ifeq ($(PROF), yes) + OPT_F_COMP += -qopenmp-link dynamic -parallel-source-info=2 + endif endif +#------------ +# Nvidia +#------------ + # Fortran == nvidia else ifeq ($(FORTRAN), nvidia) ifeq ($(FCOMP),) @@ -96,18 +127,23 @@ else ifeq ($(FORTRAN), nvidia) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp -Mbackslash ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g + OPT_F_COMP += -O0 -g else - OPT_F_COMP = -module $(DIR_MODULE) -O3 + OPT_F_COMP += -O3 endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -mp endif +#--------- +# Gnu +#--------- + # Fortran == gnu else ifeq ($(FCOMP),) @@ -115,24 +151,20 @@ else else FC = $(FCOMP) endif + OPT_F_COMP = -J $(DIR_MODULE) -cpp -ffree-line-length-none ifeq ($(DEBUG), yes) - OPT_F_COMP = -J $(DIR_MODULE) -O0 -g -cpp \ - -ffree-line-length-none -fcheck=all -fwhole-file -fbacktrace \ - -ffpe-trap=invalid,zero,overflow -fimplicit-none \ - -Wall -Wextra -Waliasing -Wampersand -Warray-temporaries \ - -Wc-binding-type -Wcharacter-truncation -Wline-truncation \ - -Wconversion -finit-real=nan -Wintrinsics-std \ - -Wreal-q-constant -Wsurprising -Wtabs -Wunderflow \ - -Wintrinsic-shadow -Wunused-parameter -Walign-commons \ - -Wfunction-elimination -Wrealloc-lhs -Wrealloc-lhs-all \ - -Wtarget-lifetime -Wpedantic -fstack-check + OPT_F_COMP += -O0 -g -fcheck=all -Wunused-parameter -Wall \ + -Wno-integer-division else - OPT_F_COMP = -J $(DIR_MODULE) -O3 -cpp -ffree-line-length-none + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -pg -g endif ifeq ($(REAL), double) OPT_F_COMP += -fdefault-real-8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -fopenmp endif endif @@ -158,8 +190,6 @@ endif #------------------------------------------------------ # Modules' order must obey their dependency # This list should therefore be written "by hand". -# Note: Modules written in lower case -# letters are candidates for deletion. #------------------------------------------------------ #------------- @@ -168,18 +198,20 @@ endif # Modules in shared directories SRC_F_MOD = Const_Mod.f90 \ + Region_Mod.f90 \ String_Mod.f90 \ - Tokenizer_Mod.f90 \ Comm_Mod.f90 \ Assert_Mod.f90 \ + Tokenizer_Mod.f90 \ Message_Mod.f90 \ + Vect_Mod.f90 \ + Control_Mod.f90 \ Profiler_Mod.f90 \ Math_Mod.f90 \ File_Mod.f90 \ Gen_Mod.f90 \ Vtk_Mod.f90 \ Metis_Mod.f90 \ - Boundary_Mod.f90 \ Swap_Mod.f90 \ Sort_Mod.f90 \ Grid_Mod.f90 @@ -188,7 +220,7 @@ SRC_F_MOD = Const_Mod.f90 \ SRC_F_MOD += Point_Mod.f90 \ Line_Mod.f90 \ Block_Mod.f90 \ - Region_Mod.f90 \ + Range_Mod.f90 \ Smooths_Mod.f90 \ Refines_Mod.f90 \ Domain_Mod.f90 \ @@ -216,26 +248,13 @@ OBJ_F_MOD = $(SRC_F_MOD:%.f90=$(DIR_OBJECT)/%.o) OBJ_F_FUN = $(SRC_F_FUN:%.f90=$(DIR_OBJECT)/%.o) OBJ = $(OBJ_F_MOD) $(OBJ_F_FUN) -#------------------------------------------------------- -# List of modules currently used for target "clean" -#------------------------------------------------------- -# Note: This doesn't need editing. -#------------------------------------------------------- -SRC_F_MOD_LOW = $(shell echo $(SRC_F_MOD) | tr A-Z a-z) -MOD = $(SRC_F_MOD_LOW:%.f90=$(DIR_MODULE)/%.mod) - #--------------------------------------------------------- # Default rule to build Fortran modules and functions #--------------------------------------------------------- # Note: This doesn't need editing. #--------------------------------------------------------- -# Fortran modules -$(DIR_OBJECT)/%.o: %.f90 %/*.f90 - @echo $(FC) $< - @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< - -# Fortran functions +# Fortran sources $(DIR_OBJECT)/%.o: %.f90 @echo $(FC) $< @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< diff --git a/Sources/Generate/makefile_explicit_dependencies b/Sources/Generate/makefile_explicit_dependencies index f1d01ff61..c7576b2db 100644 --- a/Sources/Generate/makefile_explicit_dependencies +++ b/Sources/Generate/makefile_explicit_dependencies @@ -1,19 +1,8 @@ -#--------------------------------------------------- -# Dependencies for: ./Region_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Region_Mod.o:\ -$(DIR_OBJECT)/Const_Mod.o - -#--------------------------------------------------- -# Dependencies for: ./Refines_Mod/Connectivity.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Connectivity.o: - #--------------------------------------------------- # Dependencies for: ./Domain_Mod.f90 #--------------------------------------------------- $(DIR_OBJECT)/Domain_Mod.o:\ -$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Range_Mod.o \ $(DIR_OBJECT)/Point_Mod.o \ $(DIR_OBJECT)/Line_Mod.o \ $(DIR_OBJECT)/Grid_Mod.o \ @@ -24,15 +13,6 @@ $(DIR_SHARED)/Gen_Mod/*.f90 \ Domain_Mod/*.f90 \ $(DIR_OBJECT)/Block_Mod.o -#--------------------------------------------------- -# Dependencies for: ./Smooths_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Smooths_Mod.o:\ -Smooths_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 - #--------------------------------------------------- # Dependencies for: ./Refines_Mod.f90 #--------------------------------------------------- @@ -45,22 +25,6 @@ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/Gen_Mod.o \ $(DIR_SHARED)/Gen_Mod/*.f90 -#--------------------------------------------------- -# Dependencies for: ./Main_Gen.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Main_Gen.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/Generate_Mod.o \ -Generate_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 - #--------------------------------------------------- # Dependencies for: ./Generate_Mod.f90 #--------------------------------------------------- @@ -99,19 +63,15 @@ $(DIR_OBJECT)/Gen_Mod.o \ $(DIR_SHARED)/Gen_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Sort_Mod.f90 +# Dependencies for: ./Range_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Sort_Mod.o:\ -$(DIR_OBJECT)/Swap_Mod.o \ -$(DIR_SHARED)/Swap_Mod/*.f90 \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 +$(DIR_OBJECT)/Range_Mod.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Probe_1d_Nodes.f90 +# Dependencies for: ./Main_Gen.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Nodes.o:\ +$(DIR_OBJECT)/Main_Gen.o:\ $(DIR_OBJECT)/Sort_Mod.o \ $(DIR_SHARED)/Sort_Mod/*.f90 \ $(DIR_OBJECT)/Math_Mod.o \ @@ -119,24 +79,46 @@ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/Generate_Mod.o \ +Generate_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Grid_Mod.f90 +# Dependencies for: ./Refines_Mod/Connectivity.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Grid_Mod.o:\ -$(DIR_OBJECT)/Vtk_Mod.o \ -$(DIR_SHARED)/Vtk_Mod/*.f90 \ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Connectivity.o: + +#--------------------------------------------------- +# Dependencies for: ./Smooths_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Smooths_Mod.o:\ +Smooths_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Boundary_Mod.o +$(DIR_SHARED)/Grid_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Message_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Message_Mod.o:\ +$(DIR_OBJECT)/Tokenizer_Mod.o \ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Isoap_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Isoap_Mod.o:\ +$(DIR_OBJECT)/Polyhedron_Mod.o \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 \ +$(DIR_OBJECT)/Iso_Polygons_Mod.o \ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 \ +$(DIR_SHARED)/Isoap_Mod/readme \ +$(DIR_SHARED)/Isoap_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./File_Mod.f90 @@ -149,103 +131,149 @@ $(DIR_SHARED)/Message_Mod/*.f90 \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Control_Mod.f90 +# Dependencies for: ./Region_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Control_Mod.o:\ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_SHARED)/Control_Mod/*.f90 \ -$(DIR_SHARED)/Control_Mod/*/*.f90 +$(DIR_OBJECT)/Region_Mod.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Profiler_Mod.f90 +# Dependencies for: ./Gen_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Profiler_Mod.o:\ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 +$(DIR_OBJECT)/Gen_Mod.o:\ +$(DIR_SHARED)/Gen_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Swap_Mod.f90 +# Dependencies for: ./Sort_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Swap_Mod.o:\ -$(DIR_SHARED)/Swap_Mod/*.f90 +$(DIR_OBJECT)/Sort_Mod.o:\ +$(DIR_OBJECT)/Swap_Mod.o \ +$(DIR_SHARED)/Swap_Mod/*.f90 \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./String_Mod.f90 +# Dependencies for: ./Polyhedron_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/String_Mod.o:\ -$(DIR_SHARED)/String_Mod/*.f90 +$(DIR_OBJECT)/Polyhedron_Mod.o:\ +$(DIR_OBJECT)/Work_Mod.o \ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_2d.f90 +# Dependencies for: ./Control_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_2d.o:\ +$(DIR_OBJECT)/Control_Mod.o:\ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Probe_1d_Cells.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Probe_1d_Cells.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 +$(DIR_SHARED)/File_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Vtk_Mod.f90 +# Dependencies for: ./Message_Mod/Dashed_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Vtk_Mod.o:\ -$(DIR_SHARED)/Vtk_Mod/*.f90 \ +$(DIR_OBJECT)/Dashed_Line.o:\ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Comm_Mod.f90 +# Dependencies for: ./Message_Mod/Thin_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Comm_Mod.o:\ -$(DIR_OBJECT)/Const_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 +$(DIR_OBJECT)/Thin_Line.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Tokenizer_Mod.f90 +# Dependencies for: ./Message_Mod/Thick_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Tokenizer_Mod.o:\ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_OBJECT)/Thick_Line.o:\ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- # Dependencies for: ./Work_Mod.f90 #--------------------------------------------------- $(DIR_OBJECT)/Work_Mod.o:\ -$(DIR_SHARED)/Work_Mod/*.f90 \ $(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Dashed_Line.f90 +# Dependencies for: ./Probe_1d_Nodes.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Dashed_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Probe_1d_Nodes.o:\ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thin_Line.f90 +# Dependencies for: ./Vect_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thin_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Vect_Mod.o:\ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thick_Line.f90 +# Dependencies for: ./Profiler_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thick_Line.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Profiler_Mod.o:\ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Control_Mod.o \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 \ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Boundary_Mod.f90 +# Dependencies for: ./Math_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Boundary_Mod.o:\ +$(DIR_OBJECT)/Math_Mod.o:\ +$(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o +#--------------------------------------------------- +# Dependencies for: ./Swap_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Swap_Mod.o:\ +$(DIR_SHARED)/Swap_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Assert_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Assert_Mod.o:\ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./String_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/String_Mod.o:\ +$(DIR_SHARED)/String_Mod/*.f90 + #--------------------------------------------------- # Dependencies for: ./Probe_1d_Cells_Nodes.f90 #--------------------------------------------------- @@ -261,29 +289,52 @@ $(DIR_OBJECT)/File_Mod.o \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Assert_Mod.f90 +# Dependencies for: ./Grid_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Assert_Mod.o:\ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_OBJECT)/Grid_Mod.o:\ +$(DIR_OBJECT)/Vtk_Mod.o \ +$(DIR_SHARED)/Vtk_Mod/*.f90 \ +$(DIR_OBJECT)/Vect_Mod.o \ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Metis_Mod.o \ +$(DIR_SHARED)/Metis_Mod/*.f90 \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Message_Mod.f90 +# Dependencies for: ./Stl_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Message_Mod.o:\ -$(DIR_OBJECT)/Tokenizer_Mod.o \ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ -$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_OBJECT)/Stl_Mod.o:\ +$(DIR_SHARED)/Stl_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Comm_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Comm_Mod.o:\ $(DIR_OBJECT)/Const_Mod.o \ -$(DIR_OBJECT)/Assert_Mod.o \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_SHARED)/Comm_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Math_Mod.f90 +# Dependencies for: ./Iso_Polygons_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Math_Mod.o:\ -$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Iso_Polygons_Mod.o:\ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Vtk_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Vtk_Mod.o:\ +$(DIR_SHARED)/Vtk_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- @@ -295,21 +346,22 @@ $(DIR_OBJECT)/Assert_Mod.o \ $(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Gen_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Gen_Mod.o:\ -$(DIR_SHARED)/Gen_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Probe_1d_Cells.f90 +# Dependencies for: ./Probe_2d.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Cells.o:\ +$(DIR_OBJECT)/Probe_2d.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_SHARED)/File_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Tokenizer_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Tokenizer_Mod.o:\ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 diff --git a/Sources/Process/Backup_Mod.f90 b/Sources/Process/Backup_Mod.f90 index f0601be79..25c8c2372 100644 --- a/Sources/Process/Backup_Mod.f90 +++ b/Sources/Process/Backup_Mod.f90 @@ -1,3 +1,7 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Backup_Mod !------------------------------------------------------------------------------! @@ -14,37 +18,65 @@ module Backup_Mod !-----------------! type Backup_Type integer :: interval + + contains + procedure :: Load + procedure :: Load_Cell_Real + procedure :: Load_Int + procedure :: Load_Int_Array + procedure :: Load_Log + procedure :: Load_Log_Array + procedure :: Load_Real + procedure :: Load_Real_Array + procedure :: Load_Swarm + procedure :: Load_Variable + procedure :: Save + procedure :: Save_Cell_Real + procedure :: Save_Int + procedure :: Save_Int_Array + procedure :: Save_Log + procedure :: Save_Log_Array + procedure :: Save_Real + procedure :: Save_Real_Array + procedure :: Save_Swarm + procedure :: Save_Variable + procedure :: Time_To_Save_Backup + end type - type(Backup_Type) :: backup + + !----------------------! + ! Singleton object ! + !----------------------! + type(Backup_Type) :: Backup # if T_FLOWS_MPI == 1 - type(Mpi_File) :: fh -#else - integer :: fh -#endif + type(Mpi_File) :: fh +# else + integer :: fh +# endif contains # include "Backup_Mod/Load.f90" -# include "Backup_Mod/Read_Cell_Real.f90" -# include "Backup_Mod/Read_Int.f90" -# include "Backup_Mod/Read_Int_Array.f90" -# include "Backup_Mod/Read_Log.f90" -# include "Backup_Mod/Read_Log_Array.f90" -# include "Backup_Mod/Read_Real.f90" -# include "Backup_Mod/Read_Real_Array.f90" -# include "Backup_Mod/Read_Swarm.f90" -# include "Backup_Mod/Read_Variable.f90" +# include "Backup_Mod/Load_Cell_Real.f90" +# include "Backup_Mod/Load_Int.f90" +# include "Backup_Mod/Load_Int_Array.f90" +# include "Backup_Mod/Load_Log.f90" +# include "Backup_Mod/Load_Log_Array.f90" +# include "Backup_Mod/Load_Real.f90" +# include "Backup_Mod/Load_Real_Array.f90" +# include "Backup_Mod/Load_Swarm.f90" +# include "Backup_Mod/Load_Variable.f90" # include "Backup_Mod/Save.f90" -# include "Backup_Mod/Time_To_Save.f90" -# include "Backup_Mod/Write_Cell_Real.f90" -# include "Backup_Mod/Write_Int.f90" -# include "Backup_Mod/Write_Int_Array.f90" -# include "Backup_Mod/Write_Log.f90" -# include "Backup_Mod/Write_Log_Array.f90" -# include "Backup_Mod/Write_Real.f90" -# include "Backup_Mod/Write_Real_Array.f90" -# include "Backup_Mod/Write_Swarm.f90" -# include "Backup_Mod/Write_Variable.f90" +# include "Backup_Mod/Save_Cell_Real.f90" +# include "Backup_Mod/Save_Int.f90" +# include "Backup_Mod/Save_Int_Array.f90" +# include "Backup_Mod/Save_Log.f90" +# include "Backup_Mod/Save_Log_Array.f90" +# include "Backup_Mod/Save_Real.f90" +# include "Backup_Mod/Save_Real_Array.f90" +# include "Backup_Mod/Save_Swarm.f90" +# include "Backup_Mod/Save_Variable.f90" +# include "Backup_Mod/Time_To_Save_Backup.f90" end module diff --git a/Sources/Process/Backup_Mod/Load.f90 b/Sources/Process/Backup_Mod/Load.f90 index a8a93c2e2..ae9566e13 100644 --- a/Sources/Process/Backup_Mod/Load.f90 +++ b/Sources/Process/Backup_Mod/Load.f90 @@ -1,41 +1,41 @@ !==============================================================================! - subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) + subroutine Load(Backup, Flow, Turb, Vof, Swarm, bckp) !------------------------------------------------------------------------------! ! Loads backup files name.backup ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Fld - type(Turb_Type), target :: Tur + class(Backup_Type) :: Backup + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swr - real :: time ! time of simulation - integer :: time_step ! current time step - logical :: backup, present + type(Swarm_Type), target :: Swarm + logical :: bckp, present !-----------------------------------[Locals]-----------------------------------! type(Comm_Type), pointer :: Comm type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk type(Var_Type), pointer :: phi - character(SL) :: name_in, answer, name_mean, a_name - integer :: vc, sc, ua + character(SL) :: name_in, answer, name_mean + integer :: vc, sc, ts integer(DP) :: d + real :: st ! saved time, simulation time !==============================================================================! ! Take aliases - Grid => Fld % pnt_grid - bulk => Fld % bulk + Grid => Flow % pnt_grid + bulk => Flow % bulk Comm => Grid % Comm ! Full name is specified in control file - call Control_Mod_Load_Backup_Name(name_in) + call Control % Load_Backup_Name(name_in) answer = name_in call String % To_Upper_Case(answer) - backup = .true. + bckp = .true. if(answer .eq. 'SKIP') then - backup = .false. + bckp = .false. return end if @@ -44,12 +44,9 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) inquire(file=trim(name_in), exist=present ) if(.not.present) then - if(this_proc < 2) then - print *, "# ERROR! Backup file ", trim(name_in), " was not found." - print *, "# Exiting!" - end if - call Comm_Mod_End - stop + call Message % Error(80, & + 'Backup file '//trim(name_in)//' was not found. Exiting!', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if ! Open backup file @@ -65,10 +62,10 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) !---------------------------------------------! ! Variable count - important for checking ! !---------------------------------------------! - call Backup_Mod_Read_Int(Comm, d, 2048, 'variable_count', vc) + call Backup % Load_Int(Comm, d, 2048, 'variable_count', vc) if(vc .eq. 0) vc = 2048 ! for backward compatibility - if(this_proc < 2) then + if(First_Proc()) then print *, "# Backup file holds ", vc, " variables." end if @@ -78,29 +75,30 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) ! ! !---------------! - !-----------------------------------------------! - ! Skip three coordinates for the time being ! - !-----------------------------------------------! - ! call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'x_coords', Grid % xc) - ! call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'y_coords', Grid % yc) - ! call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'z_coords', Grid % zc) + !---------------------------------! + ! Related to time integration ! + !---------------------------------! ! Time step - call Backup_Mod_Read_Int(Comm, d, vc, 'time_step', time_step) + call Backup % Load_Int(Comm, d, vc, 'time_step', ts) + call Time % Set_First_Dt(ts) ! Simulation time - call Backup_Mod_Read_Real(Comm, d, vc, 'time', time) - - ! Bulk flows and pressure drops in each direction - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_flux_x', bulk % flux_x) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_flux_y', bulk % flux_y) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_flux_z', bulk % flux_z) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_flux_x_o', bulk % flux_x_o) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_flux_y_o', bulk % flux_y_o) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_flux_z_o', bulk % flux_z_o) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_p_drop_x', bulk % p_drop_x) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_p_drop_y', bulk % p_drop_y) - call Backup_Mod_Read_Real(Comm, d, vc, 'bulk_p_drop_z', bulk % p_drop_z) + call Backup % Load_Real(Comm, d, vc, 'time', st) + call Time % Set_Time(st) + + !-----------------------------------------------------! + ! Bulk flows and pressure drops in each direction ! + !-----------------------------------------------------! + call Backup % Load_Real(Comm, d, vc, 'bulk_flux_x', bulk % flux_x) + call Backup % Load_Real(Comm, d, vc, 'bulk_flux_y', bulk % flux_y) + call Backup % Load_Real(Comm, d, vc, 'bulk_flux_z', bulk % flux_z) + call Backup % Load_Real(Comm, d, vc, 'bulk_flux_x_o', bulk % flux_x_o) + call Backup % Load_Real(Comm, d, vc, 'bulk_flux_y_o', bulk % flux_y_o) + call Backup % Load_Real(Comm, d, vc, 'bulk_flux_z_o', bulk % flux_z_o) + call Backup % Load_Real(Comm, d, vc, 'bulk_p_drop_x', bulk % p_drop_x) + call Backup % Load_Real(Comm, d, vc, 'bulk_p_drop_y', bulk % p_drop_y) + call Backup % Load_Real(Comm, d, vc, 'bulk_p_drop_z', bulk % p_drop_z) !----------------------------! ! ! @@ -111,19 +109,19 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) !--------------! ! Velocity ! !--------------! - call Backup_Mod_Read_Variable(d, vc, 'u_velocity', Fld, Fld % u) - call Backup_Mod_Read_Variable(d, vc, 'v_velocity', Fld, Fld % v) - call Backup_Mod_Read_Variable(d, vc, 'w_velocity', Fld, Fld % w) + call Backup % Load_Variable(d, vc, 'u_velocity', Flow, Flow % u) + call Backup % Load_Variable(d, vc, 'v_velocity', Flow, Flow % v) + call Backup % Load_Variable(d, vc, 'w_velocity', Flow, Flow % w) !------------------------------------------------------! ! Pressure, its gradients, and pressure correction ! !------------------------------------------------------! - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'press', Fld % p % n) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'press_x', Fld % p % x) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'press_y', Fld % p % y) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'press_z', Fld % p % z) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'press_corr', Fld % pp % n) - call Fld % Grad_Pressure(Fld % pp) + call Backup % Load_Cell_Real(Grid, d, vc, 'press', Flow % p % n) + call Backup % Load_Cell_Real(Grid, d, vc, 'press_x', Flow % p % x) + call Backup % Load_Cell_Real(Grid, d, vc, 'press_y', Flow % p % y) + call Backup % Load_Cell_Real(Grid, d, vc, 'press_z', Flow % p % z) + call Backup % Load_Cell_Real(Grid, d, vc, 'press_corr', Flow % pp % n) + call Flow % Grad_Pressure(Flow % pp) !-------------------! ! Volume fluxes ! -> don't use for the time being, too much trouble @@ -143,15 +141,15 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) ! ! Update on June 2, 2022: Unified all outlet boundaries into one ! to be able to tell PETSc if matrix for pressure is singular - call Backup_Mod_Read_Log(Comm, d, vc, 'has_pressure', Fld % has_pressure) + call Backup % Load_Log(Comm, d, vc, 'has_pressure', Flow % has_pressure) !--------------! ! ! ! Enthalpy ! ! ! !--------------! - if(Fld % heat_transfer) then - call Backup_Mod_Read_Variable(d, vc, 'temp', Fld, Fld % t) + if(Flow % heat_transfer) then + call Backup % Load_Variable(d, vc, 'temp', Flow, Flow % t) end if !--------------! @@ -159,8 +157,8 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) ! Multiphase ! ! ! !--------------! - if(Fld % with_interface) then - call Backup_Mod_Read_Variable(d, vc, 'vof_fun', Fld, Vof % fun) + if(Flow % with_interface) then + call Backup % Load_Variable(d, vc, 'vof_fun', Flow, Vof % fun) end if !-----------------------! @@ -172,52 +170,52 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) !-----------------! ! K-eps model ! !-----------------! - if(Tur % model .eq. K_EPS) then + if(Turb % model .eq. K_EPS) then ! K and epsilon - call Backup_Mod_Read_Variable(d, vc, 'kin', Fld, Tur % kin) - call Backup_Mod_Read_Variable(d, vc, 'eps', Fld, Tur % eps) + call Backup % Load_Variable(d, vc, 'kin', Flow, Turb % kin) + call Backup % Load_Variable(d, vc, 'eps', Flow, Turb % eps) ! Other turbulent quantities - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'p_kin', Tur % p_kin ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'y_plus', Tur % y_plus) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vis_t', Tur % vis_t ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vis_w', Tur % vis_w ) + call Backup % Load_Cell_Real(Grid, d, vc, 'p_kin', Turb % p_kin ) + call Backup % Load_Cell_Real(Grid, d, vc, 'y_plus', Turb % y_plus) + call Backup % Load_Cell_Real(Grid, d, vc, 'vis_t', Turb % vis_t ) + call Backup % Load_Cell_Real(Grid, d, vc, 'vis_w', Turb % vis_w ) ! Turbulence quantities connected with heat transfer - if(Fld % heat_transfer) then - call Backup_Mod_Read_Variable(d, vc, 't2', Fld, Tur % t2) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'p_t2', Tur % p_t2 ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'con_w', Tur % con_w) + if(Flow % heat_transfer) then + call Backup % Load_Variable(d, vc, 't2', Flow, Turb % t2) + call Backup % Load_Cell_Real(Grid, d, vc, 'p_t2', Turb % p_t2 ) + call Backup % Load_Cell_Real(Grid, d, vc, 'con_w', Turb % con_w) end if end if !------------------------! ! K-eps-zeta-f model ! !------------------------! - if(Tur % model .eq. K_EPS_ZETA_F .or. & - Tur % model .eq. HYBRID_LES_RANS) then + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then ! K, eps, zeta and f22 - call Backup_Mod_Read_Variable(d, vc, 'kin', Fld, Tur % kin) - call Backup_Mod_Read_Variable(d, vc, 'eps', Fld, Tur % eps) - call Backup_Mod_Read_Variable(d, vc, 'zeta', Fld, Tur % zeta) - call Backup_Mod_Read_Variable(d, vc, 'f22', Fld, Tur % f22) + call Backup % Load_Variable(d, vc, 'kin', Flow, Turb % kin) + call Backup % Load_Variable(d, vc, 'eps', Flow, Turb % eps) + call Backup % Load_Variable(d, vc, 'zeta', Flow, Turb % zeta) + call Backup % Load_Variable(d, vc, 'f22', Flow, Turb % f22) ! Other turbulent quantities - call Backup_Mod_Read_Cell_Real(Grid, d, vc,'p_kin', Tur % p_kin ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc,'y_plus', Tur % y_plus ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc,'vis_t', Tur % vis_t ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc,'vis_w', Tur % vis_w ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc,'t_scale', Tur % t_scale) - call Backup_Mod_Read_Cell_Real(Grid, d, vc,'l_scale', Tur % l_scale) + call Backup % Load_Cell_Real(Grid, d, vc,'p_kin', Turb % p_kin ) + call Backup % Load_Cell_Real(Grid, d, vc,'y_plus', Turb % y_plus ) + call Backup % Load_Cell_Real(Grid, d, vc,'vis_t', Turb % vis_t ) + call Backup % Load_Cell_Real(Grid, d, vc,'vis_w', Turb % vis_w ) + call Backup % Load_Cell_Real(Grid, d, vc,'t_scale', Turb % t_scale) + call Backup % Load_Cell_Real(Grid, d, vc,'l_scale', Turb % l_scale) ! Turbulence quantities connected with heat transfer - if(Fld % heat_transfer) then - call Backup_Mod_Read_Variable(d, vc, 't2', Fld, Tur % t2) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'p_t2', Tur % p_t2 ) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'con_w', Tur % con_w) + if(Flow % heat_transfer) then + call Backup % Load_Variable(d, vc, 't2', Flow, Turb % t2) + call Backup % Load_Cell_Real(Grid, d, vc, 'p_t2', Turb % p_t2 ) + call Backup % Load_Cell_Real(Grid, d, vc, 'con_w', Turb % con_w) end if end if @@ -225,48 +223,48 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) !----------------------------! ! Reynolds stress models ! !----------------------------! - if(Tur % model .eq. RSM_MANCEAU_HANJALIC .or. & - Tur % model .eq. RSM_HANJALIC_JAKIRLIC) then + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then ! Reynolds stresses - call Backup_Mod_Read_Variable(d, vc, 'uu', Fld, Tur % uu) - call Backup_Mod_Read_Variable(d, vc, 'vv', Fld, Tur % vv) - call Backup_Mod_Read_Variable(d, vc, 'ww', Fld, Tur % ww) - call Backup_Mod_Read_Variable(d, vc, 'uv', Fld, Tur % uv) - call Backup_Mod_Read_Variable(d, vc, 'uw', Fld, Tur % uw) - call Backup_Mod_Read_Variable(d, vc, 'vw', Fld, Tur % vw) + call Backup % Load_Variable(d, vc, 'uu', Flow, Turb % uu) + call Backup % Load_Variable(d, vc, 'vv', Flow, Turb % vv) + call Backup % Load_Variable(d, vc, 'ww', Flow, Turb % ww) + call Backup % Load_Variable(d, vc, 'uv', Flow, Turb % uv) + call Backup % Load_Variable(d, vc, 'uw', Flow, Turb % uw) + call Backup % Load_Variable(d, vc, 'vw', Flow, Turb % vw) ! Epsilon - call Backup_Mod_Read_Variable(d, vc, 'eps', Fld, Tur % eps) + call Backup % Load_Variable(d, vc, 'eps', Flow, Turb % eps) ! F22 - if(Tur % model .eq. RSM_MANCEAU_HANJALIC) then - call Backup_Mod_Read_Variable(d, vc, 'f22', Fld, Tur % f22) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then + call Backup % Load_Variable(d, vc, 'f22', Flow, Turb % f22) end if ! Other turbulent quantities ? - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vis_t', Tur % vis_t) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vis_w', Tur % vis_w) + call Backup % Load_Cell_Real(Grid, d, vc, 'vis_t', Turb % vis_t) + call Backup % Load_Cell_Real(Grid, d, vc, 'vis_w', Turb % vis_w) ! Turbulence quantities connected with heat transfer - if(Fld % heat_transfer) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'con_w', Tur % con_w) + if(Flow % heat_transfer) then + call Backup % Load_Cell_Real(Grid, d, vc, 'con_w', Turb % con_w) end if end if !--------------! ! Roughness ! !--------------! - if(Tur % rough_walls) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'z_o', Tur % z_o) + if(Turb % rough_walls) then + call Backup % Load_Cell_Real(Grid, d, vc, 'z_o', Turb % z_o) end if !------------------! ! Load scalars ! !------------------! - do sc = 1, Fld % n_scalars - phi => Fld % scalar(sc) - call Backup_Mod_Read_Variable(d, vc, phi % name, Fld, phi) + do sc = 1, Flow % n_scalars + phi => Flow % scalar(sc) + call Backup % Load_Variable(d, vc, phi % name, Flow, phi) end do !-----------------------------------------! @@ -274,96 +272,76 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) ! Turbulent statistics for all models ! ! ! !-----------------------------------------! - if(Tur % statistics) then - - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'u_mean', Tur % u_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'v_mean', Tur % v_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'w_mean', Tur % w_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'p_mean', Tur % p_mean) - if(Fld % heat_transfer) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 't_mean', Tur % t_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'q_mean', Tur % q_mean) + if(Turb % statistics) then + + call Backup % Load_Cell_Real(Grid, d, vc, 'u_mean', Turb % u_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'v_mean', Turb % v_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'w_mean', Turb % w_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'p_mean', Turb % p_mean) + if(Flow % heat_transfer) then + call Backup % Load_Cell_Real(Grid, d, vc, 't_mean', Turb % t_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'q_mean', Turb % q_mean) end if ! K and epsilon - if(Tur % model .eq. K_EPS) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'kin_mean', & - Tur % kin_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'eps_mean', & - Tur % eps_mean) - if(Fld % heat_transfer) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 't2_mean', & - Tur % t2_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'ut_mean', & - Tur % ut_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vt_mean', & - Tur % vt_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'wt_mean', & - Tur % wt_mean) + if(Turb % model .eq. K_EPS) then + call Backup % Load_Cell_Real(Grid, d, vc, 'kin_mean', Turb % kin_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'eps_mean', Turb % eps_mean) + if(Flow % heat_transfer) then + call Backup % Load_Cell_Real(Grid, d, vc, 't2_mean', Turb % t2_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'ut_mean', Turb % ut_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'vt_mean', Turb % vt_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'wt_mean', Turb % wt_mean) end if end if ! K-eps-zeta-f and the hybrid model - if(Tur % model .eq. K_EPS_ZETA_F .or. & - Tur % model .eq. HYBRID_LES_RANS) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'kin_mean', & - Tur % kin_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'eps_mean', & - Tur % eps_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'zeta_mean', & - Tur % zeta_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'f22_mean', & - Tur % f22_mean) - if(Fld % heat_transfer) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 't2_mean', & - Tur % t2_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'ut_mean', & - Tur % ut_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vt_mean', & - Tur % vt_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'wt_mean', & - Tur % wt_mean) + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then + call Backup % Load_Cell_Real(Grid, d, vc, 'kin_mean', Turb % kin_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'eps_mean', Turb % eps_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'zeta_mean', Turb % zeta_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'f22_mean', Turb % f22_mean) + if(Flow % heat_transfer) then + call Backup % Load_Cell_Real(Grid, d, vc, 't2_mean', Turb % t2_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'ut_mean', Turb % ut_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'vt_mean', Turb % vt_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'wt_mean', Turb % wt_mean) end if end if ! Reynolds stress models - if(Tur % model .eq. RSM_MANCEAU_HANJALIC .or. & - Tur % model .eq. RSM_HANJALIC_JAKIRLIC) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'uu_mean', & - Tur % uu_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vv_mean', & - Tur % vv_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'ww_mean', & - Tur % ww_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'uv_mean', & - Tur % uv_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'uw_mean', & - Tur % uw_mean) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vw_mean', & - Tur % vw_mean) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + call Backup % Load_Cell_Real(Grid, d, vc, 'uu_mean', Turb % uu_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'vv_mean', Turb % vv_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'ww_mean', Turb % ww_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'uv_mean', Turb % uv_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'uw_mean', Turb % uw_mean) + call Backup % Load_Cell_Real(Grid, d, vc, 'vw_mean', Turb % vw_mean) end if - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'uu_res', Tur % uu_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vv_res', Tur % vv_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'ww_res', Tur % ww_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'uv_res', Tur % uv_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'uw_res', Tur % uw_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vw_res', Tur % vw_res) - - if(Fld % heat_transfer) then - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 't2_res', Tur % t2_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'ut_res', Tur % ut_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'vt_res', Tur % vt_res) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'wt_res', Tur % wt_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'uu_res', Turb % uu_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'vv_res', Turb % vv_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'ww_res', Turb % ww_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'uv_res', Turb % uv_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'uw_res', Turb % uw_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'vw_res', Turb % vw_res) + + if(Flow % heat_transfer) then + call Backup % Load_Cell_Real(Grid, d, vc, 't2_res', Turb % t2_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'ut_res', Turb % ut_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'vt_res', Turb % vt_res) + call Backup % Load_Cell_Real(Grid, d, vc, 'wt_res', Turb % wt_res) end if ! Scalars - do sc = 1, Fld % n_scalars - phi => Fld % scalar(sc) + do sc = 1, Flow % n_scalars + phi => Flow % scalar(sc) name_mean = phi % name name_mean(5:9) = '_mean' - call Backup_Mod_Read_Cell_Real(Grid, d, vc, name_mean, & - Tur % scalar_mean(sc, :)) + call Backup % Load_Cell_Real(Grid, d, vc, name_mean, & + Turb % scalar_mean(sc, :)) end do end if @@ -373,27 +351,12 @@ subroutine Backup_Mod_Load(Fld, Tur, Vof, Swr, time, time_step, backup) ! Swarm (of particles) ! ! ! !--------------------------! - if(Fld % with_particles) then - call Backup_Mod_Read_Swarm(d, vc, Swr) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'n_deposited', & - Swr % n_deposited) - call Backup_Mod_Read_Cell_Real(Grid, d, vc, 'n_reflected', & - Swr % n_reflected) + if(Flow % with_particles) then + call Backup % Load_Swarm(Swarm, d, vc) + call Backup % Load_Cell_Real(Grid, d,vc,'n_deposited', Swarm % n_deposited) + call Backup % Load_Cell_Real(Grid, d,vc,'n_reflected', Swarm % n_reflected) end if - !-----------------! - ! ! - ! User arrays ! - ! ! - !-----------------! - - do ua = 1, Grid % n_user_arrays - a_name = 'A_00' - write(a_name(3:4),'(I2.2)') ua - call Backup_Mod_Read_Cell_Real(Grid, d, vc, a_name, & - Grid % user_array(ua, :)) - end do - ! Close backup file call Comm % Close_File(fh) diff --git a/Sources/Process/Backup_Mod/Read_Cell_Real.f90 b/Sources/Process/Backup_Mod/Load_Cell_Real.f90 similarity index 85% rename from Sources/Process/Backup_Mod/Read_Cell_Real.f90 rename to Sources/Process/Backup_Mod/Load_Cell_Real.f90 index 4acb21a63..77ba0c0a4 100644 --- a/Sources/Process/Backup_Mod/Read_Cell_Real.f90 +++ b/Sources/Process/Backup_Mod/Load_Cell_Real.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Read_Cell_Real(Grid, disp, vc, var_name, array) + subroutine Load_Cell_Real(Backup, Grid, disp, vc, var_name, array) !------------------------------------------------------------------------------! ! Reads a vector variable with boundary cells from a backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Grid_Type), target :: Grid integer(DP) :: disp integer :: vc @@ -15,6 +16,8 @@ subroutine Backup_Mod_Read_Cell_Real(Grid, disp, vc, var_name, array) character(SL) :: vn integer :: vs, cnt_loop, nb, nc integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! ! Take alias @@ -38,7 +41,7 @@ subroutine Backup_Mod_Read_Cell_Real(Grid, disp, vc, var_name, array) ! If variable is found, read it and retrun if(vn .eq. var_name) then - if(this_proc < 2) print *, '# Reading variable: ', trim(vn) + if(First_Proc()) print *, '# Reading variable: ', trim(vn) call Comm % Read_Cell_Real(fh, array(1:Comm % nc_sub), disp_loop) call Comm % Read_Bnd_Real (fh, array( -Comm % nb_f: & -Comm % nb_l), disp_loop) @@ -56,7 +59,7 @@ subroutine Backup_Mod_Read_Cell_Real(Grid, disp, vc, var_name, array) end do -1 if(this_proc < 2) print *, '# Variable: ', trim(var_name), ' not found! ', & +1 if(First_Proc()) print *, '# Variable: ', trim(var_name), ' not found! ', & 'Setting the values to 0.0!' array(:) = 0.0 diff --git a/Sources/Process/Backup_Mod/Read_Face_Real.f90 b/Sources/Process/Backup_Mod/Load_Face_Real.f90 similarity index 86% rename from Sources/Process/Backup_Mod/Read_Face_Real.f90 rename to Sources/Process/Backup_Mod/Load_Face_Real.f90 index b15b3a5d8..9d5b0f9a8 100644 --- a/Sources/Process/Backup_Mod/Read_Face_Real.f90 +++ b/Sources/Process/Backup_Mod/Load_Face_Real.f90 @@ -1,17 +1,17 @@ !==============================================================================! - subroutine Backup_Mod_Read_Face_Real(Grid, disp, vc, var_name, array, & - correct_sign) + subroutine Load_Face_Real(Backup, Grid, disp, vc, var_name, array, corr_sign) !------------------------------------------------------------------------------! ! Reads a vector variable with face values from a backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Grid_Type), target :: Grid integer :: disp, vc character(len=*) :: var_name real :: array(Grid % n_faces) - logical, optional :: correct_sign ! for face fluxes, signs might have - ! to be changed (check it one day) + logical, optional :: corr_sign ! for face fluxes, signs might have + ! to be changed (check it one day) !-----------------------------------[Locals]-----------------------------------! type(Comm_Type), pointer :: Comm character(SL) :: vn @@ -40,7 +40,7 @@ subroutine Backup_Mod_Read_Face_Real(Grid, disp, vc, var_name, array, & ! If variable is found, read it and retrun if(vn .eq. var_name) then - if(this_proc < 2) print *, '# Reading variable: ', trim(vn) + if(First_Proc()) print *, '# Reading variable: ', trim(vn) i_sid = 1 ! local side counter do sg = 1, Comm % nf_tot ! global side loop @@ -81,7 +81,7 @@ subroutine Backup_Mod_Read_Face_Real(Grid, disp, vc, var_name, array, & return -1 if(this_proc < 2) print *, '# Variable: ', trim(var_name), ' not found! ', & +1 if(First_Proc()) print *, '# Variable: ', trim(var_name), ' not found! ', & 'Setting the values to 0.0!' array(:) = 0.0 diff --git a/Sources/Process/Backup_Mod/Read_Int.f90 b/Sources/Process/Backup_Mod/Load_Int.f90 similarity index 75% rename from Sources/Process/Backup_Mod/Read_Int.f90 rename to Sources/Process/Backup_Mod/Load_Int.f90 index cdf253107..cc6da8b84 100644 --- a/Sources/Process/Backup_Mod/Read_Int.f90 +++ b/Sources/Process/Backup_Mod/Load_Int.f90 @@ -1,19 +1,22 @@ !==============================================================================! - subroutine Backup_Mod_Read_Int(Comm, disp, vc, var_name, var_value) + subroutine Load_Int(Backup, Comm, disp, vc, var_name, var_value) !------------------------------------------------------------------------------! ! Reads a single named integer variable from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Comm_Type) :: Comm - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - integer :: var_value + class(Backup_Type) :: Backup + type(Comm_Type) :: Comm + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + integer :: var_value !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs, cnt_loop integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! cnt_loop = 0 @@ -32,7 +35,7 @@ subroutine Backup_Mod_Read_Int(Comm, disp, vc, var_name, var_value) ! If variable is found, read it and retrun if(vn .eq. var_name) then - if(this_proc < 2) print *, '# Reading variable: ', trim(vn) + if(First_Proc()) print *, '# Reading variable: ', trim(vn) call Comm % Read_Int(fh, var_value, disp_loop) disp = disp_loop return @@ -47,7 +50,7 @@ subroutine Backup_Mod_Read_Int(Comm, disp, vc, var_name, var_value) end do -1 if(this_proc < 2) print *, '# Variable: ', trim(var_name), ' not found! ', & +1 if(First_Proc()) print *, '# Variable: ', trim(var_name), ' not found! ', & 'Setting the value to 0!' var_value = 0 diff --git a/Sources/Process/Backup_Mod/Read_Int_Array.f90 b/Sources/Process/Backup_Mod/Load_Int_Array.f90 similarity index 83% rename from Sources/Process/Backup_Mod/Read_Int_Array.f90 rename to Sources/Process/Backup_Mod/Load_Int_Array.f90 index ddd4d9f3b..3f9b5251f 100644 --- a/Sources/Process/Backup_Mod/Read_Int_Array.f90 +++ b/Sources/Process/Backup_Mod/Load_Int_Array.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Read_Int_Array(Comm, disp, vc, arr_name, arr_value) + subroutine Load_Int_Array(Backup, Comm, disp, vc, arr_name, arr_value) !------------------------------------------------------------------------------! ! Reads a named integer array from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Comm_Type) :: Comm integer(DP) :: disp integer :: vc @@ -14,6 +15,8 @@ subroutine Backup_Mod_Read_Int_Array(Comm, disp, vc, arr_name, arr_value) character(SL) :: vn integer :: vs, cnt_loop, length integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! cnt_loop = 0 @@ -33,7 +36,7 @@ subroutine Backup_Mod_Read_Int_Array(Comm, disp, vc, arr_name, arr_value) ! If variable is found, read it and retrun if(vn .eq. arr_name) then - if(this_proc < 2) print *, '# Reading array: ', trim(vn) + if(First_Proc()) print *, '# Reading array: ', trim(vn) call Comm % Read_Int_Array(fh, arr_value, disp_loop) disp = disp_loop return @@ -48,7 +51,7 @@ subroutine Backup_Mod_Read_Int_Array(Comm, disp, vc, arr_name, arr_value) end do -1 if(this_proc < 2) print *, '# Array: ', trim(arr_name), ' not found! ', & +1 if(First_Proc()) print *, '# Array: ', trim(arr_name), ' not found! ', & 'Setting the values to 0!' arr_value(:) = 0 diff --git a/Sources/Process/Backup_Mod/Read_Log.f90 b/Sources/Process/Backup_Mod/Load_Log.f90 similarity index 75% rename from Sources/Process/Backup_Mod/Read_Log.f90 rename to Sources/Process/Backup_Mod/Load_Log.f90 index 3357765e1..487913765 100644 --- a/Sources/Process/Backup_Mod/Read_Log.f90 +++ b/Sources/Process/Backup_Mod/Load_Log.f90 @@ -1,19 +1,22 @@ !==============================================================================! - subroutine Backup_Mod_Read_Log(Comm, disp, vc, var_name, var_value) + subroutine Load_Log(Backup, Comm, disp, vc, var_name, var_value) !------------------------------------------------------------------------------! ! Reads a single named logical variable from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Comm_Type) :: Comm - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - logical :: var_value + class(Backup_Type) :: Backup + type(Comm_Type) :: Comm + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + logical :: var_value !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs, cnt_loop integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! cnt_loop = 0 @@ -32,7 +35,7 @@ subroutine Backup_Mod_Read_Log(Comm, disp, vc, var_name, var_value) ! If variable is found, read it and retrun if(vn .eq. var_name) then - if(this_proc < 2) print *, '# Reading variable: ', trim(vn) + if(First_Proc()) print *, '# Reading variable: ', trim(vn) call Comm % Read_Log(fh, var_value, disp_loop) disp = disp_loop return @@ -47,7 +50,7 @@ subroutine Backup_Mod_Read_Log(Comm, disp, vc, var_name, var_value) end do -1 if(this_proc < 2) print *, '# Variable: ', trim(var_name), ' not found! ', & +1 if(First_Proc()) print *, '# Variable: ', trim(var_name), ' not found! ', & 'Setting the value to false!' var_value = .false. diff --git a/Sources/Process/Backup_Mod/Read_Log_Array.f90 b/Sources/Process/Backup_Mod/Load_Log_Array.f90 similarity index 83% rename from Sources/Process/Backup_Mod/Read_Log_Array.f90 rename to Sources/Process/Backup_Mod/Load_Log_Array.f90 index 29cf7c81f..bd17e18f2 100644 --- a/Sources/Process/Backup_Mod/Read_Log_Array.f90 +++ b/Sources/Process/Backup_Mod/Load_Log_Array.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Read_Log_Array(Comm, disp, vc, arr_name, arr_value) + subroutine Load_Log_Array(Backup, Comm, disp, vc, arr_name, arr_value) !------------------------------------------------------------------------------! ! Reads a named integer array from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Comm_Type) :: Comm integer(DP) :: disp integer :: vc @@ -14,6 +15,8 @@ subroutine Backup_Mod_Read_Log_Array(Comm, disp, vc, arr_name, arr_value) character(SL) :: vn integer :: vs, cnt_loop, length integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! cnt_loop = 0 @@ -33,7 +36,7 @@ subroutine Backup_Mod_Read_Log_Array(Comm, disp, vc, arr_name, arr_value) ! If variable is found, read it and retrun if(vn .eq. arr_name) then - if(this_proc < 2) print *, '# Reading array: ', trim(vn) + if(First_Proc()) print *, '# Reading array: ', trim(vn) call Comm % Read_Log_Array(fh, arr_value, disp_loop) disp = disp_loop return @@ -48,7 +51,7 @@ subroutine Backup_Mod_Read_Log_Array(Comm, disp, vc, arr_name, arr_value) end do -1 if(this_proc < 2) print *, '# Array: ', trim(arr_name), ' not found! ', & +1 if(First_Proc()) print *, '# Array: ', trim(arr_name), ' not found! ', & 'Setting the values to .false.!' arr_value(:) = .false. diff --git a/Sources/Process/Backup_Mod/Read_Real.f90 b/Sources/Process/Backup_Mod/Load_Real.f90 similarity index 75% rename from Sources/Process/Backup_Mod/Read_Real.f90 rename to Sources/Process/Backup_Mod/Load_Real.f90 index 497031e87..3c17ddefb 100644 --- a/Sources/Process/Backup_Mod/Read_Real.f90 +++ b/Sources/Process/Backup_Mod/Load_Real.f90 @@ -1,19 +1,22 @@ !==============================================================================! - subroutine Backup_Mod_Read_Real(Comm, disp, vc, var_name, var_value) + subroutine Load_Real(Backup, Comm, disp, vc, var_name, var_value) !------------------------------------------------------------------------------! ! Reads a single named real variable from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Comm_Type) :: Comm - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - real :: var_value + class(Backup_Type) :: Backup + type(Comm_Type) :: Comm + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + real :: var_value !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vo, cnt_loop integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! cnt_loop = 0 @@ -32,7 +35,7 @@ subroutine Backup_Mod_Read_Real(Comm, disp, vc, var_name, var_value) ! If variable is found, read it and retrun if(vn .eq. var_name) then - if(this_proc < 2) print *, '# Reading variable: ', trim(vn) + if(First_Proc()) print *, '# Reading variable: ', trim(vn) call Comm % Read_Real(fh, var_value, disp_loop) disp = disp_loop return @@ -47,7 +50,7 @@ subroutine Backup_Mod_Read_Real(Comm, disp, vc, var_name, var_value) end do -1 if(this_proc < 2) print *, '# Variable: ', trim(var_name), ' not found! ', & +1 if(First_Proc()) print *, '# Variable: ', trim(var_name), ' not found! ', & 'Setting the value to 0.0!' var_value = 0.0 diff --git a/Sources/Process/Backup_Mod/Read_Real_Array.f90 b/Sources/Process/Backup_Mod/Load_Real_Array.f90 similarity index 83% rename from Sources/Process/Backup_Mod/Read_Real_Array.f90 rename to Sources/Process/Backup_Mod/Load_Real_Array.f90 index 3b5f4fb69..85d0e0706 100644 --- a/Sources/Process/Backup_Mod/Read_Real_Array.f90 +++ b/Sources/Process/Backup_Mod/Load_Real_Array.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Read_Real_Array(Comm, disp, vc, arr_name, arr_value) + subroutine Load_Real_Array(Backup, Comm, disp, vc, arr_name, arr_value) !------------------------------------------------------------------------------! ! Reads a named real array from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Comm_Type) :: Comm integer(DP) :: disp integer :: vc @@ -14,6 +15,8 @@ subroutine Backup_Mod_Read_Real_Array(Comm, disp, vc, arr_name, arr_value) character(SL) :: vn integer :: vo, cnt_loop, length integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! cnt_loop = 0 @@ -33,7 +36,7 @@ subroutine Backup_Mod_Read_Real_Array(Comm, disp, vc, arr_name, arr_value) ! If variable is found, read it and retrun if(vn .eq. arr_name) then - if(this_proc < 2) print *, '# Reading array: ', trim(vn) + if(First_Proc()) print *, '# Reading array: ', trim(vn) call Comm % Read_Real_Array(fh, arr_value(1:length), disp_loop) disp = disp_loop return @@ -48,7 +51,7 @@ subroutine Backup_Mod_Read_Real_Array(Comm, disp, vc, arr_name, arr_value) end do -1 if(this_proc < 2) print *, '# Array: ', trim(arr_name), ' not found!', & +1 if(First_Proc()) print *, '# Array: ', trim(arr_name), ' not found!', & 'Setting the values to 0.0!' arr_value(:) = 0.0 diff --git a/Sources/Process/Backup_Mod/Load_Swarm.f90 b/Sources/Process/Backup_Mod/Load_Swarm.f90 new file mode 100644 index 000000000..16e43bc39 --- /dev/null +++ b/Sources/Process/Backup_Mod/Load_Swarm.f90 @@ -0,0 +1,86 @@ +!==============================================================================! + subroutine Load_Swarm(Backup, Swarm, disp, vc) +!------------------------------------------------------------------------------! +! Loads backup files name.backup ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup + type(Swarm_Type), target :: Swarm + integer(DP) :: disp + integer :: vc +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + type(Comm_Type), pointer :: Comm + type(Particle_Type), pointer :: part + integer :: i, k, n_part, n_parts_in_buffers +!==============================================================================! + + ! Take aliases + Grid => Swarm % pnt_grid + Comm => Grid % Comm + + !--------------------------! + ! ! + ! Swarm (of particles) ! + ! ! + !--------------------------! + + ! Number of particles + call Backup % Load_Int(Comm, disp, vc, 'n_particles', n_part) + + Swarm % i_work(:) = 0 + Swarm % l_work(:) = .false. + Swarm % r_work(:) = 0.0 + + if(n_part > 0) then + Swarm % n_particles = n_part + call Backup % Load_Int_Array(Comm, disp, vc, & + 'particle_int_data', & + Swarm % i_work(1 : Swarm % N_I_VARS*Swarm % n_particles)) + call Backup % Load_Log_Array(Comm, disp, vc, & + 'particle_log_data', & + Swarm % l_work(1 : Swarm % N_L_VARS*Swarm % n_particles)) + call Backup % Load_Real_Array(Comm, disp, vc, & + 'particle_real_data', & + Swarm % r_work(1 : Swarm % N_R_VARS*Swarm % n_particles)) + + ! Unpack particle data from arrays + do k = 1, Swarm % n_particles + + ! Take aliases for the Particle + part => Swarm % Particle(k) + + i = (k-1) * Swarm % N_I_VARS + part % proc = Swarm % i_work(i + 1) + part % buff = Swarm % i_work(i + 2) + part % cell = Swarm % i_work(i + 3) ! holds global number for the moment + + i = (k-1) * Swarm % N_L_VARS + part % deposited = Swarm % l_work(i + 1) + part % escaped = Swarm % l_work(i + 2) + + i = (k-1) * Swarm % N_R_VARS + part % x_n = Swarm % r_work(i + 1) + part % y_n = Swarm % r_work(i + 2) + part % z_n = Swarm % r_work(i + 3) + part % u = Swarm % r_work(i + 4) + part % v = Swarm % r_work(i + 5) + part % w = Swarm % r_work(i + 6) + part % d = Swarm % r_work(i + 7) + part % cfl = Swarm % r_work(i + 8) + + end do + end if + + n_parts_in_buffers = 0 + do k = 1, Swarm % n_particles + Swarm % Particle(k) % cell = 0 + Swarm % Particle(k) % node = 0 + Swarm % Particle(k) % proc = 0 + Swarm % Particle(k) % buff = 0 + call Swarm % Particle(k) % Find_Nearest_Cell(n_parts_in_buffers) + call Swarm % Particle(k) % Find_Nearest_Node() + end do + + end subroutine diff --git a/Sources/Process/Backup_Mod/Read_Variable.f90 b/Sources/Process/Backup_Mod/Load_Variable.f90 similarity index 83% rename from Sources/Process/Backup_Mod/Read_Variable.f90 rename to Sources/Process/Backup_Mod/Load_Variable.f90 index db7703957..b925445a6 100644 --- a/Sources/Process/Backup_Mod/Read_Variable.f90 +++ b/Sources/Process/Backup_Mod/Load_Variable.f90 @@ -1,21 +1,24 @@ !==============================================================================! - subroutine Backup_Mod_Read_Variable(disp, vc, var_name, Fld, var) + subroutine Load_Variable(Backup, disp, vc, var_name, Flow, var) !------------------------------------------------------------------------------! ! Reads a whole variable from backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - type(Field_Type) :: Fld - type(Var_Type) :: var + class(Backup_Type) :: Backup + type(Field_Type) :: Flow + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + type(Var_Type) :: var !-----------------------------------[Locals]-----------------------------------! type(Comm_Type), pointer :: Comm type(Grid_Type), pointer :: Grid character(SL) :: vn integer :: vs, cnt_loop, nb, nc integer(DP) :: disp_loop +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! ! Take aliases @@ -40,7 +43,7 @@ subroutine Backup_Mod_Read_Variable(disp, vc, var_name, Fld, var) ! If variable is found, read it and retrun if(vn .eq. var_name) then - if(this_proc < 2) print *, '# Reading variable: ', trim(vn) + if(First_Proc()) print *, '# Reading variable: ', trim(vn) call Comm % Read_Cell_Real(fh,var % n(1:Comm % nc_sub), disp_loop) call Comm % Read_Bnd_Real (fh,var % n( -Comm % nb_f: & -Comm % nb_l), disp_loop) @@ -57,7 +60,7 @@ subroutine Backup_Mod_Read_Variable(disp, vc, var_name, Fld, var) call Grid % Exchange_Cells_Real(var % o(-nb:nc)) ! Compute fresh gradients - call Fld % Grad_Variable(var) + call Flow % Grad_Variable(var) disp = disp_loop return @@ -72,7 +75,7 @@ subroutine Backup_Mod_Read_Variable(disp, vc, var_name, Fld, var) end do -1 if(this_proc < 2) print *, '# Variable: ', trim(var_name), ' not found!', & +1 if(First_Proc()) print *, '# Variable: ', trim(var_name), ' not found!', & 'Setting the values to 0.0!' var % n(:) = 0.0 var % q(:) = 0.0 diff --git a/Sources/Process/Backup_Mod/Read_Swarm.f90 b/Sources/Process/Backup_Mod/Read_Swarm.f90 deleted file mode 100644 index b802d6f42..000000000 --- a/Sources/Process/Backup_Mod/Read_Swarm.f90 +++ /dev/null @@ -1,85 +0,0 @@ -!==============================================================================! - subroutine Backup_Mod_Read_Swarm(disp, vc, Swr) -!------------------------------------------------------------------------------! -! Loads backup files name.backup ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - integer(DP) :: disp - integer :: vc - type(Swarm_Type), target :: Swr -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - type(Comm_Type), pointer :: Comm - type(Particle_Type), pointer :: part - integer :: i, k, n_part, n_parts_in_buffers -!==============================================================================! - - ! Take aliases - Grid => Swr % pnt_grid - Comm => Grid % Comm - - !--------------------------! - ! ! - ! Swarm (of particles) ! - ! ! - !--------------------------! - - ! Number of particles - call Backup_Mod_Read_Int(Comm, disp, vc, 'n_particles', n_part) - - Swr % i_work(:) = 0 - Swr % l_work(:) = .false. - Swr % r_work(:) = 0.0 - - if(n_part > 0) then - Swr % n_particles = n_part - call Backup_Mod_Read_Int_Array(Comm, disp, vc, & - 'particle_int_data', & - Swr % i_work(1 : Swr % N_I_VARS*Swr % n_particles)) - call Backup_Mod_Read_Log_Array(Comm, disp, vc, & - 'particle_log_data', & - Swr % l_work(1 : Swr % N_L_VARS*Swr % n_particles)) - call Backup_Mod_Read_Real_Array(Comm, disp, vc, & - 'particle_real_data', & - Swr % r_work(1 : Swr % N_R_VARS*Swr % n_particles)) - - ! Unpack particle data from arrays - do k = 1, Swr % n_particles - - ! Take aliases for the Particle - part => Swr % Particle(k) - - i = (k-1) * Swr % N_I_VARS - part % proc = Swr % i_work(i + 1) - part % buff = Swr % i_work(i + 2) - part % cell = Swr % i_work(i + 3) ! holds global number for the moment - - i = (k-1) * Swr % N_L_VARS - part % deposited = Swr % l_work(i + 1) - part % escaped = Swr % l_work(i + 2) - - i = (k-1) * Swr % N_R_VARS - part % x_n = Swr % r_work(i + 1) - part % y_n = Swr % r_work(i + 2) - part % z_n = Swr % r_work(i + 3) - part % u = Swr % r_work(i + 4) - part % v = Swr % r_work(i + 5) - part % w = Swr % r_work(i + 6) - part % d = Swr % r_work(i + 7) - part % cfl = Swr % r_work(i + 8) - - end do - end if - - n_parts_in_buffers = 0 - do k = 1, Swr % n_particles - Swr % Particle(k) % cell = 0 - Swr % Particle(k) % node = 0 - Swr % Particle(k) % proc = 0 - Swr % Particle(k) % buff = 0 - call Swr % Particle(k) % Find_Nearest_Cell(n_parts_in_buffers) - call Swr % Particle(k) % Find_Nearest_Node() - end do - - end subroutine diff --git a/Sources/Process/Backup_Mod/Save.f90 b/Sources/Process/Backup_Mod/Save.f90 index 008dfc4d5..84e5f4d2f 100644 --- a/Sources/Process/Backup_Mod/Save.f90 +++ b/Sources/Process/Backup_Mod/Save.f90 @@ -1,37 +1,36 @@ !==============================================================================! - subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) + subroutine Save(Backup, Flow, Turb, Vof, Swarm, dom) !------------------------------------------------------------------------------! ! Saves backup files name.backup ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Fld - type(Turb_Type), target :: Tur + class(Backup_Type) :: Backup + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swr - real :: time ! time of simulation - integer :: time_step ! current time step - integer, optional :: domain + type(Swarm_Type), target :: Swarm + integer, optional :: dom !-----------------------------------[Locals]-----------------------------------! type(Comm_Type), pointer :: Comm type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk type(Var_Type), pointer :: phi - character(SL) :: name_out, name_mean, a_name - integer :: vc, sc, ua + character(SL) :: name_out, name_mean + integer :: vc, sc integer(DP) :: d !==============================================================================! call Profiler % Start('Backup_Mod_Save') ! Take aliases - Grid => Fld % pnt_grid - bulk => Fld % bulk + Grid => Flow % pnt_grid + bulk => Flow % bulk Comm => Grid % Comm ! Name backup file - call File % Set_Name(name_out, time_step=time_step, & - extension='.backup', domain=domain) + call File % Set_Name(name_out, time_step = Time % Curr_Dt(), & + extension='.backup', domain=dom) ! Open backup file call Comm % Open_File_Write(fh, name_out) @@ -45,38 +44,37 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) ! Intialize number of stored variables vc = 0 - !-----------------------------------------------------------------------! - ! Save cell-centre coordinates. Could be useful for interpolations ! - !-----------------------------------------------------------------------! - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'x_coords', Grid % xc) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'y_coords', Grid % yc) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'z_coords', Grid % zc) - !---------------! ! ! ! Save data ! ! ! !---------------! + !---------------------------------! + ! Related to time integration ! + !---------------------------------! + ! Time step - call Backup_Mod_Write_Int(Comm, d, vc, 'time_step', time_step) + call Backup % Save_Int(Comm, d, vc, 'time_step', Time % Curr_Dt()) ! Simulation time - call Backup_Mod_Write_Real(Comm, d, vc, 'time', time) + call Backup % Save_Real(Comm, d, vc, 'time', Time % Get_Time()) ! Number of processors - call Backup_Mod_Write_Int(Comm, d, vc, 'n_proc', n_proc) - - ! Bulk flows and pressure drops in each direction - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_flux_x', bulk % flux_x) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_flux_y', bulk % flux_y) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_flux_z', bulk % flux_z) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_flux_x_o', bulk % flux_x_o) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_flux_y_o', bulk % flux_y_o) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_flux_z_o', bulk % flux_z_o) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_p_drop_x', bulk % p_drop_x) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_p_drop_y', bulk % p_drop_y) - call Backup_Mod_Write_Real(Comm, d, vc, 'bulk_p_drop_z', bulk % p_drop_z) + call Backup % Save_Int(Comm, d, vc, 'n_proc', N_Procs()) + + !-----------------------------------------------------! + ! Bulk flows and pressure drops in each direction ! + !-----------------------------------------------------! + call Backup % Save_Real(Comm, d, vc, 'bulk_flux_x', bulk % flux_x) + call Backup % Save_Real(Comm, d, vc, 'bulk_flux_y', bulk % flux_y) + call Backup % Save_Real(Comm, d, vc, 'bulk_flux_z', bulk % flux_z) + call Backup % Save_Real(Comm, d, vc, 'bulk_flux_x_o', bulk % flux_x_o) + call Backup % Save_Real(Comm, d, vc, 'bulk_flux_y_o', bulk % flux_y_o) + call Backup % Save_Real(Comm, d, vc, 'bulk_flux_z_o', bulk % flux_z_o) + call Backup % Save_Real(Comm, d, vc, 'bulk_p_drop_x', bulk % p_drop_x) + call Backup % Save_Real(Comm, d, vc, 'bulk_p_drop_y', bulk % p_drop_y) + call Backup % Save_Real(Comm, d, vc, 'bulk_p_drop_z', bulk % p_drop_z) !----------------------------! ! ! @@ -87,18 +85,18 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) !--------------! ! Velocity ! !--------------! - call Backup_Mod_Write_Variable(d, vc, 'u_velocity', Fld % u) - call Backup_Mod_Write_Variable(d, vc, 'v_velocity', Fld % v) - call Backup_Mod_Write_Variable(d, vc, 'w_velocity', Fld % w) + call Backup % Save_Variable(d, vc, 'u_velocity', Flow % u) + call Backup % Save_Variable(d, vc, 'v_velocity', Flow % v) + call Backup % Save_Variable(d, vc, 'w_velocity', Flow % w) !------------------------------------------------------! ! Pressure, its gradients, and pressure correction ! !------------------------------------------------------! - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'press', Fld % p % n) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'press_x', Fld % p % x) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'press_y', Fld % p % y) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'press_z', Fld % p % z) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'press_corr', Fld % pp % n) + call Backup % Save_Cell_Real(Grid, d, vc, 'press', Flow % p % n) + call Backup % Save_Cell_Real(Grid, d, vc, 'press_x', Flow % p % x) + call Backup % Save_Cell_Real(Grid, d, vc, 'press_y', Flow % p % y) + call Backup % Save_Cell_Real(Grid, d, vc, 'press_z', Flow % p % z) + call Backup % Save_Cell_Real(Grid, d, vc, 'press_corr', Flow % pp % n) !-------------------! ! Volume fluxes ! -> don't use for the time being, too much trouble @@ -118,15 +116,15 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) ! ! Update on June 2, 2022: Unified all outlet boundaries into one ! to be able to tell PETSc if matrix for pressure is singular - call Backup_Mod_Write_Log(Comm, d, vc, 'has_pressure', Fld % has_pressure) + call Backup % Save_Log(Comm, d, vc, 'has_pressure', Flow % has_pressure) !--------------! ! ! ! Enthalpy ! ! ! !--------------! - if(Fld % heat_transfer) then - call Backup_Mod_Write_Variable(d, vc, 'temp', Fld % t) + if(Flow % heat_transfer) then + call Backup % Save_Variable(d, vc, 'temp', Flow % t) end if !--------------! @@ -134,8 +132,8 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) ! Multiphase ! ! ! !--------------! - if(Fld % with_interface) then - call Backup_Mod_Write_Variable(d, vc, 'vof_fun', Vof % fun) + if(Flow % with_interface) then + call Backup % Save_Variable(d, vc, 'vof_fun', Vof % fun) end if !-----------------------! @@ -147,23 +145,23 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) !-----------------! ! K-eps model ! !-----------------! - if(Tur % model .eq. K_EPS) then + if(Turb % model .eq. K_EPS) then ! K and epsilon - call Backup_Mod_Write_Variable(d, vc, 'kin', Tur % kin) - call Backup_Mod_Write_Variable(d, vc, 'eps', Tur % eps) + call Backup % Save_Variable(d, vc, 'kin', Turb % kin) + call Backup % Save_Variable(d, vc, 'eps', Turb % eps) ! Other turbulent quantities - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'p_kin', Tur % p_kin ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'y_plus', Tur % y_plus) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vis_t', Tur % vis_t ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vis_w', Tur % vis_w ) + call Backup % Save_Cell_Real(Grid, d, vc, 'p_kin', Turb % p_kin ) + call Backup % Save_Cell_Real(Grid, d, vc, 'y_plus', Turb % y_plus) + call Backup % Save_Cell_Real(Grid, d, vc, 'vis_t', Turb % vis_t ) + call Backup % Save_Cell_Real(Grid, d, vc, 'vis_w', Turb % vis_w ) ! Turbulence quantities connected with heat transfer - if(Fld % heat_transfer) then - call Backup_Mod_Write_Variable(d, vc, 't2', Tur % t2) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'p_t2', Tur % p_t2 ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'con_w', Tur % con_w) + if(Flow % heat_transfer) then + call Backup % Save_Variable(d, vc, 't2', Turb % t2) + call Backup % Save_Cell_Real(Grid, d, vc, 'p_t2', Turb % p_t2 ) + call Backup % Save_Cell_Real(Grid, d, vc, 'con_w', Turb % con_w) end if end if @@ -171,27 +169,27 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) !------------------------! ! K-eps-zeta-f model ! !------------------------! - if(Tur % model .eq. K_EPS_ZETA_F .or. & - Tur % model .eq. HYBRID_LES_RANS) then + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then ! K, eps, zeta and f22 - call Backup_Mod_Write_Variable(d, vc, 'kin', Tur % kin) - call Backup_Mod_Write_Variable(d, vc, 'eps', Tur % eps) - call Backup_Mod_Write_Variable(d, vc, 'zeta', Tur % zeta) - call Backup_Mod_Write_Variable(d, vc, 'f22', Tur % f22) + call Backup % Save_Variable(d, vc, 'kin', Turb % kin) + call Backup % Save_Variable(d, vc, 'eps', Turb % eps) + call Backup % Save_Variable(d, vc, 'zeta', Turb % zeta) + call Backup % Save_Variable(d, vc, 'f22', Turb % f22) ! Other turbulent quantities - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'p_kin', Tur % p_kin ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'y_plus', Tur % y_plus ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'vis_t', Tur % vis_t ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'vis_w', Tur % vis_w ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'t_scale', Tur % t_scale) - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'l_scale', Tur % l_scale) - - if(Fld % heat_transfer) then - call Backup_Mod_Write_Variable(d, vc, 't2', Tur % t2) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'p_t2', Tur % p_t2 ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'con_w', Tur % con_w) + call Backup % Save_Cell_Real(Grid, d, vc,'p_kin', Turb % p_kin ) + call Backup % Save_Cell_Real(Grid, d, vc,'y_plus', Turb % y_plus ) + call Backup % Save_Cell_Real(Grid, d, vc,'vis_t', Turb % vis_t ) + call Backup % Save_Cell_Real(Grid, d, vc,'vis_w', Turb % vis_w ) + call Backup % Save_Cell_Real(Grid, d, vc,'t_scale', Turb % t_scale) + call Backup % Save_Cell_Real(Grid, d, vc,'l_scale', Turb % l_scale) + + if(Flow % heat_transfer) then + call Backup % Save_Variable(d, vc, 't2', Turb % t2) + call Backup % Save_Cell_Real(Grid, d, vc, 'p_t2', Turb % p_t2 ) + call Backup % Save_Cell_Real(Grid, d, vc, 'con_w', Turb % con_w) end if end if @@ -199,48 +197,48 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) !----------------------------! ! Reynolds stress models ! !----------------------------! - if(Tur % model .eq. RSM_MANCEAU_HANJALIC .or. & - Tur % model .eq. RSM_HANJALIC_JAKIRLIC) then + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then ! Reynolds stresses - call Backup_Mod_Write_Variable(d, vc, 'uu', Tur % uu) - call Backup_Mod_Write_Variable(d, vc, 'vv', Tur % vv) - call Backup_Mod_Write_Variable(d, vc, 'ww', Tur % ww) - call Backup_Mod_Write_Variable(d, vc, 'uv', Tur % uv) - call Backup_Mod_Write_Variable(d, vc, 'uw', Tur % uw) - call Backup_Mod_Write_Variable(d, vc, 'vw', Tur % vw) + call Backup % Save_Variable(d, vc, 'uu', Turb % uu) + call Backup % Save_Variable(d, vc, 'vv', Turb % vv) + call Backup % Save_Variable(d, vc, 'ww', Turb % ww) + call Backup % Save_Variable(d, vc, 'uv', Turb % uv) + call Backup % Save_Variable(d, vc, 'uw', Turb % uw) + call Backup % Save_Variable(d, vc, 'vw', Turb % vw) ! Epsilon - call Backup_Mod_Write_Variable(d, vc, 'eps', Tur % eps) + call Backup % Save_Variable(d, vc, 'eps', Turb % eps) ! F22 - if(Tur % model .eq. RSM_MANCEAU_HANJALIC) then - call Backup_Mod_Write_Variable(d, vc, 'f22', Tur % f22) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then + call Backup % Save_Variable(d, vc, 'f22', Turb % f22) end if ! Other turbulent quantities - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vis_t', Tur % vis_t) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vis_w', Tur % vis_w) + call Backup % Save_Cell_Real(Grid, d, vc, 'vis_t', Turb % vis_t) + call Backup % Save_Cell_Real(Grid, d, vc, 'vis_w', Turb % vis_w) ! Turbulence quantities connected with heat transfer - if(Fld % heat_transfer) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc,'con_w', Tur % con_w) + if(Flow % heat_transfer) then + call Backup % Save_Cell_Real(Grid, d, vc,'con_w', Turb % con_w) end if end if !--------------! ! Roughness ! !--------------! - if(Tur % rough_walls) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'z_o', Tur % z_o) + if(Turb % rough_walls) then + call Backup % Save_Cell_Real(Grid, d, vc, 'z_o', Turb % z_o) end if !------------------! ! Save scalars ! !------------------! - do sc = 1, Fld % n_scalars - phi => Fld % scalar(sc) - call Backup_Mod_Write_Variable(d, vc, phi % name, phi) + do sc = 1, Flow % n_scalars + phi => Flow % scalar(sc) + call Backup % Save_Variable(d, vc, phi % name, phi) end do !-----------------------------------------! @@ -248,96 +246,76 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) ! Turbulent statistics for all models ! ! ! !-----------------------------------------! - if(Tur % statistics) then - - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'u_mean', Tur % u_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'v_mean', Tur % v_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'w_mean', Tur % w_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'p_mean', Tur % p_mean) - if(Fld % heat_transfer) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 't_mean', Tur % t_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'q_mean', Tur % q_mean) + if(Turb % statistics) then + + call Backup % Save_Cell_Real(Grid, d, vc, 'u_mean', Turb % u_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'v_mean', Turb % v_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'w_mean', Turb % w_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'p_mean', Turb % p_mean) + if(Flow % heat_transfer) then + call Backup % Save_Cell_Real(Grid, d, vc, 't_mean', Turb % t_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'q_mean', Turb % q_mean) end if ! K and epsilon - if(Tur % model .eq. K_EPS) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'kin_mean', & - Tur % kin_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'eps_mean', & - Tur % eps_mean) - if(Fld % heat_transfer) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 't2_mean', & - Tur % t2_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'ut_mean', & - Tur % ut_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vt_mean', & - Tur % vt_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'wt_mean', & - Tur % wt_mean) + if(Turb % model .eq. K_EPS) then + call Backup % Save_Cell_Real(Grid, d, vc, 'kin_mean', Turb % kin_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'eps_mean', Turb % eps_mean) + if(Flow % heat_transfer) then + call Backup % Save_Cell_Real(Grid, d, vc, 't2_mean', Turb % t2_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'ut_mean', Turb % ut_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'vt_mean', Turb % vt_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'wt_mean', Turb % wt_mean) end if end if ! K-eps-zeta-f and the hybrid model - if(Tur % model .eq. K_EPS_ZETA_F .or. & - Tur % model .eq. HYBRID_LES_RANS) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'kin_mean', & - Tur % kin_mean ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'eps_mean', & - Tur % eps_mean ) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'zeta_mean', & - Tur % zeta_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'f22_mean', & - Tur % f22_mean ) - if(Fld % heat_transfer) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 't2_mean', & - Tur % t2_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'ut_mean', & - Tur % ut_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vt_mean', & - Tur % vt_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'wt_mean', & - Tur % wt_mean) + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then + call Backup % Save_Cell_Real(Grid, d, vc, 'kin_mean', Turb % kin_mean ) + call Backup % Save_Cell_Real(Grid, d, vc, 'eps_mean', Turb % eps_mean ) + call Backup % Save_Cell_Real(Grid, d, vc, 'zeta_mean', Turb % zeta_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'f22_mean', Turb % f22_mean ) + if(Flow % heat_transfer) then + call Backup % Save_Cell_Real(Grid, d, vc, 't2_mean', Turb % t2_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'ut_mean', Turb % ut_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'vt_mean', Turb % vt_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'wt_mean', Turb % wt_mean) end if end if ! Reynolds stress models - if(Tur % model .eq. RSM_MANCEAU_HANJALIC .or. & - Tur % model .eq. RSM_HANJALIC_JAKIRLIC) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'uu_mean', & - Tur % uu_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vv_mean', & - Tur % vv_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'ww_mean', & - Tur % ww_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'uv_mean', & - Tur % uv_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'uw_mean', & - Tur % uw_mean) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vw_mean', & - Tur % vw_mean) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + call Backup % Save_Cell_Real(Grid, d, vc, 'uu_mean', Turb % uu_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'vv_mean', Turb % vv_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'ww_mean', Turb % ww_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'uv_mean', Turb % uv_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'uw_mean', Turb % uw_mean) + call Backup % Save_Cell_Real(Grid, d, vc, 'vw_mean', Turb % vw_mean) end if - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'uu_res', Tur % uu_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vv_res', Tur % vv_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'ww_res', Tur % ww_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'uv_res', Tur % uv_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'uw_res', Tur % uw_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vw_res', Tur % vw_res) - - if(Fld % heat_transfer) then - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 't2_res', Tur % t2_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'ut_res', Tur % ut_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'vt_res', Tur % vt_res) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'wt_res', Tur % wt_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'uu_res', Turb % uu_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'vv_res', Turb % vv_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'ww_res', Turb % ww_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'uv_res', Turb % uv_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'uw_res', Turb % uw_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'vw_res', Turb % vw_res) + + if(Flow % heat_transfer) then + call Backup % Save_Cell_Real(Grid, d, vc, 't2_res', Turb % t2_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'ut_res', Turb % ut_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'vt_res', Turb % vt_res) + call Backup % Save_Cell_Real(Grid, d, vc, 'wt_res', Turb % wt_res) end if ! Scalars - do sc = 1, Fld % n_scalars - phi => Fld % scalar(sc) + do sc = 1, Flow % n_scalars + phi => Flow % scalar(sc) name_mean = phi % name name_mean(5:9) = '_mean' - call Backup_Mod_Write_Cell_Real(Grid, d, vc, name_mean, & - Tur % scalar_mean(sc, :)) + call Backup % Save_Cell_Real(Grid, d, vc, name_mean, & + Turb % scalar_mean(sc, :)) end do end if @@ -347,31 +325,16 @@ subroutine Backup_Mod_Save(Fld, Tur, Vof, Swr, time, time_step, domain) ! Swarm (of particles) ! ! ! !--------------------------! - if(Fld % with_particles) then - call Backup_Mod_Write_Swarm(d, vc, Swr) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'n_deposited', & - Swr % n_deposited) - call Backup_Mod_Write_Cell_Real(Grid, d, vc, 'n_reflected', & - Swr % n_reflected) + if(Flow % with_particles) then + call Backup % Save_Swarm(Swarm, d, vc) + call Backup % Save_Cell_Real(Grid,d,vc, 'n_deposited', Swarm % n_deposited) + call Backup % Save_Cell_Real(Grid,d,vc, 'n_reflected', Swarm % n_reflected) end if - !-----------------! - ! ! - ! User arrays ! - ! ! - !-----------------! - - do ua = 1, Grid % n_user_arrays - a_name = 'A_??' - write(a_name(3:4),'(I2.2)') ua - call Backup_Mod_Write_Cell_Real(Grid, d, vc, a_name, & - Grid % user_array(ua, :)) - end do - ! Variable count (store +1 to count its own self) - call Backup_Mod_Write_Int(Comm, d, vc, 'variable_count', vc + 1) + call Backup % Save_Int(Comm, d, vc, 'variable_count', vc + 1) - if(this_proc < 2) then + if(First_Proc()) then print *, '# Wrote ', vc, ' variables!' end if diff --git a/Sources/Process/Backup_Mod/Write_Cell_Real.f90 b/Sources/Process/Backup_Mod/Save_Cell_Real.f90 similarity index 83% rename from Sources/Process/Backup_Mod/Write_Cell_Real.f90 rename to Sources/Process/Backup_Mod/Save_Cell_Real.f90 index b09389469..253b2b1bf 100644 --- a/Sources/Process/Backup_Mod/Write_Cell_Real.f90 +++ b/Sources/Process/Backup_Mod/Save_Cell_Real.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Write_Cell_Real(Grid, disp, vc, var_name, array) + subroutine Save_Cell_Real(Backup, Grid, disp, vc, var_name, array) !------------------------------------------------------------------------------! ! Writes a vector variable with boundary cells to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Grid_Type), target :: Grid integer(DP) :: disp integer :: vc @@ -14,12 +15,14 @@ subroutine Backup_Mod_Write_Cell_Real(Grid, disp, vc, var_name, array) type(Comm_Type), pointer :: Comm character(SL) :: vn integer :: vs ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! ! Take alias Comm => Grid % Comm - if(this_proc < 2) print *, '# Writing variable: ', trim(var_name) + if(First_Proc()) print *, '# Writing variable: ', trim(var_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Face_Real.f90 b/Sources/Process/Backup_Mod/Save_Face_Real.f90 similarity index 80% rename from Sources/Process/Backup_Mod/Write_Face_Real.f90 rename to Sources/Process/Backup_Mod/Save_Face_Real.f90 index 243bd4f51..5875c2480 100644 --- a/Sources/Process/Backup_Mod/Write_Face_Real.f90 +++ b/Sources/Process/Backup_Mod/Save_Face_Real.f90 @@ -1,30 +1,32 @@ !==============================================================================! - subroutine Backup_Mod_Write_Face_Real(Grid, disp, vc, var_name, array, & - correct_sign) + subroutine Save_Face_Real(Backup, Grid, disp, vc, var_name, array, corr_sign) !------------------------------------------------------------------------------! ! Writes a vector variable with face values backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Grid_Type), target :: Grid integer(DP) :: disp integer :: vc character(len=*) :: var_name real :: array(Grid % n_faces) - logical, optional :: correct_sign ! for face fluxes, signs might have - ! to be changed (check it one day) + logical, optional :: corr_sign ! for face fluxes, signs might have + ! to be changed (check it one day) !-----------------------------------[Locals]-----------------------------------! type(Comm_Type), pointer :: Comm character(len=80) :: vn integer :: vs ! variable size integer :: s, c1, c2, cg1, cg2, sg, i_sid, error real :: buffer +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! ! Take alias Comm => Grid % Comm - if(this_proc < 2) print *, '# Writing variable: ', trim(var_name) + if(First_Proc()) print *, '# Writing variable: ', trim(var_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Int.f90 b/Sources/Process/Backup_Mod/Save_Int.f90 similarity index 68% rename from Sources/Process/Backup_Mod/Write_Int.f90 rename to Sources/Process/Backup_Mod/Save_Int.f90 index ab36759a0..b8345b5f1 100644 --- a/Sources/Process/Backup_Mod/Write_Int.f90 +++ b/Sources/Process/Backup_Mod/Save_Int.f90 @@ -1,21 +1,24 @@ !==============================================================================! - subroutine Backup_Mod_Write_Int(Comm, disp, vc, var_name, var_value) + subroutine Save_Int(Backup, Comm, disp, vc, var_name, var_value) !------------------------------------------------------------------------------! ! Writes a single named integer variable to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Comm_Type) :: Comm - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - integer :: var_value + class(Backup_Type) :: Backup + type(Comm_Type) :: Comm + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + integer :: var_value !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! - if(this_proc < 2) print *, '# Writing variable: ', trim(var_name) + if(First_Proc()) print *, '# Writing variable: ', trim(var_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Int_Array.f90 b/Sources/Process/Backup_Mod/Save_Int_Array.f90 similarity index 80% rename from Sources/Process/Backup_Mod/Write_Int_Array.f90 rename to Sources/Process/Backup_Mod/Save_Int_Array.f90 index 873d05480..90c6d7fe3 100644 --- a/Sources/Process/Backup_Mod/Write_Int_Array.f90 +++ b/Sources/Process/Backup_Mod/Save_Int_Array.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Write_Int_Array(Comm, disp, vc, arr_name, arr_value) + subroutine Save_Int_Array(Backup, Comm, disp, vc, arr_name, arr_value) !------------------------------------------------------------------------------! ! Writes a named integer array to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Comm_Type) :: Comm integer(DP) :: disp integer :: vc @@ -13,11 +14,13 @@ subroutine Backup_Mod_Write_Int_Array(Comm, disp, vc, arr_name, arr_value) !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs, length ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! length = size(arr_value) - if(this_proc < 2) print *, '# Writing array: ', trim(arr_name) + if(First_Proc()) print *, '# Writing array: ', trim(arr_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Log.f90 b/Sources/Process/Backup_Mod/Save_Log.f90 similarity index 68% rename from Sources/Process/Backup_Mod/Write_Log.f90 rename to Sources/Process/Backup_Mod/Save_Log.f90 index 921b9b04d..e261f3764 100644 --- a/Sources/Process/Backup_Mod/Write_Log.f90 +++ b/Sources/Process/Backup_Mod/Save_Log.f90 @@ -1,21 +1,24 @@ !==============================================================================! - subroutine Backup_Mod_Write_Log(Comm, disp, vc, var_name, var_value) + subroutine Save_Log(Backup, Comm, disp, vc, var_name, var_value) !------------------------------------------------------------------------------! ! Writes a named logical variable to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Comm_Type) :: Comm - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - logical :: var_value + class(Backup_Type) :: Backup + type(Comm_Type) :: Comm + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + logical :: var_value !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! - if(this_proc < 2) print *, '# Writing variable: ', trim(var_name) + if(First_Proc()) print *, '# Writing variable: ', trim(var_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Log_Array.f90 b/Sources/Process/Backup_Mod/Save_Log_Array.f90 similarity index 80% rename from Sources/Process/Backup_Mod/Write_Log_Array.f90 rename to Sources/Process/Backup_Mod/Save_Log_Array.f90 index cb7cdf945..5609986a7 100644 --- a/Sources/Process/Backup_Mod/Write_Log_Array.f90 +++ b/Sources/Process/Backup_Mod/Save_Log_Array.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Write_Log_Array(Comm, disp, vc, arr_name, arr_value) + subroutine Save_Log_Array(Backup, Comm, disp, vc, arr_name, arr_value) !------------------------------------------------------------------------------! ! Writes a named logical array to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Comm_Type) :: Comm integer(DP) :: disp integer :: vc @@ -13,11 +14,13 @@ subroutine Backup_Mod_Write_Log_Array(Comm, disp, vc, arr_name, arr_value) !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs, length ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! length = size(arr_value) - if(this_proc < 2) print *, '# Writing array: ', trim(arr_name) + if(First_Proc()) print *, '# Writing array: ', trim(arr_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Real.f90 b/Sources/Process/Backup_Mod/Save_Real.f90 similarity index 68% rename from Sources/Process/Backup_Mod/Write_Real.f90 rename to Sources/Process/Backup_Mod/Save_Real.f90 index 459d5fc9f..7e7bc79ab 100644 --- a/Sources/Process/Backup_Mod/Write_Real.f90 +++ b/Sources/Process/Backup_Mod/Save_Real.f90 @@ -1,21 +1,24 @@ !==============================================================================! - subroutine Backup_Mod_Write_Real(Comm, disp, vc, var_name, var_value) + subroutine Save_Real(Backup, Comm, disp, vc, var_name, var_value) !------------------------------------------------------------------------------! ! Writes a single named real variable to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Comm_Type) :: Comm - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - real :: var_value + class(Backup_Type) :: Backup + type(Comm_Type) :: Comm + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + real :: var_value !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! - if(this_proc < 2) print *, '# Writing variable: ', trim(var_name) + if(First_Proc()) print *, '# Writing variable: ', trim(var_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Write_Real_Array.f90 b/Sources/Process/Backup_Mod/Save_Real_Array.f90 similarity index 80% rename from Sources/Process/Backup_Mod/Write_Real_Array.f90 rename to Sources/Process/Backup_Mod/Save_Real_Array.f90 index 3199904b7..100668522 100644 --- a/Sources/Process/Backup_Mod/Write_Real_Array.f90 +++ b/Sources/Process/Backup_Mod/Save_Real_Array.f90 @@ -1,11 +1,11 @@ !==============================================================================! - subroutine Backup_Mod_Write_Real_Array(Comm, disp, & - vc, arr_name, arr_value) + subroutine Save_Real_Array(Backup, Comm, disp, vc, arr_name, arr_value) !------------------------------------------------------------------------------! ! Writes a name real array to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup type(Comm_Type) :: Comm integer(DP) :: disp integer :: vc @@ -14,11 +14,13 @@ subroutine Backup_Mod_Write_Real_Array(Comm, disp, & !-----------------------------------[Locals]-----------------------------------! character(SL) :: vn integer :: vs, length ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! length = size(arr_value) - if(this_proc < 2) print *, '# Writing array: ', trim(arr_name) + if(First_Proc()) print *, '# Writing array: ', trim(arr_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Save_Swarm.f90 b/Sources/Process/Backup_Mod/Save_Swarm.f90 new file mode 100644 index 000000000..2a9080f6f --- /dev/null +++ b/Sources/Process/Backup_Mod/Save_Swarm.f90 @@ -0,0 +1,88 @@ +!==============================================================================! + subroutine Save_Swarm(Backup, Swarm, disp, vc) +!------------------------------------------------------------------------------! +! Saves backup files name.backup ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Backup_Type) :: Backup + type(Swarm_Type), target :: Swarm + integer(DP) :: disp + integer :: vc +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + type(Comm_Type), pointer :: Comm + type(Particle_Type), pointer :: Part + integer :: i, k +!==============================================================================! + + ! Take aliases + Grid => Swarm % pnt_grid + Comm => Grid % Comm + + !--------------------------! + ! ! + ! Swarm (of particles) ! + ! ! + !--------------------------! + + ! Number of particles + call Backup % Save_Int(Comm, disp, vc, 'n_particles', Swarm % n_particles) + + !----------------------------------------------! + ! Write only if there are active particles ! + !----------------------------------------------! + if(Swarm % n_particles > 0) then + + Swarm % i_work(:) = 0 + Swarm % l_work(:) = .false. + Swarm % r_work(:) = 0.0 + + ! Pack particle data in arrays + do k = 1, Swarm % n_particles + + ! Take aliases for the particle + Part => Swarm % Particle(k) + + if(Part % proc .eq. This_Proc()) then + i = (k-1) * Swarm % N_I_VARS + Swarm % i_work(i + 1) = Part % proc ! where it resides + Swarm % i_work(i + 2) = Part % buff ! where it wants to go + Swarm % i_work(i + 3) = Grid % Comm % cell_glo(Part % cell) + + i = (k-1) * Swarm % N_L_VARS + Swarm % l_work(i + 1) = Part % deposited + Swarm % l_work(i + 2) = Part % escaped + + i = (k-1) * Swarm % N_R_VARS + Swarm % r_work(i + 1) = Part % x_n + Swarm % r_work(i + 2) = Part % y_n + Swarm % r_work(i + 3) = Part % z_n + Swarm % r_work(i + 4) = Part % u + Swarm % r_work(i + 5) = Part % v + Swarm % r_work(i + 6) = Part % w + Swarm % r_work(i + 7) = Part % d + Swarm % r_work(i + 8) = Part % cfl + end if ! particle on this processor + end do + + !-----------------------! + ! Exchange the data ! + !-----------------------! + call Global % Sum_Int_Array (Swarm % n_particles*Swarm % N_I_VARS, & + Swarm % i_work) + call Global % Sum_Real_Array(Swarm % n_particles*Swarm % N_R_VARS, & + Swarm % r_work) + + call Backup % Save_Int_Array(Comm, disp, vc, & + 'particle_int_data', & + Swarm % i_work(1 : Swarm % N_I_VARS*Swarm % n_particles)) + call Backup % Save_Log_Array(Comm, disp, vc, & + 'particle_log_data', & + Swarm % l_work(1 : Swarm % N_L_VARS*Swarm % n_particles)) + call Backup % Save_Real_Array(Comm, disp, vc, & + 'particle_real_data', & + Swarm % r_work(1 : Swarm % N_R_VARS*Swarm % n_particles)) + end if + + end subroutine diff --git a/Sources/Process/Backup_Mod/Write_Variable.f90 b/Sources/Process/Backup_Mod/Save_Variable.f90 similarity index 80% rename from Sources/Process/Backup_Mod/Write_Variable.f90 rename to Sources/Process/Backup_Mod/Save_Variable.f90 index 83b787e4d..325c655fb 100644 --- a/Sources/Process/Backup_Mod/Write_Variable.f90 +++ b/Sources/Process/Backup_Mod/Save_Variable.f90 @@ -1,24 +1,27 @@ !==============================================================================! - subroutine Backup_Mod_Write_Variable(disp, vc, var_name, var) + subroutine Save_Variable(Backup, disp, vc, var_name, var) !------------------------------------------------------------------------------! ! Writes a whole variable to backup file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer(DP) :: disp - integer :: vc - character(len=*) :: var_name - type(Var_Type) :: var + class(Backup_Type) :: Backup + integer(DP) :: disp + integer :: vc + character(len=*) :: var_name + type(Var_Type) :: var !-----------------------------------[Locals]-----------------------------------! type(Comm_Type), pointer :: Comm character(SL) :: vn integer :: vs ! variable size +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Backup) !==============================================================================! ! Take alias Comm => var % pnt_grid % Comm - if(this_proc < 2) print *, '# Writing variable: ', trim(var_name) + if(First_Proc()) print *, '# Writing variable: ', trim(var_name) ! Increase variable count vc = vc + 1 diff --git a/Sources/Process/Backup_Mod/Time_To_Save.f90 b/Sources/Process/Backup_Mod/Time_To_Save_Backup.f90 similarity index 61% rename from Sources/Process/Backup_Mod/Time_To_Save.f90 rename to Sources/Process/Backup_Mod/Time_To_Save_Backup.f90 index eeba39c99..bd77cac24 100644 --- a/Sources/Process/Backup_Mod/Time_To_Save.f90 +++ b/Sources/Process/Backup_Mod/Time_To_Save_Backup.f90 @@ -1,12 +1,12 @@ !==============================================================================! - logical function Backup_Mod_Time_To_Save(curr_dt) + logical function Time_To_Save_Backup(Backup) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: curr_dt ! current time step + class(Backup_Type) :: Backup !==============================================================================! - Backup_Mod_Time_To_Save = mod(curr_dt, backup % interval) .eq. 0 & - .and. .not. curr_dt .eq. 0 + Time_To_Save_Backup = mod(Time % Curr_Dt(), backup % interval) .eq. 0 & + .and. .not. Time % Curr_Dt() .eq. 0 end function diff --git a/Sources/Process/Backup_Mod/Write_Swarm.f90 b/Sources/Process/Backup_Mod/Write_Swarm.f90 deleted file mode 100644 index f18a7fc49..000000000 --- a/Sources/Process/Backup_Mod/Write_Swarm.f90 +++ /dev/null @@ -1,88 +0,0 @@ -!==============================================================================! - subroutine Backup_Mod_Write_Swarm(disp, vc, Swr) -!------------------------------------------------------------------------------! -! Saves backup files name.backup ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - integer(DP) :: disp - integer :: vc - type(Swarm_Type), target :: Swr -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - type(Comm_Type), pointer :: Comm - type(Particle_Type), pointer :: Part - integer :: i, k -!==============================================================================! - - ! Take aliases - Grid => Swr % pnt_grid - Comm => Grid % Comm - - !--------------------------! - ! ! - ! Swarm (of particles) ! - ! ! - !--------------------------! - - ! Number of particles - call Backup_Mod_Write_Int(Comm, disp, vc, 'n_particles', & - Swr % n_particles) - - !----------------------------------------------! - ! Write only if there are active particles ! - !----------------------------------------------! - if(Swr % n_particles > 0) then - - Swr % i_work(:) = 0 - Swr % l_work(:) = .false. - Swr % r_work(:) = 0.0 - - ! Pack particle data in arrays - do k = 1, Swr % n_particles - - ! Take aliases for the particle - Part => Swr % Particle(k) - - if(Part % proc .eq. this_proc) then - i = (k-1) * Swr % N_I_VARS - Swr % i_work(i + 1) = Part % proc ! where it resides - Swr % i_work(i + 2) = Part % buff ! where it wants to go - Swr % i_work(i + 3) = Grid % Comm % cell_glo(Part % cell) - - i = (k-1) * Swr % N_L_VARS - Swr % l_work(i + 1) = Part % deposited - Swr % l_work(i + 2) = Part % escaped - - i = (k-1) * Swr % N_R_VARS - Swr % r_work(i + 1) = Part % x_n - Swr % r_work(i + 2) = Part % y_n - Swr % r_work(i + 3) = Part % z_n - Swr % r_work(i + 4) = Part % u - Swr % r_work(i + 5) = Part % v - Swr % r_work(i + 6) = Part % w - Swr % r_work(i + 7) = Part % d - Swr % r_work(i + 8) = Part % cfl - end if ! particle on this processor - end do - - !-----------------------! - ! Exchange the data ! - !-----------------------! - call Comm_Mod_Global_Sum_Int_Array (Swr % n_particles * Swr % N_I_VARS, & - Swr % i_work) - call Comm_Mod_Global_Sum_Real_Array(Swr % n_particles * Swr % N_R_VARS, & - Swr % r_work) - - call Backup_Mod_Write_Int_Array(Comm, disp, vc, & - 'particle_int_data', & - Swr % i_work(1 : Swr % N_I_VARS*Swr % n_particles)) - call Backup_Mod_Write_Log_Array(Comm, disp, vc, & - 'particle_log_data', & - Swr % l_work(1 : Swr % N_L_VARS*Swr % n_particles)) - call Backup_Mod_Write_Real_Array(Comm, disp, vc, & - 'particle_real_data', & - Swr % r_work(1 : Swr % N_R_VARS*Swr % n_particles)) - end if - - end subroutine diff --git a/Sources/Process/Bulk_Mod/Monitoring_Planes_Areas.f90 b/Sources/Process/Bulk_Mod/Monitoring_Planes_Areas.f90 index 71d88cb24..b0d3caf10 100644 --- a/Sources/Process/Bulk_Mod/Monitoring_Planes_Areas.f90 +++ b/Sources/Process/Bulk_Mod/Monitoring_Planes_Areas.f90 @@ -69,8 +69,8 @@ subroutine Bulk_Mod_Monitoring_Planes_Areas(bulk, Grid) end do - call Comm_Mod_Global_Sum_Real(bulk % area_x) - call Comm_Mod_Global_Sum_Real(bulk % area_y) - call Comm_Mod_Global_Sum_Real(bulk % area_z) + call Global % Sum_Real(bulk % area_x) + call Global % Sum_Real(bulk % area_y) + call Global % Sum_Real(bulk % area_z) end subroutine diff --git a/Sources/Process/Bulk_Mod/Print_Areas.f90 b/Sources/Process/Bulk_Mod/Print_Areas.f90 index dd8f96d2f..d0c209b4b 100644 --- a/Sources/Process/Bulk_Mod/Print_Areas.f90 +++ b/Sources/Process/Bulk_Mod/Print_Areas.f90 @@ -8,7 +8,7 @@ subroutine Bulk_Mod_Print_Areas(bulk) type(Bulk_Type) :: bulk !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then write(*,'(a7,es12.5)') ' # Ax :', bulk % area_x write(*,'(a7,es12.5)') ' # Ay :', bulk % area_y write(*,'(a7,es12.5)') ' # Az :', bulk % area_z diff --git a/Sources/Process/C_Petsc_Interface.c b/Sources/Process/C_Petsc_Interface.c index 55990acea..902b1dcc1 100644 --- a/Sources/Process/C_Petsc_Interface.c +++ b/Sources/Process/C_Petsc_Interface.c @@ -21,8 +21,8 @@ /*---------------------------------------------------------------------------+ | PetscInitialize (and PetcIntialized) | | | - | https://petsc.org/main/docs/manualpages/Sys/PetscInitialize.html | - | https://petsc.org/main/docs/manualpages/Sys/PetscInitialized.html | + | https://petsc.org/release/manualpages/Sys/PetscInitialize/ | + | https://petsc.org/release/manualpages/Sys/PetscInitialized/ | +---------------------------------------------------------------------------*/ void c_petsc_initialize_() { @@ -37,8 +37,8 @@ /*---------------------------------------------------------------------------+ | PetscFinalize (and PetscInitialized) | | | - | https://petsc.org/main/docs/manualpages/Sys/PetscFinalize.html | - | https://petsc.org/main/docs/manualpages/Sys/PetscInitialized.html | + | https://petsc.org/release/manualpages/Sys/PetscFinalize/ | + | https://petsc.org/release/manualpages/Sys/PetscFinalized/ | +---------------------------------------------------------------------------*/ void c_petsc_finalize_() { @@ -53,7 +53,7 @@ /*---------------------------------------------------------------------------+ | PetscOptionsSetValue | | | - | https://petsc.org/main/docs/manualpages/Sys/PetscOptionsSetValue.html | + | https://petsc.org/release/manualpages/Sys/PetscOptionsSetValue/ | +---------------------------------------------------------------------------*/ void c_petsc_options_value_(const char name[], const char value[]) { @@ -69,7 +69,7 @@ /*---------------------------------------------------------------------------+ | MatCreate | | | - | https://petsc.org/release/docs/manualpages/Mat/MatCreate.html | + | https://petsc.org/release/manualpages/Mat/MatCreate/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_create_(Mat * A) { @@ -79,7 +79,7 @@ /*---------------------------------------------------------------------------+ | MatSetSizes | | | - | https://petsc.org/release/docs/manualpages/Mat/MatSetSizes.html | + | https://petsc.org/release/manualpages/Mat/MatSetSizes/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_set_sizes_(Mat * A, PetscInt * m, PetscInt * M) { @@ -89,7 +89,7 @@ /*---------------------------------------------------------------------------+ | MatSetType (to MATAIJ) | | | - | https://petsc.org/release/docs/manualpages/Mat/MatSetType.html | + | https://petsc.org/release/manualpages/Mat/MatSetType/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_set_type_to_mat_aij_(Mat * A) { @@ -101,10 +101,10 @@ | MatSeqAIJSetPreallocation | | | | Combines two calls which seems to be important or necessary | - | https://petsc.org/release/docs/manualpages/Mat/MATAIJ.html#MATAIJ | + | https://petsc.org/release/manualpages/Mat/MATAIJ/ | | | - | https://petsc.org/release/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html - | https://petsc.org/release/docs/manualpages/Mat/MatSeqAIJSetPreallocation.html + | https://petsc.org/release/manualpages/Mat/MatMPIAIJSetPreallocation/ | + | https://petsc.org/release/manualpages/Mat/MatSeqAIJSetPreallocation/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_aij_set_preallocation_(Mat * A, PetscInt * d_nnz, @@ -117,7 +117,7 @@ /*---------------------------------------------------------------------------+ | MatSetValue | | | - | https://petsc.org/release/docs/manualpages/Mat/MatSetValue.html | + | https://petsc.org/release/manualpages/Mat/MatSetValue/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_set_value_(Mat * A, PetscInt * row, @@ -130,9 +130,9 @@ /*---------------------------------------------------------------------------+ | MatAssemblyBegin and MatAssemblyEnd | | | - | https://petsc.org/release/docs/manualpages/Mat/MatAssemblyBegin.html | - | https://petsc.org/release/docs/manualpages/Mat/MatAssemblyEnd.html | - | https://petsc.org/main/docs/manualpages/Mat/MatSetOption.html | + | https://petsc.org/release/manualpages/Mat/MatAssemblyBegin/ | + | https://petsc.org/release/manualpages/Mat/MatAssemblyEnd/ | + | https://petsc.org/release/manualpages/Mat/MatSetOption/ | +---------------------------------------------------------------------------*/ void c_petsc_assemble_mat_(Mat * A) { @@ -140,6 +140,18 @@ err = MatAssemblyBegin(*A, MAT_FINAL_ASSEMBLY); err = MatAssemblyEnd (*A, MAT_FINAL_ASSEMBLY); + /*----------------------------------------------------------------+ + | Uncomment the block below to check if matrix is symmetric | + | It must be called after MatAssemblyBegin and MatAssemblyEnd | + | Ideally, this should become a separate function in the future | + | | + | https://petsc.org/release/manualpages/Mat/MatIsSymmetric/ | + +----------------------------------------------------------------*/ + /* PetscBool symmetric; + MatIsSymmetric(*A, 0.0, &symmetric); + if(!symmetric) {printf("Matrix is not symmetric\n");} + else {printf("Matrix is symmetric\n");} */ + /* If one wishes to repeatedly assemble matrices that retain the same nonzero pattern (such as within a time-dependent problem), the option should be specified after the first matrix has been @@ -150,8 +162,8 @@ /*---------------------------------------------------------------------------+ | MatSetNullSpace | | | - | https://petsc.org/release/docs/manualpages/Mat/MatNullSpaceCreate.html | - | https://petsc.org/release/docs/manualpages/Mat/MatSetNullSpace.html | + | https://petsc.org/release/manualpages/Mat/MatNullSpaceCreate/ | + | https://petsc.org/release/manualpages/Mat/MatSetNullSpace/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_set_null_space_(Mat * A) { @@ -165,7 +177,7 @@ /*---------------------------------------------------------------------------+ | MatSetNullSpace | | | - | https://petsc.org/release/docs/manualpages/Mat/MatSetNullSpace.html | + | https://petsc.org/release/manualpages/Mat/MatSetNullSpace/ | +---------------------------------------------------------------------------*/ void c_petsc_mat_remove_null_space_(Mat * A) { @@ -181,7 +193,7 @@ /*---------------------------------------------------------------------------+ | VecCreate | | | - | https://petsc.org/release/docs/manualpages/Vec/VecCreate.html | + | https://petsc.org/release/manualpages/Vec/VecCreate/ | +---------------------------------------------------------------------------*/ void c_petsc_vec_create_(Vec * v) { @@ -191,7 +203,7 @@ /*---------------------------------------------------------------------------+ | VecCreateMPI | | | - | https://petsc.org/release/docs/manualpages/Vec/VecCreateMPI.html | + | https://petsc.org/release/manualpages/Vec/VecCreateMPI/ | +---------------------------------------------------------------------------*/ void c_petsc_vec_create_mpi_(Vec * v, PetscInt * m, PetscInt * M) { @@ -201,7 +213,7 @@ /*---------------------------------------------------------------------------+ | VecSetSizes | | | - | https://petsc.org/release/docs/manualpages/Vec/VecSetSizes.html | + | https://petsc.org/release/manualpages/Vec/VecSetSizes/ | +---------------------------------------------------------------------------*/ void c_petsc_vec_set_sizes_(Vec * v, PetscInt * m, PetscInt * M) { @@ -211,7 +223,7 @@ /*---------------------------------------------------------------------------+ | VecSetType (to VECSTANDARD) | | | - | https://petsc.org/release/docs/manualpages/Vec/VecSetType.html | + | https://petsc.org/release/manualpages/Vec/VecSetType/ | +---------------------------------------------------------------------------*/ void c_petsc_vec_set_type_to_standard_(Vec * v) { @@ -221,7 +233,7 @@ /*---------------------------------------------------------------------------+ | VecSetValue | | | - | https://petsc.org/release/docs/manualpages/Vec/VecSetValue.html | + | https://petsc.org/release/manualpages/Vec/VecSetValue/ | +---------------------------------------------------------------------------*/ void c_petsc_vec_set_value_(Vec * v, PetscInt * row, PetscScalar * value) { @@ -231,8 +243,8 @@ /*---------------------------------------------------------------------------+ | VecAssemblyBegin and VecAssemblyEnd | | | - | https://petsc.org/release/docs/manualpages/Vec/VecAssemblyBegin.html | - | https://petsc.org/release/docs/manualpages/Vec/VecAssemblyEnd.html | + | https://petsc.org/release/manualpages/Vec/VecAssemblyBegin/ | + | https://petsc.org/release/manualpages/Vec/VecAssemblyEnd/ | +---------------------------------------------------------------------------*/ void c_petsc_assemble_vec_(Vec * v) { @@ -243,7 +255,7 @@ /*---------------------------------------------------------------------------+ | VecGetValues | | | - | https://petsc.org/release/docs/manualpages/Vec/VecGetValues.html | + | https://petsc.org/release/manualpages/Vec/VecGetValues/ | +---------------------------------------------------------------------------*/ void c_petsc_vec_get_values_(Vec * v, PetscInt * ni, @@ -262,7 +274,7 @@ /*---------------------------------------------------------------------------+ | KSPCreate | | | - | https://petsc.org/release/docs/manualpages/KSP/KSPCreate.html | + | https://petsc.org/release/manualpages/KSP/KSPCreate/ | +---------------------------------------------------------------------------*/ void c_petsc_ksp_create_(KSP * ksp) { @@ -272,13 +284,13 @@ /*---------------------------------------------------------------------------+ | KSP routines to set solver and preconditioner | | | - | https://petsc.org/release/docs/manualpages/KSP/KSPSetOperators.html | - | https://petsc.org/release/docs/manualpages/KSP/KSPSetType.html | - | https://petsc.org/release/docs/manualpages/KSP/KSPGetPC.html | - | https://petsc.org/release/docs/manualpages/PC/PCSetType.html | - | https://petsc.org/release/docs/manualpages/KSP/KSPSetFromOptions.html | - | https://petsc.org/release/docs/manualpages/KSP/KSPSetUp.html | - | https://petsc.org/release/docs/manualpages/KSP/KSPSetInitialGuessNonzero.html + | https://petsc.org/release/manualpages/KSP/KSPSetOperators/ | + | https://petsc.org/release/manualpages/KSP/KSPSetType/ | + | https://petsc.org/release/manualpages/KSP/KSPGetPC/ | + | https://petsc.org/release/manualpages/PC/PCSetType/ | + | https://petsc.org/release/manualpages/KSP/KSPSetFromOptions/ | + | https://petsc.org/release/manualpages/KSP/KSPSetUp/ | + | https://petsc.org/release/manualpages/KSP/KSPSetInitialGuessNonzero/ |v +---------------------------------------------------------------------------*/ void c_petsc_set_solver_and_preconditioner_(KSP * ksp, PC * pc, @@ -316,7 +328,7 @@ /*---------------------------------------------------------------------------+ | KSPSetTolerances | | | - | https://petsc.org/release/docs/manualpages/KSP/KSPSetTolerances.html | + | https://petsc.org/release/manualpages/KSP/KSPSetTolerances/ | +---------------------------------------------------------------------------*/ void c_petsc_ksp_set_tolerances_(KSP * ksp, PetscScalar * rtol, @@ -329,7 +341,7 @@ /*---------------------------------------------------------------------------+ | KSPSetTolerances | | | - | https://petsc.org/release/docs/manualpages/KSP/KSPSolve.html | + | https://petsc.org/release/manualpages/KSP/KSPSolve/ | +---------------------------------------------------------------------------*/ void c_petsc_ksp_solve_(KSP * ksp, Vec * b, Vec * x) { @@ -339,7 +351,7 @@ /*---------------------------------------------------------------------------+ | KSPGetConvergedReason | | | - | https://petsc.org/main/docs/manualpages/KSP/KSPGetConvergedReason.html | + | https://petsc.org/release/manualpages/KSP/KSPGetConvergedReason/ | +---------------------------------------------------------------------------*/ void c_petsc_ksp_converged_reason_(KSP * ksp, KSPConvergedReason * reason) { @@ -349,7 +361,7 @@ /*---------------------------------------------------------------------------+ | KSPGetIterationNumber | | | - | https://petsc.org/release/docs/manualpages/KSP/KSPGetIterationNumber.html | + | https://petsc.org/release/manualpages/KSP/KSPGetIterationNumber/ | +---------------------------------------------------------------------------*/ void c_petsc_ksp_get_iteration_number_(KSP * ksp, PetscInt * its) { @@ -359,7 +371,7 @@ /*---------------------------------------------------------------------------+ | KSPGetResidualNorm | | | - | https://petsc.org/release/docs/manualpages/KSP/KSPGetResidualNorm.html | + | https://petsc.org/release/manualpages/KSP/KSPGetResidualNorm/ | +---------------------------------------------------------------------------*/ void c_petsc_ksp_get_residual_norm_(KSP * ksp, PetscScalar * rnorm) { diff --git a/Sources/Process/Eddies_Mod/Gather_Bnd_Cells.f90 b/Sources/Process/Eddies_Mod/Gather_Bnd_Cells.f90 index d65402899..68775a41c 100644 --- a/Sources/Process/Eddies_Mod/Gather_Bnd_Cells.f90 +++ b/Sources/Process/Eddies_Mod/Gather_Bnd_Cells.f90 @@ -26,19 +26,19 @@ subroutine Eddies_Mod_Gather_Bnd_Cells(eddies) ! Count boundary cells in this processor eddies % n_bnd_cells = 0 do c = -Grid % n_bnd_cells, -1 - if(Grid % Bnd_Cond_Name( c) .eq. eddies % bc_name) then + if(Grid % Bnd_Cond_Name_At_Cell(c) .eq. eddies % bc_name) then eddies % n_bnd_cells = eddies % n_bnd_cells + 1 end if end do ! Estimate first boundary cell for each processor - if(n_proc > 1) then - allocate(n_bnd_cells_proc(n_proc)); n_bnd_cells_proc(:) = 0; - n_bnd_cells_proc(this_proc) = eddies % n_bnd_cells - call Comm_Mod_Global_Sum_Int_Array(n_proc, n_bnd_cells_proc) + if(Parallel_Run()) then + allocate(n_bnd_cells_proc(N_Procs())); n_bnd_cells_proc(:) = 0; + n_bnd_cells_proc(This_Proc()) = eddies % n_bnd_cells + call Global % Sum_Int_Array(N_Procs(), n_bnd_cells_proc) - allocate(s_bnd_cell_proc(n_proc)); s_bnd_cell_proc(:) = 0 - do n = 2, n_proc + allocate(s_bnd_cell_proc(N_Procs())); s_bnd_cell_proc(:) = 0 + do n = 2, N_Procs() s_bnd_cell_proc(n) = s_bnd_cell_proc(n-1) + n_bnd_cells_proc(n-1) end do else @@ -47,8 +47,8 @@ subroutine Eddies_Mod_Gather_Bnd_Cells(eddies) ! Gather coordinates from all processors eddies % n_bnd_cells_glo = eddies % n_bnd_cells - call Comm_Mod_Global_Sum_Int(eddies % n_bnd_cells_glo) - if(this_proc < 2) then + call Global % Sum_Int(eddies % n_bnd_cells_glo) + if(First_Proc()) then print '(a,a,i6)', ' # Number of boundary cells at ', & trim(eddies % bc_name), & eddies % n_bnd_cells_glo @@ -63,24 +63,24 @@ subroutine Eddies_Mod_Gather_Bnd_Cells(eddies) cnt = 0 do c = -Grid % n_bnd_cells, -1 - if(Grid % Bnd_Cond_Name( c) .eq. eddies % bc_name) then + if(Grid % Bnd_Cond_Name_At_Cell(c) .eq. eddies % bc_name) then cnt = cnt + 1 - eddies % bnd_xc(cnt + s_bnd_cell_proc(this_proc)) = Grid % xc(c) - eddies % bnd_yc(cnt + s_bnd_cell_proc(this_proc)) = Grid % yc(c) - eddies % bnd_zc(cnt + s_bnd_cell_proc(this_proc)) = Grid % zc(c) - eddies % bnd_wd(cnt + s_bnd_cell_proc(this_proc)) = Grid % wall_dist(c) - eddies % bnd_u (cnt + s_bnd_cell_proc(this_proc)) = Flow % u % b(c) - eddies % bnd_v (cnt + s_bnd_cell_proc(this_proc)) = Flow % v % b(c) - eddies % bnd_w (cnt + s_bnd_cell_proc(this_proc)) = Flow % w % b(c) + eddies % bnd_xc(cnt + s_bnd_cell_proc(This_Proc())) = Grid % xc(c) + eddies % bnd_yc(cnt + s_bnd_cell_proc(This_Proc())) = Grid % yc(c) + eddies % bnd_zc(cnt + s_bnd_cell_proc(This_Proc())) = Grid % zc(c) + eddies % bnd_wd(cnt + s_bnd_cell_proc(This_Proc())) = Grid % wall_dist(c) + eddies % bnd_u (cnt + s_bnd_cell_proc(This_Proc())) = Flow % u % b(c) + eddies % bnd_v (cnt + s_bnd_cell_proc(This_Proc())) = Flow % v % b(c) + eddies % bnd_w (cnt + s_bnd_cell_proc(This_Proc())) = Flow % w % b(c) end if end do - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_xc) - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_yc) - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_zc) - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_wd) - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_u) - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_v) - call Comm_Mod_Global_Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_w) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_xc) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_yc) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_zc) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_wd) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_u) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_v) + call Global % Sum_Real_Array(eddies % n_bnd_cells_glo, eddies % bnd_w) !-------------------------------------------------------! ! Find position of the inlet plane ! diff --git a/Sources/Process/Eddies_Mod/Superimpose.f90 b/Sources/Process/Eddies_Mod/Superimpose.f90 index 0318dacd4..458d7d0d1 100644 --- a/Sources/Process/Eddies_Mod/Superimpose.f90 +++ b/Sources/Process/Eddies_Mod/Superimpose.f90 @@ -20,7 +20,7 @@ subroutine Eddies_Mod_Superimpose(eddies) Flow => eddies % pnt_flow do c = -Grid % n_bnd_cells, -1 - if(Grid % Bnd_Cond_Name( c) .eq. eddies % bc_name) then + if(Grid % Bnd_Cond_Name_At_Cell(c) .eq. eddies % bc_name) then Flow % u % n(c) = Flow % u % b(c) Flow % v % n(c) = Flow % v % b(c) Flow % w % n(c) = Flow % w % b(c) @@ -49,7 +49,7 @@ subroutine Eddies_Mod_Superimpose(eddies) ! Select cell for each cell randomly do c = -Grid % n_bnd_cells, -1 - if(Grid % Bnd_Cond_Name( c) .eq. eddies % bc_name) then + if(Grid % Bnd_Cond_Name_At_Cell(c) .eq. eddies % bc_name) then xc = Grid % xc(c) yc = Grid % yc(c) diff --git a/Sources/Process/Field_Mod.f90 b/Sources/Process/Field_Mod.f90 index a37f01d83..23e2bcc34 100644 --- a/Sources/Process/Field_Mod.f90 +++ b/Sources/Process/Field_Mod.f90 @@ -1,4 +1,5 @@ #include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" !==============================================================================! module Field_Mod @@ -11,6 +12,7 @@ module Field_Mod use Face_Mod use Bulk_Mod use Solver_Mod + use Time_Mod use Numerics_Mod !------------------------------------------------------------------------------! implicit none @@ -141,7 +143,7 @@ module Field_Mod logical :: inside_piso_loop logical :: choi_correction logical :: gu_correction - logical :: report_vol_balance + logical :: rep_vol_balance ! Maximum CFL and Pe numbers real :: cfl_max, pe_max @@ -200,6 +202,7 @@ module Field_Mod procedure :: Grad procedure :: Grad_Component procedure, private :: Grad_Component_No_Refresh + procedure, private :: Grad_Three_Components_No_Refresh ! procedure :: Grad_Component_Faces_To_Cells ! not used ! procedure :: Grad_Component_Nodes_To_Cells ! not used ! procedure :: Grad_Component_Cells_To_Nodes ! not used @@ -227,15 +230,16 @@ module Field_Mod procedure :: Alias_Momentum procedure :: Buoyancy_Forces procedure :: Calculate_Courant_In_Cells ! for post-processing - procedure :: Calculate_Fluxes + procedure :: Calculate_Bulk_Fluxes procedure :: Compute_Wall_Distance ! see: Potential_Initialization - procedure :: Potential_Initialization ! see: Compute_Wall_Distance + procedure :: Potential_Initialisation ! see: Compute_Wall_Distance procedure :: Prandtl_Numb procedure :: Schmidt_Numb procedure :: U_Tan - procedure :: Report_Volume_Balance - procedure :: Report_Volume_Balance_Start - procedure :: Report_Volume_Balance_Stop + procedure :: Report_Vol_Balance + procedure :: Report_Vol_Balance_Start + procedure :: Report_Vol_Balance_Stop + procedure :: Volume_Average end type @@ -263,6 +267,7 @@ module Field_Mod # include "Field_Mod/Gradients/Grad.f90" # include "Field_Mod/Gradients/Grad_Component.f90" # include "Field_Mod/Gradients/Grad_Component_No_Refresh.f90" +# include "Field_Mod/Gradients/Grad_Three_Components_No_Refresh.f90" ! include "Field_Mod/Gradients/Grad_Component_Faces_To_Cells.f90" ! include "Field_Mod/Gradients/Grad_Component_Nodes_To_Cells.f90" ! include "Field_Mod/Gradients/Grad_Component_Cells_To_Nodes.f90" @@ -290,15 +295,16 @@ module Field_Mod # include "Field_Mod/Utilities/Alias_Momentum.f90" # include "Field_Mod/Utilities/Buoyancy_Forces.f90" # include "Field_Mod/Utilities/Calculate_Courant_In_Cells.f90" -# include "Field_Mod/Utilities/Calculate_Fluxes.f90" +# include "Field_Mod/Utilities/Calculate_Bulk_Fluxes.f90" # include "Field_Mod/Utilities/Calculate_Shear_And_Vorticity.f90" # include "Field_Mod/Utilities/Potential_Initialization.f90" # include "Field_Mod/Utilities/Prandtl_Numb.f90" # include "Field_Mod/Utilities/Schmidt_Numb.f90" # include "Field_Mod/Utilities/U_Tan.f90" # include "Field_Mod/Utilities/Compute_Wall_Distance.f90" -# include "Field_Mod/Utilities/Report_Volume_Balance.f90" -# include "Field_Mod/Utilities/Report_Volume_Balance_Start.f90" -# include "Field_Mod/Utilities/Report_Volume_Balance_Stop.f90" +# include "Field_Mod/Utilities/Report_Vol_Balance.f90" +# include "Field_Mod/Utilities/Report_Vol_Balance_Start.f90" +# include "Field_Mod/Utilities/Report_Vol_Balance_Stop.f90" +# include "Field_Mod/Utilities/Volume_Average.f90" end module diff --git a/Sources/Process/Field_Mod/Gradients/Calculate_Grad_Matrix.f90 b/Sources/Process/Field_Mod/Gradients/Calculate_Grad_Matrix.f90 index 3340f80e7..d0ef4d85f 100644 --- a/Sources/Process/Field_Mod/Gradients/Calculate_Grad_Matrix.f90 +++ b/Sources/Process/Field_Mod/Gradients/Calculate_Grad_Matrix.f90 @@ -12,7 +12,7 @@ subroutine Calculate_Grad_Matrix(Flow) logical, parameter :: DEBUG = .false. !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: dx_c1, dy_c1, dz_c1, dx_c2, dy_c2, dz_c2 real :: jac, g_inv(6) real, contiguous, pointer :: g1(:), g2(:), g3(:), g4(:), g5(:), g6(:) @@ -28,7 +28,7 @@ subroutine Calculate_Grad_Matrix(Flow) !--------------------------------------------! ! Initialize gradient matrices for cells ! !--------------------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() Flow % grad_c2c(1,c) = 0.0 Flow % grad_c2c(2,c) = 0.0 Flow % grad_c2c(3,c) = 0.0 @@ -40,7 +40,27 @@ subroutine Calculate_Grad_Matrix(Flow) !----------------------------------------------------------------------! ! Compute the gradient matrix for all cells browsing through faces ! !----------------------------------------------------------------------! - do s = 1, Grid % n_faces + + ! Boundary cells + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + + dx_c1 = Grid % dx(s) + dy_c1 = Grid % dy(s) + dz_c1 = Grid % dz(s) + + Flow % grad_c2c(1,c1)=Flow % grad_c2c(1,c1) + dx_c1*dx_c1 ! 1,1 + Flow % grad_c2c(2,c1)=Flow % grad_c2c(2,c1) + dy_c1*dy_c1 ! 2,2 + Flow % grad_c2c(3,c1)=Flow % grad_c2c(3,c1) + dz_c1*dz_c1 ! 3,3 + Flow % grad_c2c(4,c1)=Flow % grad_c2c(4,c1) + dx_c1*dy_c1 ! 1,2 & 2,1 + Flow % grad_c2c(5,c1)=Flow % grad_c2c(5,c1) + dx_c1*dz_c1 ! 1,3 & 3,1 + Flow % grad_c2c(6,c1)=Flow % grad_c2c(6,c1) + dy_c1*dz_c1 ! 2,3 & 3,2 + end do + end do + + ! Faces inside the domain + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) @@ -51,27 +71,26 @@ subroutine Calculate_Grad_Matrix(Flow) dy_c2 = Grid % dy(s) dz_c2 = Grid % dz(s) - Flow % grad_c2c(1,c1)=Flow % grad_c2c(1,c1) + dx_c1*dx_c1 ! 1,1 - Flow % grad_c2c(2,c1)=Flow % grad_c2c(2,c1) + dy_c1*dy_c1 ! 2,2 - Flow % grad_c2c(3,c1)=Flow % grad_c2c(3,c1) + dz_c1*dz_c1 ! 3,3 - Flow % grad_c2c(4,c1)=Flow % grad_c2c(4,c1) + dx_c1*dy_c1 ! 1,2 & 2,1 - Flow % grad_c2c(5,c1)=Flow % grad_c2c(5,c1) + dx_c1*dz_c1 ! 1,3 & 3,1 - Flow % grad_c2c(6,c1)=Flow % grad_c2c(6,c1) + dy_c1*dz_c1 ! 2,3 & 3,2 - if(c2 > 0) then ! this is enough even for parallel - Flow % grad_c2c(1,c2)=Flow % grad_c2c(1,c2) + dx_c2*dx_c2 ! 1,1 - Flow % grad_c2c(2,c2)=Flow % grad_c2c(2,c2) + dy_c2*dy_c2 ! 2,2 - Flow % grad_c2c(3,c2)=Flow % grad_c2c(3,c2) + dz_c2*dz_c2 ! 3,3 - Flow % grad_c2c(4,c2)=Flow % grad_c2c(4,c2) + dx_c2*dy_c2 ! 1,2 & 2,1 - Flow % grad_c2c(5,c2)=Flow % grad_c2c(5,c2) + dx_c2*dz_c2 ! 1,3 & 3,1 - Flow % grad_c2c(6,c2)=Flow % grad_c2c(6,c2) + dy_c2*dz_c2 ! 2,3 & 3,2 - end if + Flow % grad_c2c(1,c1)=Flow % grad_c2c(1,c1) + dx_c1*dx_c1 ! 1,1 + Flow % grad_c2c(2,c1)=Flow % grad_c2c(2,c1) + dy_c1*dy_c1 ! 2,2 + Flow % grad_c2c(3,c1)=Flow % grad_c2c(3,c1) + dz_c1*dz_c1 ! 3,3 + Flow % grad_c2c(4,c1)=Flow % grad_c2c(4,c1) + dx_c1*dy_c1 ! 1,2 & 2,1 + Flow % grad_c2c(5,c1)=Flow % grad_c2c(5,c1) + dx_c1*dz_c1 ! 1,3 & 3,1 + Flow % grad_c2c(6,c1)=Flow % grad_c2c(6,c1) + dy_c1*dz_c1 ! 2,3 & 3,2 + + Flow % grad_c2c(1,c2)=Flow % grad_c2c(1,c2) + dx_c2*dx_c2 ! 1,1 + Flow % grad_c2c(2,c2)=Flow % grad_c2c(2,c2) + dy_c2*dy_c2 ! 2,2 + Flow % grad_c2c(3,c2)=Flow % grad_c2c(3,c2) + dz_c2*dz_c2 ! 3,3 + Flow % grad_c2c(4,c2)=Flow % grad_c2c(4,c2) + dx_c2*dy_c2 ! 1,2 & 2,1 + Flow % grad_c2c(5,c2)=Flow % grad_c2c(5,c2) + dx_c2*dz_c2 ! 1,3 & 3,1 + Flow % grad_c2c(6,c2)=Flow % grad_c2c(6,c2) + dy_c2*dz_c2 ! 2,3 & 3,2 end do !--------------------------------! ! Find the inverse of matrix ! !--------------------------------! - do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells + do c = Cells_In_Domain() jac = Flow % grad_c2c(1,c) * Flow % grad_c2c(2,c) * Flow % grad_c2c(3,c) & - Flow % grad_c2c(1,c) * Flow % grad_c2c(6,c) * Flow % grad_c2c(6,c) & - Flow % grad_c2c(4,c) * Flow % grad_c2c(4,c) * Flow % grad_c2c(3,c) & @@ -102,7 +121,7 @@ subroutine Calculate_Grad_Matrix(Flow) end do if(DEBUG) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() g1(c) = Flow % grad_c2c(1,c) g2(c) = Flow % grad_c2c(2,c) g3(c) = Flow % grad_c2c(3,c) diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Component.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Component.f90 index 11e33ec90..8a19389b9 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Component.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Component.f90 @@ -14,7 +14,7 @@ subroutine Grad_Component(Flow, phi, i, phii) :Flow % pnt_grid % n_cells) !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid - integer :: s, c1, c2 + integer :: s, c1, c2, reg real :: dphi1, dphi2 !-----------------------------[Local parameters]-------------------------------! integer, dimension(3,3), parameter :: MAP = reshape((/ 1, 4, 5, & @@ -31,39 +31,40 @@ subroutine Grad_Component(Flow, phi, i, phii) ! Initialize gradients phii(1:Grid % n_cells) = 0. - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - dphi1 = phi(c2) - phi(c1) - dphi2 = phi(c2) - phi(c1) + ! On the boundaries update only c1 - if not symmetry + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! On the boundaries - if(c2 < 0) then + dphi1 = phi(c2)-phi(c1) - if(Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then - dphi1 = 0. - end if + phii(c1) = phii(c1) & + + dphi1 * ( Flow % grad_c2c(MAP(i,1),c1) * Grid % dx(s) & + + Flow % grad_c2c(MAP(i,2),c1) * Grid % dy(s) & + + Flow % grad_c2c(MAP(i,3),c1) * Grid % dz(s)) + end do + end if ! symmetry + end do - phii(c1) = phii(c1) & - + dphi1 * ( Flow % grad_c2c(MAP(i,1),c1) * Grid % dx(s) & - + Flow % grad_c2c(MAP(i,2),c1) * Grid % dy(s) & - + Flow % grad_c2c(MAP(i,3),c1) * Grid % dz(s)) - end if + ! Inside the domain + do s = Faces_In_Domain() + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! Inside the domain - if(c2 > 0) then + dphi1 = phi(c2)-phi(c1) + dphi2 = phi(c2)-phi(c1) - phii(c1) = phii(c1) & - + dphi1 * ( Flow % grad_c2c(MAP(i,1),c1) * Grid % dx(s) & - + Flow % grad_c2c(MAP(i,2),c1) * Grid % dy(s) & - + Flow % grad_c2c(MAP(i,3),c1) * Grid % dz(s)) + phii(c1) = phii(c1) & + + dphi1 * ( Flow % grad_c2c(MAP(i,1),c1) * Grid % dx(s) & + + Flow % grad_c2c(MAP(i,2),c1) * Grid % dy(s) & + + Flow % grad_c2c(MAP(i,3),c1) * Grid % dz(s)) - phii(c2) = phii(c2) & - + dphi2 * ( Flow % grad_c2c(MAP(i,1),c2) * Grid % dx(s) & - + Flow % grad_c2c(MAP(i,2),c2) * Grid % dy(s) & - + Flow % grad_c2c(MAP(i,3),c2) * Grid % dz(s)) - end if + phii(c2) = phii(c2) & + + dphi2 * ( Flow % grad_c2c(MAP(i,1),c2) * Grid % dx(s) & + + Flow % grad_c2c(MAP(i,2),c2) * Grid % dy(s) & + + Flow % grad_c2c(MAP(i,3),c2) * Grid % dz(s)) end do call Grid % Exchange_Cells_Real(phii) diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Component_No_Refresh.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Component_No_Refresh.f90 index 4d6e934df..e20e8ed20 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Component_No_Refresh.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Component_No_Refresh.f90 @@ -7,15 +7,17 @@ subroutine Grad_Component_No_Refresh(Flow, phi, i, phii) implicit none !---------------------------------[Arguments]----------------------------------! class(Field_Type), target :: Flow - real :: phi ( -Flow % pnt_grid % n_bnd_cells & + real, intent(in) :: phi ( -Flow % pnt_grid % n_bnd_cells & :Flow % pnt_grid % n_cells) integer, intent(in) :: i real, intent(out) :: phii( -Flow % pnt_grid % n_bnd_cells & :Flow % pnt_grid % n_cells) !-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - integer :: s, c1, c2 - real :: dphi1, dphi2 + type(Grid_Type), pointer :: Grid + real, contiguous, pointer :: dx(:), dy(:), dz(:), grad_c2c(:,:) + integer, contiguous, pointer :: faces_c(:,:) + integer :: s, c1, c2, reg + real :: dphi1, dphi2 !-----------------------------[Local parameters]-------------------------------! integer, dimension(3,3), parameter :: MAP = reshape((/ 1, 4, 5, & 4, 2, 6, & @@ -23,42 +25,60 @@ subroutine Grad_Component_No_Refresh(Flow, phi, i, phii) !==============================================================================! ! Take alias - Grid => Flow % pnt_grid + ! OpenMP doesn't unerstand Fortran's members (%), that's why ... + ! ... aliases for faces_c, grad_c2c, dx, dy and dz are needed + Grid => Flow % pnt_grid + dx => Grid % dx + dy => Grid % dy + dz => Grid % dz + grad_c2c => Flow % grad_c2c + faces_c => Grid % faces_c ! Initialize gradients phii(1:Grid % n_cells) = 0. - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + ! On the boundaries update only c1 - if not symmetry + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. SYMMETRY) then + !$omp parallel do & + !$omp private(s, c1, c2, dphi1) & + !$omp shared(faces_c, grad_c2c, dx, dy, dz, phi, phii) + do s = Faces_In_Region(reg) + c1 = faces_c(1,s) + c2 = faces_c(2,s) - dphi1 = phi(c2)-phi(c1) - dphi2 = phi(c2)-phi(c1) + dphi1 = phi(c2)-phi(c1) + + phii(c1) = phii(c1) & + + dphi1 * ( grad_c2c(MAP(i,1),c1) * dx(s) & + + grad_c2c(MAP(i,2),c1) * dy(s) & + + grad_c2c(MAP(i,3),c1) * dz(s)) + end do + !$omp end parallel do + end if ! symmetry + end do - ! On the boundaries - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then - dphi1 = 0. - end if + ! Inside the domain + !$omp parallel do & + !$omp private(s, c1, c2, dphi1, dphi2) & + !$omp shared(faces_c, grad_c2c, dx, dy, dz, phi, phii) + do s = Faces_In_Domain() + c1 = faces_c(1,s) + c2 = faces_c(2,s) - phii(c1) = phii(c1) & - + dphi1 * ( Flow % grad_c2c(MAP(i,1),c1) * Grid % dx(s) & - + Flow % grad_c2c(MAP(i,2),c1) * Grid % dy(s) & - + Flow % grad_c2c(MAP(i,3),c1) * Grid % dz(s)) - end if + dphi1 = phi(c2)-phi(c1) + dphi2 = phi(c2)-phi(c1) - ! Inside the domain - if(c2 > 0) then - phii(c1) = phii(c1) & - + dphi1 * ( Flow % grad_c2c(MAP(i,1),c1) * Grid % dx(s) & - + Flow % grad_c2c(MAP(i,2),c1) * Grid % dy(s) & - + Flow % grad_c2c(MAP(i,3),c1) * Grid % dz(s)) + phii(c1) = phii(c1) & + + dphi1 * ( grad_c2c(MAP(i,1),c1) * dx(s) & + + grad_c2c(MAP(i,2),c1) * dy(s) & + + grad_c2c(MAP(i,3),c1) * dz(s)) - phii(c2) = phii(c2) & - + dphi2 * ( Flow % grad_c2c(MAP(i,1),c2) * Grid % dx(s) & - + Flow % grad_c2c(MAP(i,2),c2) * Grid % dy(s) & - + Flow % grad_c2c(MAP(i,3),c2) * Grid % dz(s)) - end if + phii(c2) = phii(c2) & + + dphi2 * ( grad_c2c(MAP(i,1),c2) * dx(s) & + + grad_c2c(MAP(i,2),c2) * dy(s) & + + grad_c2c(MAP(i,3),c2) * dz(s)) end do + !$omp end parallel do end subroutine diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Gauss.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Gauss.f90 index 9156f7bca..87a46d5ee 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Gauss.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Gauss.f90 @@ -7,6 +7,8 @@ subroutine Grad_Gauss(Flow, phi_f, phi_x, phi_y, phi_z) ! embedded in an iterative algorithm which also updates face values. ! ! See also it's sister function Interpolate_To_Faces from this module, and ! ! its parent function Grad_Gauss_Variable, also from this module. ! +! ! +! With OpenMP, this procedure got a speedup of 3.5 on 1M mesh and 4 threads. ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! @@ -19,47 +21,76 @@ subroutine Grad_Gauss(Flow, phi_f, phi_x, phi_y, phi_z) real :: phi_z( -Flow % pnt_grid % n_bnd_cells: & Flow % pnt_grid % n_cells) !----------------------------------[Locals]------------------------------------! - type(Grid_Type), pointer :: Grid - integer :: s, c1, c2, c + type(Grid_Type), pointer :: Grid + real, contiguous, pointer :: sx(:), sy(:), sz(:), vol(:) + integer, contiguous, pointer :: faces_c(:,:) + integer :: s, c1, c2, c, reg !==============================================================================! + call Profiler % Start('Grad_Gauss') + ! Take alias - Grid => Flow % pnt_grid + ! OpenMP doesn't unerstand Fortran's members (%), that's ... + ! ... why aliases for faces_c, sx, sy, sz and vol are needed + Grid => Flow % pnt_grid + faces_c => Grid % faces_c + sx => Grid % sx + sy => Grid % sy + sz => Grid % sz + vol => Grid % vol !-----------------------------------------------! ! Update gradients from the values at faces ! !-----------------------------------------------! - do c = 1, Grid % n_cells + !$omp parallel do private(c) shared(phi_x, phi_y, phi_z) + do c = Cells_In_Domain() phi_x(c) = 0.0 phi_y(c) = 0.0 phi_z(c) = 0.0 end do + !$omp end parallel do - do s = 1, Grid % n_faces + ! Faces in boundary region first + do reg = Boundary_Regions() + !$omp parallel do & + !$omp private(s, c1) & + !$omp shared(faces_c, phi_f, phi_x, phi_y, phi_z, sx, sy, sz) + do s = Faces_In_Region(reg) + c1 = faces_c(1,s) - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + phi_x(c1) = phi_x(c1) - phi_f(s) * sx(s) + phi_y(c1) = phi_y(c1) - phi_f(s) * sy(s) + phi_z(c1) = phi_z(c1) - phi_f(s) * sz(s) + end do + !$omp end parallel do + end do - if(c2 > 0) then - phi_x(c1) = phi_x(c1) - phi_f(s) * Grid % sx(s) - phi_y(c1) = phi_y(c1) - phi_f(s) * Grid % sy(s) - phi_z(c1) = phi_z(c1) - phi_f(s) * Grid % sz(s) + ! Faces inside the domain + !$omp parallel do & + !$omp private(s, c1, c2) & + !$omp shared(faces_c, phi_f, phi_x, phi_y, phi_z, sx, sy, sz) + do s = Faces_In_Domain() + c1 = faces_c(1,s) + c2 = faces_c(2,s) - phi_x(c2) = phi_x(c2) + phi_f(s) * Grid % sx(s) - phi_y(c2) = phi_y(c2) + phi_f(s) * Grid % sy(s) - phi_z(c2) = phi_z(c2) + phi_f(s) * Grid % sz(s) - else - phi_x(c1) = phi_x(c1) - phi_f(s) * Grid % sx(s) - phi_y(c1) = phi_y(c1) - phi_f(s) * Grid % sy(s) - phi_z(c1) = phi_z(c1) - phi_f(s) * Grid % sz(s) - end if + phi_x(c1) = phi_x(c1) - phi_f(s) * sx(s) + phi_y(c1) = phi_y(c1) - phi_f(s) * sy(s) + phi_z(c1) = phi_z(c1) - phi_f(s) * sz(s) + phi_x(c2) = phi_x(c2) + phi_f(s) * sx(s) + phi_y(c2) = phi_y(c2) + phi_f(s) * sy(s) + phi_z(c2) = phi_z(c2) + phi_f(s) * sz(s) end do + !$omp end parallel do - do c = 1, Grid % n_cells - phi_x(c) = -phi_x(c) / Grid % vol(c) - phi_y(c) = -phi_y(c) / Grid % vol(c) - phi_z(c) = -phi_z(c) / Grid % vol(c) + !$omp parallel do private(c) shared(phi_x, phi_y, phi_z, vol) + do c = Cells_In_Domain() + phi_x(c) = -phi_x(c) / vol(c) + phi_y(c) = -phi_y(c) / vol(c) + phi_z(c) = -phi_z(c) / vol(c) end do + !$omp end parallel do + + call Profiler % Stop('Grad_Gauss') end subroutine diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Pressure.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Pressure.f90 index 8a8b1b0be..9b0350b62 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Pressure.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Pressure.f90 @@ -2,6 +2,8 @@ subroutine Grad_Gauss_Pressure(Flow, p) !------------------------------------------------------------------------------! ! Tries to find pressure gradients with Gaussian in an iterative fashion. ! +! ! +! With OpenMP, this procedure got a speedup of 3.5 on 1M mesh and 4 threads. ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! @@ -9,137 +11,136 @@ subroutine Grad_Gauss_Pressure(Flow, p) type(Var_Type), target :: p ! should be pressure or pressure correction !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid - integer :: s, c, c1, c2 - integer :: i_fac, c1_prim, c2_prim, s_prim - integer, contiguous, pointer :: c_at_bnd(:), c_cnt(:) + integer :: s, c, c1, c2, iter, reg + integer, contiguous, pointer :: c_computed(:), c_visited(:), faces_c(:,:) + real, contiguous, pointer :: p_x(:), p_y(:), p_z(:) !------------------------------[Local parameters]------------------------------! integer, parameter :: YES = 1 integer, parameter :: NO = YES-1 !==============================================================================! - call Work % Connect_Int_Cell(c_at_bnd, c_cnt) + call Profiler % Start('Grad_Gauss_Pressure') + + call Work % Connect_Int_Cell(c_computed, c_visited) ! Take alias - Grid => Flow % pnt_grid - - !--------------------------------------! - ! Initialization of c_at_bnd array ! - !--------------------------------------! - c_at_bnd(:) = NO - c_cnt(:) = 0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) c_at_bnd(c1) = YES - end do + ! OpenMP doesn't unerstand Fortran's members (%), that's ... + ! ... why aliases for faces_c, p_x, p_y and p_z are needed + Grid => Flow % pnt_grid + faces_c => Grid % faces_c + p_x => p % x + p_y => p % y + p_z => p % z ! Initialize with some gradients with the most robust and reliable tool ! you have at your disposal - least square cell-based method. These ! gradients should be properly calculated inside the domain. call Flow % Grad_Least_Pressure(p) - !--------------------------------------------------------------------! - ! Step 1: Extrapolate interior gradient values to boundary cells ! - ! using only values from interior cells - which are good ! - ! This step will leave the boundary cells surrounded by ! - ! other boundary cells unchanged (reset to zero, really) ! - !--------------------------------------------------------------------! - do c = 1, Grid % n_cells - - ! Cell is at the boundary, intervene here - if(c_at_bnd(c) .eq. YES) then - - ! Nullify its gradients, and the counter for cells from which you interpolate - p % x(c) = 0.0 - p % y(c) = 0.0 - p % z(c) = 0.0 - - ! Browse through this cell's faces - do i_fac = 1, Grid % cells_n_faces(c) - s_prim = Grid % cells_f(i_fac, c) - c1_prim = Grid % faces_c(1, s_prim) - c2_prim = Grid % faces_c(2, s_prim) - - ! Consider c1_prim if it is not cell at boundary - if(c_at_bnd(c1_prim) .eq. NO) then - p % x(c) = p % x(c) + p % x(c1_prim) - p % y(c) = p % y(c) + p % y(c1_prim) - p % z(c) = p % z(c) + p % z(c1_prim) - c_cnt(c) = c_cnt(c) + 1 - end if - - ! Consider c2_prim if it is not cell at boundary - ! and not a boundary cell. - if(c_at_bnd(c2_prim) .eq. NO .and. & - c2_prim .gt. 0) then - p % x(c) = p % x(c) + p % x(c2_prim) - p % y(c) = p % y(c) + p % y(c2_prim) - p % z(c) = p % z(c) + p % z(c2_prim) - c_cnt(c) = c_cnt(c) + 1 - end if - - end do - - ! Work out the average - if(c_cnt(c) .gt. 0) then - p % x(c) = p % x(c) / c_cnt(c) - p % y(c) = p % y(c) / c_cnt(c) - p % z(c) = p % z(c) / c_cnt(c) - end if - - end if ! c at bnd + !-----------------------------------------------------------------------! + ! Extrapolate interior gradient values to boundary cells using only ! + ! values which are known, either from interior cells, or cells near ! + ! boundaries computed in previous iterations. ! + !-----------------------------------------------------------------------! + ! First assume all are computed although you know the cells near the + ! bounderies are not computed well; but they will be treated below + c_computed(:) = YES + + ! Mark cells which are not computed for the 1st time + ! At this point, these are cells near the boundaries + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1, s) + c_computed(c1) = NO + end do ! faces + end do ! all boundary regions + + call Grid % Exchange_Cells_Int(c_computed) + + ! Nullify gradients for cells near boundaries + ! (where gradients are not computed properly), + ! and initialize c_visited + !$omp parallel do & + !$omp private(c) & + !$omp shared(c_computed, c_visited, p_x, p_y, p_z) + do c = Cells_In_Domain() + if(c_computed(c) .eq. NO) then ! if not computed + p_x(c) = 0.0 + p_y(c) = 0.0 + p_z(c) = 0.0 + c_visited(c) = 0 + end if end do + !$omp end parallel do + + ! It seems these are not needed + !? call Grid % Exchange_Cells_Real(p % x) + !? call Grid % Exchange_Cells_Real(p % y) + !? call Grid % Exchange_Cells_Real(p % z) + !? all Grid % Exchange_Cells_Int(c_visited) + + !------------------------------------------------! + ! Extrapolate in several iterations, as long ! + ! as there are cells which are not computed. ! + !------------------------------------------------! + do iter = 1, 3 + + ! Browse through faces to find the cells which need ... + ! ... updating, and accumulate gradients in them as well + !$omp parallel do & + !$omp private(s, c1, c2) & + !$omp shared(faces_c, c_computed, c_visited, p_x, p_y, p_z) + do s = Faces_In_Domain() + c1 = faces_c(1, s) + c2 = faces_c(2, s) + + if(c_computed(c1) .eq. NO .and. c_computed(c2) .eq. YES) then + p_x(c1) = p_x(c1) + p_x(c2) + p_y(c1) = p_y(c1) + p_y(c2) + p_z(c1) = p_z(c1) + p_z(c2) + c_visited(c1) = c_visited(c1) + 1 + end if - !-----------------------------------------------------------------------! - ! Step 2: Previous step left the cells at boundary, which are only ! - ! surrounded by other cells at boundary, untreated. Here, ! - ! you are less selective and extrapolate even from cells at ! - ! boundaries, which were interpolated in the Step 1 above. ! - !-----------------------------------------------------------------------! - do c = 1, Grid % n_cells - - ! Cell is at the boundary, and hasn'p been treated yet - if(c_at_bnd(c) .eq. YES .and. c_cnt(c) .eq. 0) then - - ! Browse through this cell's faces - do i_fac = 1, Grid % cells_n_faces(c) - s_prim = Grid % cells_f(i_fac, c) - c1_prim = Grid % faces_c(1, s_prim) - c2_prim = Grid % faces_c(2, s_prim) - - if(c1_prim .ne. c .and. & ! skip your own self - c_cnt(c1_prim) .gt. 0) then ! consider only cells with values - p % x(c) = p % x(c) + p % x(c1_prim) - p % y(c) = p % y(c) + p % y(c1_prim) - p % z(c) = p % z(c) + p % z(c1_prim) - c_cnt(c) = c_cnt(c) + 1 - end if - - if(c2_prim .ne. c .and. & ! skip your own self - c2_prim .gt. 0 .and. & ! consider only cells with values - c_cnt(c2_prim) .gt. 0) then ! don'p use boundary cells - p % x(c) = p % x(c) + p % x(c2_prim) - p % y(c) = p % y(c) + p % y(c2_prim) - p % z(c) = p % z(c) + p % z(c2_prim) - c_cnt(c) = c_cnt(c) + 1 - end if - - end do - - if(c_cnt(c) .gt. 0) then - p % x(c) = p % x(c) / c_cnt(c) - p % y(c) = p % y(c) / c_cnt(c) - p % z(c) = p % z(c) / c_cnt(c) + if(c_computed(c2) .eq. NO .and. c_computed(c1) .eq. YES) then + p_x(c2) = p_x(c2) + p_x(c1) + p_y(c2) = p_y(c2) + p_y(c1) + p_z(c2) = p_z(c2) + p_z(c1) + c_visited(c2) = c_visited(c2) + 1 end if + end do + !$omp end parallel do + + ! It seems this is not needed + !? call Grid % Exchange_Cells_Int(c_visited) + + ! Browse throough cells, and calculate final values ... + ! ... of gradients in the cells which have been visited + !$omp parallel do & + !$omp private(c) & + !$omp shared(c_computed, c_visited, p_x, p_y, p_z) + do c = Cells_In_Domain() + if(c_visited(c) > 0) then + p_x(c) = p_x(c) / c_visited(c) + p_y(c) = p_y(c) / c_visited(c) + p_z(c) = p_z(c) / c_visited(c) + c_visited(c) = 0 + c_computed(c) = YES ! mark it as computed for the next iteration + end if + end do + !$omp end parallel do - end if ! c at bnd + call Grid % Exchange_Cells_Real(p % x) + call Grid % Exchange_Cells_Real(p % y) + call Grid % Exchange_Cells_Real(p % z) - end do + end do ! iter ! Perform Gauss from gradients which are good inside obtained above call Flow % Grad_Gauss_Variable(p) - call Work % Disconnect_Int_Cell(c_at_bnd, c_cnt) + call Work % Disconnect_Int_Cell(c_computed, c_visited) + + call Profiler % Stop('Grad_Gauss_Pressure') end subroutine diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Variable.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Variable.f90 index ace7574fb..532488d5d 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Variable.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Gauss_Variable.f90 @@ -5,6 +5,9 @@ subroutine Grad_Gauss_Variable(Flow, phi) ! really bad for tetrahedral grids with no initial values of gradients, and ! ! a more elaborate approach is therefore needed, which will probably be in ! ! Grad_Gauss_Pressure, when introduced. +! ! +! With OpenMP, this procedure got a speedup of 1.6 on 1M mesh and 4 threads. ! +! I reckon there is not so much potential for improving this, few loops. ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! @@ -12,7 +15,7 @@ subroutine Grad_Gauss_Variable(Flow, phi) type(Var_Type), target :: phi !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid - integer :: s, c, c1, c2, iter + integer :: s, iter real :: res, norm real, contiguous, pointer :: phi_f_n(:), phi_f_o(:) !==============================================================================! @@ -28,18 +31,13 @@ subroutine Grad_Gauss_Variable(Flow, phi) phi_f_o(:) = 0.0 norm = max(maxval(phi % n) - minval(phi % n), MICRO) - call Comm_Mod_Global_Max_Real(norm) + call Global % Max_Real(norm) !-------------------------------! ! Start iterative procedure ! !-------------------------------! do iter = 1, Flow % gauss_miter - ! Save the old iteration (phi_f_o(:) = phi_f_n(:) doesn't work for Intel) - do s = 1, Grid % n_faces - phi_f_o(s) = phi_f_n(s) - end do - ! Estimate values at faces from the ! values in cells and last gradients call Flow % Interpolate_To_Faces_Linear(phi_f_n, phi % n, & @@ -48,9 +46,18 @@ subroutine Grad_Gauss_Variable(Flow, phi) ! Update gradients from the values at faces call Flow % Grad_Gauss(phi_f_n, phi % x, phi % y, phi % z) - ! Take the difference between two iterations - res = maxval(abs(phi_f_n(:)-phi_f_o(:))) / norm - call Comm_Mod_Global_Max_Real(res) + ! Take the difference between two iterations to find residual + ! and copy the new value to the old value along the way + res = 0.0 + !$omp parallel do private(s) shared(phi_f_n, phi_f_o) reduction(max : res) + do s = 1, Grid % n_faces + res = max(res, abs(phi_f_n(s) - phi_f_o(s))) + phi_f_o(s) = phi_f_n(s) + end do + !$omp end parallel do + + res = res / norm + call Global % Max_Real(res) if(res < Flow % gauss_tol) exit diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Least_Pressure.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Least_Pressure.f90 index 96c21f13c..f56a95b49 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Least_Pressure.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Least_Pressure.f90 @@ -9,7 +9,7 @@ subroutine Grad_Least_Pressure(Flow, p) type(Var_Type) :: p !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid - integer :: s, c1, c2, iter + integer :: s, c1, c2, iter, reg !==============================================================================! ! Take aliases @@ -21,17 +21,18 @@ subroutine Grad_Least_Pressure(Flow, p) do iter = 1, Flow % least_miter ! Extrapolation to boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .ne. PRESSURE) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. PRESSURE) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + p % n(c2) = p % n(c1) + p % x(c1) * Grid % dx(s) & + p % y(c1) * Grid % dy(s) & + p % z(c1) * Grid % dz(s) - end if - end if - end do + end do ! faces + end if ! boundary not pressure + end do ! regions ! Compute individual gradients without refreshing buffers call Flow % Grad_Component_No_Refresh(p % n, 1, p % x) ! dp/dx diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Least_Variable.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Least_Variable.f90 index 7aa2c6e67..05925541c 100644 --- a/Sources/Process/Field_Mod/Gradients/Grad_Least_Variable.f90 +++ b/Sources/Process/Field_Mod/Gradients/Grad_Least_Variable.f90 @@ -2,6 +2,16 @@ subroutine Grad_Least_Variable(Flow, var) !------------------------------------------------------------------------------! ! Calculates gradient of a variable from field Flow with least squares ! +! ! +! With OpenMP, this procedure got a speedup of 3.2 on 1M mesh and 4 threads. ! +! Yet, in the tests, it was called only to initialize Gaussian methods and ! +! the measuring times where therefore short. The numbers may be innacurate. ! +! It should be tested on a case with least squares only. ! +! ! +! On a case with least squares only, speed-up was 3.3, still not whopping. ! +! ! +! But, the new version, the one which call all three components at once, ! +! showed a speed-up of 3.7 on 1M mesh and 4 threads, which is good. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -19,10 +29,14 @@ subroutine Grad_Least_Variable(Flow, var) ! Refresh buffers for variable call Grid % Exchange_Cells_Real(var % n) - ! Compute individual gradients without refreshing buffers - call Flow % Grad_Component_No_Refresh(var % n, 1, var % x) ! dp/dx - call Flow % Grad_Component_No_Refresh(var % n, 2, var % y) ! dp/dy - call Flow % Grad_Component_No_Refresh(var % n, 3, var % z) ! dp/dz + ! Old: Compute individual gradients without refreshing buffers + ! call Flow % Grad_Component_No_Refresh(var % n, 1, var % x) ! dp/dx + ! call Flow % Grad_Component_No_Refresh(var % n, 2, var % y) ! dp/dy + ! call Flow % Grad_Component_No_Refresh(var % n, 3, var % z) ! dp/dz + + ! New: Compute all gradient components without refreshing buffers + call Flow % Grad_Three_Components_No_Refresh(var % n, & + var % x, var % y, var % z) ! Refresh buffers for gradient components call Grid % Exchange_Cells_Real(var % x) diff --git a/Sources/Process/Field_Mod/Gradients/Grad_Three_Components_No_Refresh.f90 b/Sources/Process/Field_Mod/Gradients/Grad_Three_Components_No_Refresh.f90 new file mode 100644 index 000000000..f24939e0c --- /dev/null +++ b/Sources/Process/Field_Mod/Gradients/Grad_Three_Components_No_Refresh.f90 @@ -0,0 +1,113 @@ +!==============================================================================! + subroutine Grad_Three_Components_No_Refresh(Flow, phi, phi_x, phi_y, phi_z) +!------------------------------------------------------------------------------! +! Calculates gradient of generic variable phi by a least squares method, ! +! without refershing the buffers. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Field_Type), target :: Flow + real, intent(in) :: phi ( -Flow % pnt_grid % n_bnd_cells & + :Flow % pnt_grid % n_cells) + real, intent(out) :: phi_x( -Flow % pnt_grid % n_bnd_cells & + :Flow % pnt_grid % n_cells) + real, intent(out) :: phi_y( -Flow % pnt_grid % n_bnd_cells & + :Flow % pnt_grid % n_cells) + real, intent(out) :: phi_z( -Flow % pnt_grid % n_bnd_cells & + :Flow % pnt_grid % n_cells) +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + real, contiguous, pointer :: dx(:), dy(:), dz(:), grad_c2c(:,:) + integer, contiguous, pointer :: faces_c(:,:) + integer :: s, c1, c2, reg + real :: dphi1, dphi2 +!-----------------------------[Local parameters]-------------------------------! + integer, dimension(3,3), parameter :: MAP = reshape((/ 1, 4, 5, & + 4, 2, 6, & + 5, 6, 3 /), shape(MAP)) +!==============================================================================! + + ! Take alias + ! OpenMP doesn't unerstand Fortran's members (%), that's why ... + ! ... aliases for faces_c, grad_c2c, dx, dy and dz are needed + Grid => Flow % pnt_grid + dx => Grid % dx + dy => Grid % dy + dz => Grid % dz + grad_c2c => Flow % grad_c2c + faces_c => Grid % faces_c + + ! Initialize gradients + phi_x(1:Grid % n_cells) = 0. + phi_y(1:Grid % n_cells) = 0. + phi_z(1:Grid % n_cells) = 0. + + ! On the boundaries update only c1 - if not symmetry + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. SYMMETRY) then + !$omp parallel do & + !$omp private(s, c1, c2, dphi1) & + !$omp shared(faces_c, grad_c2c, dx, dy, dz, phi, phi_x, phi_y, phi_z) + do s = Faces_In_Region(reg) + c1 = faces_c(1,s) + c2 = faces_c(2,s) + + dphi1 = phi(c2)-phi(c1) + + phi_x(c1) = phi_x(c1) & + + dphi1 * ( grad_c2c(MAP(1,1),c1) * dx(s) & + + grad_c2c(MAP(1,2),c1) * dy(s) & + + grad_c2c(MAP(1,3),c1) * dz(s)) + phi_y(c1) = phi_y(c1) & + + dphi1 * ( grad_c2c(MAP(2,1),c1) * dx(s) & + + grad_c2c(MAP(2,2),c1) * dy(s) & + + grad_c2c(MAP(2,3),c1) * dz(s)) + phi_z(c1) = phi_z(c1) & + + dphi1 * ( grad_c2c(MAP(3,1),c1) * dx(s) & + + grad_c2c(MAP(3,2),c1) * dy(s) & + + grad_c2c(MAP(3,3),c1) * dz(s)) + end do + !$omp end parallel do + end if ! symmetry + end do + + ! Inside the domain + !$omp parallel do & + !$omp private(s, c1, c2, dphi1, dphi2) & + !$omp shared(faces_c, grad_c2c, dx, dy, dz, phi, phi_x, phi_y, phi_z) + do s = Faces_In_Domain() + c1 = faces_c(1,s) + c2 = faces_c(2,s) + + dphi1 = phi(c2)-phi(c1) + dphi2 = phi(c2)-phi(c1) + + phi_x(c1) = phi_x(c1) & + + dphi1 * ( grad_c2c(MAP(1,1),c1) * dx(s) & + + grad_c2c(MAP(1,2),c1) * dy(s) & + + grad_c2c(MAP(1,3),c1) * dz(s)) + phi_y(c1) = phi_y(c1) & + + dphi1 * ( grad_c2c(MAP(2,1),c1) * dx(s) & + + grad_c2c(MAP(2,2),c1) * dy(s) & + + grad_c2c(MAP(2,3),c1) * dz(s)) + phi_z(c1) = phi_z(c1) & + + dphi1 * ( grad_c2c(MAP(3,1),c1) * dx(s) & + + grad_c2c(MAP(3,2),c1) * dy(s) & + + grad_c2c(MAP(3,3),c1) * dz(s)) + + phi_x(c2) = phi_x(c2) & + + dphi2 * ( grad_c2c(MAP(1,1),c2) * dx(s) & + + grad_c2c(MAP(1,2),c2) * dy(s) & + + grad_c2c(MAP(1,3),c2) * dz(s)) + phi_y(c2) = phi_y(c2) & + + dphi2 * ( grad_c2c(MAP(2,1),c2) * dx(s) & + + grad_c2c(MAP(2,2),c2) * dy(s) & + + grad_c2c(MAP(2,3),c2) * dz(s)) + phi_z(c2) = phi_z(c2) & + + dphi2 * ( grad_c2c(MAP(3,1),c2) * dx(s) & + + grad_c2c(MAP(3,2),c2) * dy(s) & + + grad_c2c(MAP(3,3),c2) * dz(s)) + end do + !$omp end parallel do + + end subroutine diff --git a/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Harmonic.f90 b/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Harmonic.f90 index 4fee9c71b..64ead6137 100644 --- a/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Harmonic.f90 +++ b/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Harmonic.f90 @@ -12,7 +12,7 @@ subroutine Interpolate_To_Faces_Harmonic(Flow, phi_f, phi_c) Flow % pnt_grid % n_cells) !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid - integer :: s, c1, c2 + integer :: s, c1, c2, reg !==============================================================================! ! Take alias @@ -20,18 +20,22 @@ subroutine Interpolate_To_Faces_Harmonic(Flow, phi_f, phi_c) ! Refresh buffers for gradient components was here, but it is not needed - ! Perform harmonic average on all faces - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1, s) - c2 = Grid % faces_c(2, s) - - if(c2 > 0) then - phi_f(s) = Math % Harmonic_Mean(phi_c(c1), phi_c(c2)) - else + ! Perform harmonic average for boundary faces + ! (Why doesn't it take care of boundary conditions? - check this!) + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) phi_f(s) = phi_c(c1) - end if + end do + end do + + ! Perform harmonic average for inside faces + do s = Faces_In_Domain() + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - phi_f(s) = phi_f(s) + phi_f(s) = Math % Harmonic_Mean(phi_c(c1), phi_c(c2)) end do end subroutine diff --git a/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Linear.f90 b/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Linear.f90 index 225d61567..43fce98e6 100644 --- a/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Linear.f90 +++ b/Sources/Process/Field_Mod/Interpolations/Interpolate_To_Faces_Linear.f90 @@ -8,6 +8,8 @@ subroutine Interpolate_To_Faces_Linear(Flow, phi_f, phi_c, & ! was intended to be ebmedded in an iterative algorithm for gradient calcu- ! ! lation by Gaussian theorem. See also it's sister function Grad_Gauss and ! ! parent function Grad_Gauss_Variable from this module. ! +! ! +! With OpenMP, this procedure got a speedup of 2.6 on 1M mesh and 4 threads. ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! @@ -22,12 +24,30 @@ subroutine Interpolate_To_Faces_Linear(Flow, phi_f, phi_c, & real, optional :: phi_z( -Flow % pnt_grid % n_bnd_cells: & Flow % pnt_grid % n_cells) !----------------------------------[Locals]------------------------------------! - type(Grid_Type), pointer :: Grid - integer :: s, c1, c2 + type(Grid_Type), pointer :: Grid + real, contiguous, pointer :: xf(:), yf(:), zf(:), xc(:), yc(:), zc(:) + real, contiguous, pointer :: rx(:), ry(:), rz(:), f(:) + integer, contiguous, pointer :: faces_c(:,:) + integer :: s, c1, c2, reg !==============================================================================! + call Profiler % Start('Interpolate_To_Faces_Linear') + ! Take alias - Grid => Flow % pnt_grid + ! OpenMP doesn't unerstand Fortran's members (%), that's why ... + ! ... aliases for faces_c, xf, yf, zf, xc ... and rz are needed + Grid => Flow % pnt_grid + faces_c => Grid % faces_c + f => Grid % f + xf => Grid % xf + yf => Grid % yf + zf => Grid % zf + xc => Grid % xc + yc => Grid % yc + zc => Grid % zc + rx => Grid % rx + ry => Grid % ry + rz => Grid % rz ! Refresh buffers for gradient components (needed) call Grid % Exchange_Cells_Real(phi_c) @@ -37,56 +57,73 @@ subroutine Interpolate_To_Faces_Linear(Flow, phi_f, phi_c, & !-------------------------------------------------------! ! Estimate values at faces from the values in cells ! - !------------------------------------------------------! - do s = 1, Grid % n_faces - - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Inside - if(c2 > 0) then - phi_f(s) = Grid % f(s) * phi_c(c1) & - + (1.0 - Grid % f(s)) * phi_c(c2) + !-------------------------------------------------------! - ! On the boundary cells - else + ! Perform linear average for boundary faces + ! (Why doesn't it take care of boundary conditions? - check this!) + do reg = Boundary_Regions() + !$omp parallel do & + !$omp private(s, c1) & + !$omp shared(faces_c, phi_f, phi_c) + do s = Faces_In_Region(reg) + c1 = faces_c(1,s) phi_f(s) = phi_c(c1) + end do + !$omp end parallel do + end do - end if + ! Perform linear average for inside faces + !$omp parallel do & + !$omp private(s, c1, c2) & + !$omp shared(faces_c, phi_f, f, phi_c) + do s = Faces_In_Domain() + c1 = faces_c(1,s) + c2 = faces_c(2,s) + phi_f(s) = f(s) * phi_c(c1) + (1.0 - f(s)) * phi_c(c2) end do + !$omp end parallel do !-----------------------------------------------------! ! If gradients present, improve the interpolation ! !-----------------------------------------------------! if(present(phi_x)) then - do s = 1, Grid % n_faces + do reg = Boundary_Regions() + !$omp parallel do & + !$omp private(s, c1) & + !$omp shared(faces_c, phi_f, phi_x, phi_y, phi_z, xf, yf, zf, xc, yc, zc) + do s = Faces_In_Region(reg) + c1 = faces_c(1,s) + phi_f(s) = phi_f(s) & + + phi_x(c1) * (xf(s) - xc(c1)) & + + phi_y(c1) * (yf(s) - yc(c1)) & + + phi_z(c1) * (zf(s) - zc(c1)) + end do ! faces + !$omp end parallel do + end do ! all boundary regions - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Inside - if(c2 > 0) then - phi_f(s) = phi_f(s) & - + Grid % f(s) & - * ( phi_x(c1) * Grid % rx(s) & - + phi_y(c1) * Grid % ry(s) & - + phi_z(c1) * Grid % rz(s) ) & - + (1.0 - Grid % f(s)) & - * ( phi_x(c2) * Grid % rx(s) & - + phi_y(c2) * Grid % ry(s) & - + phi_z(c2) * Grid % rz(s) ) - ! On the boundary cells - else - phi_f(s) = phi_f(s) & - + phi_x(c1) * (Grid % xf(s) - Grid % xc(c1)) & - + phi_y(c1) * (Grid % yf(s) - Grid % yc(c1)) & - + phi_z(c1) * (Grid % zf(s) - Grid % zc(c1)) - end if + !$omp parallel do & + !$omp private(s, c1, c2) & + !$omp shared(faces_c, phi_f, f, phi_x, phi_y, phi_z, rx, ry, rz) + do s = Faces_In_Domain() + c1 = faces_c(1,s) + c2 = faces_c(2,s) + phi_f(s) = phi_f(s) & + + f(s) & + * ( phi_x(c1) * rx(s) & + + phi_y(c1) * ry(s) & + + phi_z(c1) * rz(s) ) & + + (1.0 - f(s)) & + * ( phi_x(c2) * rx(s) & + + phi_y(c2) * ry(s) & + + phi_z(c2) * rz(s) ) end do + !$omp end parallel do + + end if ! gradients are present - end if + call Profiler % Stop('Interpolate_To_Faces_Linear') end subroutine diff --git a/Sources/Process/Field_Mod/Utilities/Buoyancy_Forces.f90 b/Sources/Process/Field_Mod/Utilities/Buoyancy_Forces.f90 index ded1bd55d..4913ffe1c 100644 --- a/Sources/Process/Field_Mod/Utilities/Buoyancy_Forces.f90 +++ b/Sources/Process/Field_Mod/Utilities/Buoyancy_Forces.f90 @@ -131,7 +131,7 @@ subroutine Buoyancy_Forces(Flow, i) !---------------------------------------! ! Correct the units for body forces ! !---------------------------------------! - do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells + do c = Cells_In_Domain() cell_fi(c) = cell_fi(c) / Grid % vol(c) end do diff --git a/Sources/Process/Field_Mod/Utilities/Calculate_Bulk_Fluxes.f90 b/Sources/Process/Field_Mod/Utilities/Calculate_Bulk_Fluxes.f90 new file mode 100644 index 000000000..e485a072d --- /dev/null +++ b/Sources/Process/Field_Mod/Utilities/Calculate_Bulk_Fluxes.f90 @@ -0,0 +1,85 @@ +!==============================================================================! + subroutine Calculate_Bulk_Fluxes(Flow, v_flux) +!------------------------------------------------------------------------------! +! Calculate volume fluxes through whole domain. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Field_Type), target :: Flow + real, dimension(:) :: v_flux ! volume flux +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + type(Bulk_Type), pointer :: bulk + integer :: c1, c2, s + real :: xc1, yc1, zc1, xc2, yc2, zc2, wgt +!==============================================================================! + + ! Take some aliases + Grid => Flow % pnt_grid + bulk => Flow % bulk + + bulk % flux_x = 0.0 + bulk % flux_y = 0.0 + bulk % flux_z = 0.0 + + !---------------------------------------------------------------------------! + ! Summ up volume mass fluxes [m^3/s] over all faces at monitoring plane ! + !---------------------------------------------------------------------------! + do s = Faces_In_Domain() + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + xc1 = Grid % xc(c1) + yc1 = Grid % yc(c1) + zc1 = Grid % zc(c1) + xc2 = Grid % xc(c1) + Grid % dx(s) + yc2 = Grid % yc(c1) + Grid % dy(s) + zc2 = Grid % zc(c1) + Grid % dz(s) + + ! If the flux is across a buffer face, it is summed up twice. + ! The variable "wgt" is here to take care of that. + wgt = 1.0 + if(Grid % Comm % cell_proc(c2) .ne. This_Proc()) wgt = 0.5 + + !-------! + ! X ! + !-------! + if((xc1 <= bulk % xp).and.(xc2 > bulk % xp)) then + bulk % flux_x = bulk % flux_x + wgt * v_flux(s) + end if + if((xc2 < bulk % xp).and.(xc1 >= bulk % xp)) then + bulk % flux_x = bulk % flux_x - wgt * v_flux(s) + end if + + !-------! + ! Y ! + !-------! + if((yc1 <= bulk % yp).and.(yc2 > bulk % yp)) then + bulk % flux_y = bulk % flux_y + wgt * v_flux(s) + end if + if((yc2 < bulk % yp).and.(yc1 >= bulk % yp)) then + bulk % flux_y = bulk % flux_y - wgt * v_flux(s) + end if + + !-------! + ! Z ! + !-------! + if((zc1 <= bulk % zp).and.(zc2 > bulk % zp)) then + bulk % flux_z = bulk % flux_z + wgt * v_flux(s) + end if + if((zc2 < bulk % zp).and.(zc1 >= bulk % zp)) then + bulk % flux_z = bulk % flux_z - wgt * v_flux(s) + end if + + end do + + call Global % Sum_Real(bulk % flux_x) + call Global % Sum_Real(bulk % flux_y) + call Global % Sum_Real(bulk % flux_z) + + ! Bulk velocities. Units: [kg/s] / [kg/m^3] / [m^2] = [m/s] + bulk % u = bulk % flux_x / (bulk % area_x + TINY) + bulk % v = bulk % flux_y / (bulk % area_y + TINY) + bulk % w = bulk % flux_z / (bulk % area_z + TINY) + + end subroutine diff --git a/Sources/Process/Field_Mod/Utilities/Calculate_Fluxes.f90 b/Sources/Process/Field_Mod/Utilities/Calculate_Fluxes.f90 deleted file mode 100644 index 3e74f942d..000000000 --- a/Sources/Process/Field_Mod/Utilities/Calculate_Fluxes.f90 +++ /dev/null @@ -1,115 +0,0 @@ -!==============================================================================! - subroutine Calculate_Fluxes(Flow, v_flux) -!------------------------------------------------------------------------------! -! Calculate mass fluxes through whole domain. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Field_Type), target :: Flow - real, dimension(:) :: v_flux ! volume flux -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - type(Bulk_Type), pointer :: bulk - integer :: c1, c2, s - real :: xc1, yc1, zc1, xc2, yc2, zc2, wgt - real :: dens_f - real :: dens_are_x, dens_are_y, dens_are_z ! [kg/m] - real :: dens_avg_x, dens_avg_y, dens_avg_z ! [kg/m^3] -!==============================================================================! - - ! Take some aliases - Grid => Flow % pnt_grid - bulk => Flow % bulk - - bulk % flux_x = 0.0 - bulk % flux_y = 0.0 - bulk % flux_z = 0.0 - - dens_are_x = 0.0 - dens_are_y = 0.0 - dens_are_z = 0.0 - - !-------------------------------------------------------------------------! - ! Summ up mass fluxes [kg/s] over all faces at monitoring plane ! - ! (Resulting mass flux will be for the whole domain, still in [kg/s]) ! - ! In addition, sum up face densities time faca areas [kg/m] ! - !-------------------------------------------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Density at the face - dens_f = Flow % density(c1) * Grid % fw(s) & - + Flow % density(c2) * (1.0 - Grid % fw(s)) - - if(Grid % Comm % cell_proc(c1) .eq. this_proc) then - - xc1 = Grid % xc(c1) - yc1 = Grid % yc(c1) - zc1 = Grid % zc(c1) - xc2 = Grid % xc(c1) + Grid % dx(s) - yc2 = Grid % yc(c1) + Grid % dy(s) - zc2 = Grid % zc(c1) + Grid % dz(s) - - ! If the flux is across a buffer face, it is summed up twice. - ! The variable "wgt" is here to take care of that. - wgt = 1.0 - if(c2 > Grid % n_cells - Grid % Comm % n_buff_cells) wgt = 0.5 - - !-------! - ! X ! - !-------! - if((xc1 <= bulk % xp).and.(xc2 > bulk % xp)) then - bulk % flux_x = bulk % flux_x + wgt * v_flux(s) * dens_f - dens_are_x = dens_are_x + wgt * dens_f * abs(Grid % sx(s)) - end if - if((xc2 < bulk % xp).and.(xc1 >= bulk % xp)) then - bulk % flux_x = bulk % flux_x - wgt * v_flux(s) * dens_f - dens_are_x = dens_are_x + wgt * dens_f * abs(Grid % sx(s)) - end if - - !-------! - ! Y ! - !-------! - if((yc1 <= bulk % yp).and.(yc2 > bulk % yp)) then - bulk % flux_y = bulk % flux_y + wgt * v_flux(s) * dens_f - dens_are_y = dens_are_y + wgt * dens_f * abs(Grid % sy(s)) - end if - if((yc2 < bulk % yp).and.(yc1 >= bulk % yp)) then - bulk % flux_y = bulk % flux_y - wgt * v_flux(s) * dens_f - dens_are_y = dens_are_y + wgt * dens_f * abs(Grid % sy(s)) - end if - - !-------! - ! Z ! - !-------! - if((zc1 <= bulk % zp).and.(zc2 > bulk % zp)) then - bulk % flux_z = bulk % flux_z + wgt * v_flux(s) * dens_f - dens_are_z = dens_are_z + wgt * dens_f * abs(Grid % sz(s)) - end if - if((zc2 < bulk % zp).and.(zc1 >= bulk % zp)) then - bulk % flux_z = bulk % flux_z - wgt * v_flux(s) * dens_f - dens_are_z = dens_are_z + wgt * dens_f * abs(Grid % sz(s)) - end if - - end if - end do - - ! Calculate average densities in three characterstic planes - call Comm_Mod_Global_Sum_Real(dens_are_x) - call Comm_Mod_Global_Sum_Real(dens_are_y) - call Comm_Mod_Global_Sum_Real(dens_are_z) - dens_avg_x = dens_are_x / (bulk % area_x + NANO) - dens_avg_y = dens_are_y / (bulk % area_y + NANO) - dens_avg_z = dens_are_z / (bulk % area_z + NANO) - - call Comm_Mod_Global_Sum_Real(bulk % flux_x) - call Comm_Mod_Global_Sum_Real(bulk % flux_y) - call Comm_Mod_Global_Sum_Real(bulk % flux_z) - - ! Bulk velocities. Units: [kg/s] / [kg/m^3] / [m^2] = [m/s] - bulk % u = bulk % flux_x / (dens_avg_x * bulk % area_x + TINY) - bulk % v = bulk % flux_y / (dens_avg_y * bulk % area_y + TINY) - bulk % w = bulk % flux_z / (dens_avg_z * bulk % area_z + TINY) - - end subroutine diff --git a/Sources/Process/Field_Mod/Utilities/Compute_Wall_Distance.f90 b/Sources/Process/Field_Mod/Utilities/Compute_Wall_Distance.f90 index 21e6cfdd2..941026bf8 100644 --- a/Sources/Process/Field_Mod/Utilities/Compute_Wall_Distance.f90 +++ b/Sources/Process/Field_Mod/Utilities/Compute_Wall_Distance.f90 @@ -15,7 +15,6 @@ subroutine Compute_Wall_Distance(Flow, Sol) integer :: s, c, c1, c2, n real :: f_ex, f_im real :: phi_x_f, phi_y_f, phi_z_f - real :: vol_in_real, vol_in_fake, dist_min real, contiguous, pointer :: cross(:) !------------------------------[Local parameters]------------------------------! integer, parameter :: NDT = 24 ! number of false time steps @@ -38,7 +37,7 @@ subroutine Compute_Wall_Distance(Flow, Sol) call Work % Connect_Real_Cell(cross) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # Computing wall distance ...' print '(a,i3,a)', ' # ... with ', NDT, ' fake time steps.' print '(a)', ' # This might take a while, please wait' @@ -201,7 +200,7 @@ subroutine Compute_Wall_Distance(Flow, Sol) phi % tol, & phi % res) - if(this_proc < 2) then + if(First_Proc()) then print '(a,i4,a,e12.4)', ' # Computed wall distance in ', phi % eniter, & ' iterations with residual: ', phi % res end if diff --git a/Sources/Process/Field_Mod/Utilities/Potential_Initialization.f90 b/Sources/Process/Field_Mod/Utilities/Potential_Initialization.f90 index 303e4d326..2a45995d9 100644 --- a/Sources/Process/Field_Mod/Utilities/Potential_Initialization.f90 +++ b/Sources/Process/Field_Mod/Utilities/Potential_Initialization.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Potential_Initialization(Flow, Sol) + subroutine Potential_Initialisation(Flow, Sol) !------------------------------------------------------------------------------! ! Initializes velocity from potential (pressure-like) equation ! !------------------------------------------------------------------------------! @@ -23,9 +23,11 @@ subroutine Potential_Initialization(Flow, Sol) real, parameter :: DT = 1.0e+6 ! false time step !==============================================================================! + call Profiler % Start('Potential_Initialization') + call Work % Connect_Real_Cell(log_dist, cross) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # Computing potential to initialize velocity field ...' print '(a,i3,a)', ' # ... with ', NDT, ' fake time steps.' print '(a)', ' # This might take a while, please wait' @@ -209,6 +211,9 @@ subroutine Potential_Initialization(Flow, Sol) ! ! !---------------------------------! + call Profiler % Start(String % First_Upper(phi % solver) // & + ' (solver for potential initialization)') + ! Call linear solver to solve the equations call Sol % Run(phi % solver, & phi % prec, & @@ -221,7 +226,10 @@ subroutine Potential_Initialization(Flow, Sol) phi % tol, & phi % res) - if(this_proc < 2) then + call Profiler % Stop(String % First_Upper(phi % solver) // & + ' (solver for potential initialization)') + + if(First_Proc()) then print '(a,i4,a,e12.4)', ' # Computed potential in ', phi % eniter, & ' iterations with residual: ', phi % res end if @@ -260,7 +268,7 @@ subroutine Potential_Initialization(Flow, Sol) log_dist(c) = Grid % wall_dist(c) end do dist_min = minval(log_dist(1:Grid % n_cells)) - call Comm_Mod_Global_Min_Real(dist_min) + call Global % Min_Real(dist_min) !------------------------------------------------------! ! Set distances from the wall to friendlier values ! @@ -298,17 +306,17 @@ subroutine Potential_Initialization(Flow, Sol) c2 = Grid % faces_c(2,s) if(c2 < 0) then if(Grid % Bnd_Cond_Type( c2) .eq. INFLOW) then - vol_in_real = vol_in_real + ( u % n(c2)*Grid % sx(s) & - + v % n(c2)*Grid % sy(s) & - + w % n(c2)*Grid % sz(s) ) - vol_in_fake = vol_in_fake + ( u % n(c1)*Grid % sx(s) & - + v % n(c1)*Grid % sy(s) & - + w % n(c1)*Grid % sz(s) ) + vol_in_real = vol_in_real + ( u % n(c2) * Grid % sx(s) & + + v % n(c2) * Grid % sy(s) & + + w % n(c2) * Grid % sz(s) ) + vol_in_fake = vol_in_fake + ( u % n(c1) * Grid % sx(s) & + + v % n(c1) * Grid % sy(s) & + + w % n(c1) * Grid % sz(s) ) end if end if end do - call Comm_Mod_Global_Sum_Real(vol_in_real) - call Comm_Mod_Global_Sum_Real(vol_in_fake) + call Global % Sum_Real(vol_in_real) + call Global % Sum_Real(vol_in_fake) !-------------------------------------------------! ! Correct velocities to more realistic values ! @@ -327,4 +335,6 @@ subroutine Potential_Initialization(Flow, Sol) call Work % Disconnect_Real_Cell(log_dist, cross) + call Profiler % Stop('Potential_Initialization') + end subroutine diff --git a/Sources/Process/Field_Mod/Utilities/Prandtl_Numb.f90 b/Sources/Process/Field_Mod/Utilities/Prandtl_Numb.f90 index 825219be7..4b5fefa23 100644 --- a/Sources/Process/Field_Mod/Utilities/Prandtl_Numb.f90 +++ b/Sources/Process/Field_Mod/Utilities/Prandtl_Numb.f90 @@ -1,12 +1,12 @@ !==============================================================================! - real function Prandtl_Numb(Flow, c) + pure real function Prandtl_Numb(Flow, c) !------------------------------------------------------------------------------! ! Computes laminar Prandtl number for cell "c" ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Field_Type), target :: Flow - integer :: c + class(Field_Type), intent(in) :: Flow + integer, intent(in) :: c !==============================================================================! Prandtl_Numb = Flow % viscosity(c) * Flow % capacity(c) & diff --git a/Sources/Process/Field_Mod/Utilities/Report_Volume_Balance.f90 b/Sources/Process/Field_Mod/Utilities/Report_Vol_Balance.f90 similarity index 74% rename from Sources/Process/Field_Mod/Utilities/Report_Volume_Balance.f90 rename to Sources/Process/Field_Mod/Utilities/Report_Vol_Balance.f90 index 0e839b8bf..1f752d91f 100644 --- a/Sources/Process/Field_Mod/Utilities/Report_Volume_Balance.f90 +++ b/Sources/Process/Field_Mod/Utilities/Report_Vol_Balance.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Report_Volume_Balance(Flow, Sol, curr_dt, ini) + subroutine Report_Vol_Balance(Flow, Sol, ini) !------------------------------------------------------------------------------! ! Opens file for volume balance reporting. !------------------------------------------------------------------------------! @@ -7,14 +7,14 @@ subroutine Report_Volume_Balance(Flow, Sol, curr_dt, ini) !---------------------------------[Arguments]----------------------------------! class(Field_Type), target :: Flow type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt, ini + integer, intent(in) :: ini !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid real, contiguous, pointer :: b(:) real :: src !==============================================================================! - if(Flow % report_vol_balance) then + if(Flow % rep_vol_balance) then ! Take aliases Grid => Flow % pnt_grid @@ -22,18 +22,18 @@ subroutine Report_Volume_Balance(Flow, Sol, curr_dt, ini) ! Compute global volume imbalance src = sum(b(1:Grid % n_cells - Grid % Comm % n_buff_cells)) - call Comm_Mod_Global_Sum_Real(src) + call Global % Sum_Real(src) ! Print it out - if(this_proc < 2) then + if(First_Proc()) then if(Flow % p_m_coupling == PISO) then write(Flow % fuvbr, '(a,i6.6,a,i3.3,a,i2.2,es13.5)') & - '# ts-', curr_dt, & - ' oi-', ini, & + '# ts-', Time % Curr_Dt(), & + ' oi-', ini, & ' ii-', Flow % i_corr, src else - write(Flow % fuvbr, '(a,i6.6,a,i3.3,es13.5)') & - '# ts-', curr_dt, & + write(Flow % fuvbr, '(a,i6.6,a,i3.3,es13.5)') & + '# ts-', Time % Curr_Dt(), & ' oi-', ini, src end if end if diff --git a/Sources/Process/Field_Mod/Utilities/Report_Volume_Balance_Start.f90 b/Sources/Process/Field_Mod/Utilities/Report_Vol_Balance_Start.f90 similarity index 68% rename from Sources/Process/Field_Mod/Utilities/Report_Volume_Balance_Start.f90 rename to Sources/Process/Field_Mod/Utilities/Report_Vol_Balance_Start.f90 index 49baade6a..b89aab0ef 100644 --- a/Sources/Process/Field_Mod/Utilities/Report_Volume_Balance_Start.f90 +++ b/Sources/Process/Field_Mod/Utilities/Report_Vol_Balance_Start.f90 @@ -1,26 +1,30 @@ !==============================================================================! - subroutine Report_Volume_Balance_Start(Flow, curr_dt, ini) + subroutine Report_Vol_Balance_Start(Flow, ini) !------------------------------------------------------------------------------! ! Opens file for volume balance reporting. !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! class(Field_Type) :: Flow - integer, intent(in) :: curr_dt, ini + integer, intent(in) :: ini !==============================================================================! - if(this_proc < 2) then - if(Flow % report_vol_balance) then - call File % Append_For_Writing_Ascii('volume.bal', Flow % fuvbr,this_proc) + if(First_Proc()) then + if(Flow % rep_vol_balance) then + call File % Append_For_Writing_Ascii('volume.bal', & + Flow % fuvbr, & + This_Proc()) if(Flow % p_m_coupling == PISO) then - if(curr_dt .eq. 1 .and. ini .eq. 1 .and. Flow % i_corr .eq. 1) then + if(Time % Curr_Dt() .eq. 1 .and. & + ini .eq. 1 .and. & + Flow % i_corr .eq. 1) then write(Flow % fuvbr, '(a)') '# Report on volume balance' write(Flow % fuvbr, '(a)') '# ts- time step; ' // & 'oi- outer iteration; ' // & 'ii- inner iteration' end if else - if(curr_dt .eq. 1 .and. ini .eq. 1) then + if(Time % Curr_Dt() .eq. 1 .and. ini .eq. 1) then write(Flow % fuvbr, '(a)') '# Report on volume balance' write(Flow % fuvbr, '(a)') '# ts- time step; ' // & 'oi- outer iteration' diff --git a/Sources/Process/Field_Mod/Utilities/Report_Volume_Balance_Stop.f90 b/Sources/Process/Field_Mod/Utilities/Report_Vol_Balance_Stop.f90 similarity index 80% rename from Sources/Process/Field_Mod/Utilities/Report_Volume_Balance_Stop.f90 rename to Sources/Process/Field_Mod/Utilities/Report_Vol_Balance_Stop.f90 index 1f56b0cd8..d6d71edce 100644 --- a/Sources/Process/Field_Mod/Utilities/Report_Volume_Balance_Stop.f90 +++ b/Sources/Process/Field_Mod/Utilities/Report_Vol_Balance_Stop.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Report_Volume_Balance_Stop(Flow) + subroutine Report_Vol_Balance_Stop(Flow) !------------------------------------------------------------------------------! ! Closes file for volume balance reporting. !------------------------------------------------------------------------------! @@ -8,8 +8,8 @@ subroutine Report_Volume_Balance_Stop(Flow) class(Field_Type) :: Flow !==============================================================================! - if(this_proc < 2) then - if(Flow % report_vol_balance) close(Flow % fuvbr) + if(First_Proc()) then + if(Flow % rep_vol_balance) close(Flow % fuvbr) end if end subroutine diff --git a/Sources/Process/Field_Mod/Utilities/Schmidt_Numb.f90 b/Sources/Process/Field_Mod/Utilities/Schmidt_Numb.f90 index eb8f1e59a..df5f2604d 100644 --- a/Sources/Process/Field_Mod/Utilities/Schmidt_Numb.f90 +++ b/Sources/Process/Field_Mod/Utilities/Schmidt_Numb.f90 @@ -1,12 +1,12 @@ !==============================================================================! - real function Schmidt_Numb(Flow, c) + pure real function Schmidt_Numb(Flow, c) !------------------------------------------------------------------------------! ! Computes laminar Schmidt number for cell "c" ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Field_Type), target :: Flow - integer :: c + class(Field_Type), intent(in) :: Flow + integer, intent(in) :: c !==============================================================================! Schmidt_Numb = Flow % viscosity(c) & diff --git a/Sources/Process/Field_Mod/Utilities/Correct_Fluxes_With_Body_Forces.f90 b/Sources/Process/Field_Mod/Utilities/Unused/Correct_Fluxes_With_Body_Forces.f90 similarity index 100% rename from Sources/Process/Field_Mod/Utilities/Correct_Fluxes_With_Body_Forces.f90 rename to Sources/Process/Field_Mod/Utilities/Unused/Correct_Fluxes_With_Body_Forces.f90 diff --git a/Sources/Process/Field_Mod/Utilities/Inertial_Term_Momentum.f90 b/Sources/Process/Field_Mod/Utilities/Unused/Inertial_Term_Momentum.f90 similarity index 100% rename from Sources/Process/Field_Mod/Utilities/Inertial_Term_Momentum.f90 rename to Sources/Process/Field_Mod/Utilities/Unused/Inertial_Term_Momentum.f90 diff --git a/Sources/Process/Field_Mod/Utilities/Volume_Average.f90 b/Sources/Process/Field_Mod/Utilities/Volume_Average.f90 new file mode 100644 index 000000000..0f484d4fb --- /dev/null +++ b/Sources/Process/Field_Mod/Utilities/Volume_Average.f90 @@ -0,0 +1,37 @@ +!==============================================================================! + real function Volume_Average(Flow, val) +!------------------------------------------------------------------------------! +! Calculates the volume average of the values in array val ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Field_Type) :: Flow + real :: val( - Flow % pnt_grid % n_bnd_cells & + : Flow % pnt_grid % n_cells) +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + integer :: c + real :: sum_val, tot_vol +!==============================================================================! + + ! Take alias + Grid => Flow % pnt_grid + + ! Initialize sums + sum_val = 0.0 + tot_vol = 0.0 + + ! Integrate them over cells, avoiding buffers + do c = Cells_In_Domain() + sum_val = sum_val + val(c) * Grid % vol(c) + tot_vol = tot_vol + Grid % vol(c) + end do + + ! Perform sums over all processors + call Global % Sum_Real(sum_val) + call Global % Sum_Real(tot_vol) + + ! Work out the final resul + Volume_Average = sum_val / tot_vol + + end function diff --git a/Sources/Process/Front_Mod.f90 b/Sources/Process/Front_Mod.f90 index 8e348ee3b..70f3a2531 100644 --- a/Sources/Process/Front_Mod.f90 +++ b/Sources/Process/Front_Mod.f90 @@ -1,4 +1,5 @@ #include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" !==============================================================================! module Front_Mod @@ -27,7 +28,7 @@ module Front_Mod integer :: n_verts integer :: n_sides type(Vert_Type), allocatable :: Vert(:) - type(Elem_Type), allocatable :: elem(:) + type(Elem_Type), allocatable :: Elem(:) type(Side_Type), allocatable :: side(:) ! Bounding nodes for each vertex (derives from Isoap usage) diff --git a/Sources/Process/Front_Mod/Calculate_Element_Normals.f90 b/Sources/Process/Front_Mod/Calculate_Element_Normals.f90 index 4b40d0a22..73783523b 100644 --- a/Sources/Process/Front_Mod/Calculate_Element_Normals.f90 +++ b/Sources/Process/Front_Mod/Calculate_Element_Normals.f90 @@ -13,6 +13,7 @@ subroutine Calculate_Element_Normals(Front) integer :: e, j, v1, v2, i_ver real :: surf_v(3) real :: a(3), b(3), tri_v(3), area_x2 + character(SL) :: str !==============================================================================! ! Take aliases @@ -31,6 +32,8 @@ subroutine Calculate_Element_Normals(Front) Elem(e) % sy = 0.0 Elem(e) % sz = 0.0 + Assert(Elem(e) % nv > 2) + do i_ver = 1, Elem(e) % nv v1 = Elem(e) % v(i_ver) @@ -74,8 +77,10 @@ subroutine Calculate_Element_Normals(Front) surf_v(3) = Vert(Elem(e) % v(j)) % smooth_z if(dot_product(surf_v, tri_v) < 0.0) then - print *, '# Error, element ', e, 'is not properly oriented!' - stop + write(str, '(i0.0)') e + call Message % Error(60, & + ' Element '//trim(str)//' is not properly oriented! ', & + file=__FILE__, line=__LINE__) end if end do ! for i, j, k diff --git a/Sources/Process/Front_Mod/Compress_Front_Vertices.f90 b/Sources/Process/Front_Mod/Compress_Front_Vertices.f90 index 5ac24d8a6..83b7d5f2a 100644 --- a/Sources/Process/Front_Mod/Compress_Front_Vertices.f90 +++ b/Sources/Process/Front_Mod/Compress_Front_Vertices.f90 @@ -112,9 +112,9 @@ subroutine Compress_Front_Vertices(Front, verbose) nv = n_vert nv_tot = n_vert if(Front % mesh_divided) then - call Comm_Mod_Global_Sum_Int(nv_tot) + call Global % Sum_Int(nv_tot) end if - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(a40,i8)', ' # Compressed number of vertices: ', nv_tot end if diff --git a/Sources/Process/Front_Mod/Compute_Distance_Function_And_Vof.f90 b/Sources/Process/Front_Mod/Compute_Distance_Function_And_Vof.f90 index cfcc75e1a..e07d12462 100644 --- a/Sources/Process/Front_Mod/Compute_Distance_Function_And_Vof.f90 +++ b/Sources/Process/Front_Mod/Compute_Distance_Function_And_Vof.f90 @@ -96,8 +96,8 @@ subroutine Compute_Distance_Function_And_Vof(Front, cell_dist, vof) end do ! through vertices - call Comm_Mod_Global_Min_Real(min_d) - call Comm_Mod_Global_Max_Real(max_d) + call Global % Min_Real(min_d) + call Global % Max_Real(max_d) !----------------------------------------------------------------------! ! Transform the distances into what Mijail calls \phi in his paper ! diff --git a/Sources/Process/Front_Mod/Find_Sides.f90 b/Sources/Process/Front_Mod/Find_Sides.f90 index ebc9e5cf8..bd48d8379 100644 --- a/Sources/Process/Front_Mod/Find_Sides.f90 +++ b/Sources/Process/Front_Mod/Find_Sides.f90 @@ -51,10 +51,10 @@ subroutine Find_Sides(Front, verbose) ne_tot = ne ns_tot = n_side if(Front % mesh_divided) then - call Comm_Mod_Global_Sum_Int(ne_tot) - call Comm_Mod_Global_Sum_Int(ns_tot) + call Global % Sum_Int(ne_tot) + call Global % Sum_Int(ns_tot) end if - if(this_proc < 2) then + if(First_Proc()) then print '(a40,i8)', ' # Number of elements: ', ne_tot print '(a40,i8)', ' # Tentative number of sides: ', ns_tot end if @@ -196,12 +196,12 @@ subroutine Find_Sides(Front, verbose) cnt_two_tot = cnt_two cnt_one_tot = cnt_one if(Front % mesh_divided) then - call Comm_Mod_Global_Sum_Int(ns_tot) - call Comm_Mod_Global_Sum_Int(cnt_two_tot) - call Comm_Mod_Global_Sum_Int(cnt_one_tot) + call Global % Sum_Int(ns_tot) + call Global % Sum_Int(cnt_two_tot) + call Global % Sum_Int(cnt_one_tot) end if - if(this_proc < 2) then + if(First_Proc()) then print '(a40,i8)', ' # Compressed number of sides: ', ns_tot print '(a40,i8)', ' # Sides surrounded by two elements: ', cnt_two_tot print '(a40,i8)', ' # Sides surrounded by one element: ', cnt_one_tot diff --git a/Sources/Process/Front_Mod/Place_Front_At_Value.f90 b/Sources/Process/Front_Mod/Place_Front_At_Value.f90 index a6370e963..dcd62ceee 100644 --- a/Sources/Process/Front_Mod/Place_Front_At_Value.f90 +++ b/Sources/Process/Front_Mod/Place_Front_At_Value.f90 @@ -18,7 +18,6 @@ subroutine Place_Front_At_Value(Front, sharp, verbose) type(Vert_Type), pointer :: Vert(:) type(Elem_Type), pointer :: Elem(:) integer, pointer :: nv, ne - integer :: nv_tot, ne_tot integer :: c, i, nb, nc, n, nn integer :: v, n_verts_in_buffers integer :: i_nod, i_ver, i_iso @@ -81,7 +80,7 @@ subroutine Place_Front_At_Value(Front, sharp, verbose) ! Browse through all cells in search of surface vertices ! ! ! !------------------------------------------------------------! - do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells + do c = Cells_In_Domain() phi_cell_min = HUGE phi_cell_max = -HUGE do i_nod = 1, abs(Grid % cells_n_nodes(c)) diff --git a/Sources/Process/Front_Mod/Print_Front_Statistics.f90 b/Sources/Process/Front_Mod/Print_Front_Statistics.f90 index 8996f206c..570e8304a 100644 --- a/Sources/Process/Front_Mod/Print_Front_Statistics.f90 +++ b/Sources/Process/Front_Mod/Print_Front_Statistics.f90 @@ -30,7 +30,7 @@ subroutine Print_Front_Statistics(Front) nv_tot = nv if(Front % mesh_divided) then - call Comm_Mod_Global_Sum_Int(nv_tot) + call Global % Sum_Int(nv_tot) end if !--------------------------! @@ -58,8 +58,8 @@ subroutine Print_Front_Statistics(Front) max_rat = max(max_rat, max_l/min_l) min_rat = min(min_rat, max_l/min_l) end do - call Comm_Mod_Global_Max_Real(max_rat) - call Comm_Mod_Global_Min_Real(min_rat) + call Global % Max_Real(max_rat) + call Global % Min_Real(min_rat) !------------------------! ! Total surface area ! @@ -69,7 +69,7 @@ subroutine Print_Front_Statistics(Front) tot_area = tot_area + Elem(e) % area end do if(Front % mesh_divided) then - call Comm_Mod_Global_Sum_Real(tot_area) + call Global % Sum_Real(tot_area) end if !--------------------------------! @@ -77,15 +77,15 @@ subroutine Print_Front_Statistics(Front) !--------------------------------! nne_s = minval(Vert(1:nv) % nne) nne_e = maxval(Vert(1:nv) % nne) - call Comm_Mod_Global_Min_Int(nne_s) - call Comm_Mod_Global_Max_Int(nne_e) + call Global % Min_Int(nne_s) + call Global % Max_Int(nne_e) allocate(nne(nne_s:nne_e)); nne = 0.0 do v = 1, nv nne(Vert(v) % nne) = nne(Vert(v) % nne) + 1.0 end do if(Front % mesh_divided) then do item = nne_s, nne_e - call Comm_Mod_Global_Sum_Real(nne(item)) + call Global % Sum_Real(nne(item)) end do end if @@ -96,22 +96,22 @@ subroutine Print_Front_Statistics(Front) n_verts_tot = Front % n_verts n_sides_tot = Front % n_sides if(Front % mesh_divided) then - call Comm_Mod_Global_Sum_Int(n_elems_tot) - call Comm_Mod_Global_Sum_Int(n_verts_tot) - call Comm_Mod_Global_Sum_Int(n_sides_tot) + call Global % Sum_Int(n_elems_tot) + call Global % Sum_Int(n_verts_tot) + call Global % Sum_Int(n_sides_tot) end if max_l = maxval(side(1:ns) % length) min_l = minval(side(1:ns) % length) - call Comm_Mod_Global_Max_Real(max_l) - call Comm_Mod_Global_Min_Real(min_l) + call Global % Max_Real(max_l) + call Global % Min_Real(min_l) max_a = maxval(Elem(1:ne) % area) min_a = minval(Elem(1:ne) % area) - call Comm_Mod_Global_Max_Real(max_a) - call Comm_Mod_Global_Min_Real(min_a) + call Global % Max_Real(max_a) + call Global % Min_Real(min_a) - if(this_proc < 2) then + if(First_Proc()) then line( 1:160) = ' ' line( 1+T:63+T) = & diff --git a/Sources/Process/Front_Mod/Save_Debug_Front_Vtu.f90 b/Sources/Process/Front_Mod/Save_Debug_Front_Vtu.f90 index aa6365835..63c47cbf6 100644 --- a/Sources/Process/Front_Mod/Save_Debug_Front_Vtu.f90 +++ b/Sources/Process/Front_Mod/Save_Debug_Front_Vtu.f90 @@ -10,18 +10,9 @@ subroutine Save_Debug_Front_Vtu(Front, time_step) !----------------------------------[Locals]------------------------------------! type(Vert_Type), pointer :: Vert type(Grid_Type), pointer :: Grid - integer :: v, e ! vertex and element counters - integer :: s, n_int - integer :: offset, fu + integer :: v, e, n, s, n_int, offset, fu + integer, allocatable :: n_elems(:) character(SL) :: name_out -!-----------------------------[Local parameters]-------------------------------! - integer, parameter :: VTK_TRIANGLE = 5 ! cell shapes in VTK format - character(len= 0) :: IN_0 = '' ! indentation levels - character(len= 2) :: IN_1 = ' ' - character(len= 4) :: IN_2 = ' ' - character(len= 6) :: IN_3 = ' ' - character(len= 8) :: IN_4 = ' ' - character(len=10) :: IN_5 = ' ' !==============================================================================! ! Take alias @@ -30,6 +21,58 @@ subroutine Save_Debug_Front_Vtu(Front, time_step) ! Set precision for plotting (intp and floatp variables) call Vtk_Mod_Set_Precision() + !-----------------------------! + ! ! + ! Create .front.pvtu file ! + ! ! + !-----------------------------! + if(Parallel_Run()) then + + ! Work out how many elements are in each processor + allocate(n_elems(N_Procs())) + n_elems(:) = 0 + n_elems(This_Proc()) = Front % n_elems + call Global % Sum_Int_Array(N_Procs(), n_elems) + + if(First_Proc()) then + call File % Set_Name(name_out, & + time_step=time_step, & + appendix='-front', & + extension='.pvtu', & + domain=Grid % rank) + call File % Open_For_Writing_Ascii(name_out, fu) + + ! Header + write(fu,'(a,a)') IN_0, '' + write(fu,'(a,a)') IN_0, '' + write(fu,'(a,a)') IN_1, '' + + ! This section must be present + write(fu,'(a,a)') IN_2, '' + write(fu,'(a,a)') IN_3, '' + write(fu,'(a,a)') IN_2, '' + + ! Write out the names of all the pieces + do n = 1, N_Procs() + if(n_elems(n) > 0) then + call File % Set_Name(name_out, & + time_step=time_step, & + appendix='-front', & + processor=n, & + extension='.vtu') + write(fu, '(a,a,a,a)') IN_2, '' + end if + end do + + ! Footer + write(fu, '(a,a)') IN_1, '' + write(fu, '(a,a)') IN_0, '' + + close(fu) + end if + end if + if(Front % n_verts < 1) return !----------------------------! @@ -38,291 +81,289 @@ subroutine Save_Debug_Front_Vtu(Front, time_step) ! ! !----------------------------! -! if(this_proc < 2) then - - call File % Set_Name(name_out, & - processor = this_proc, & - time_step = time_step, & - appendix = '-front', & - extension = '.vtu') - call File % Open_For_Writing_Ascii(name_out, fu) - - !------------! - ! ! - ! Header ! - ! ! - !------------! - write(fu,'(a,a)') IN_0, '' - write(fu,'(a,a)') IN_0, '' - write(fu,'(a,a)') IN_1, '' - - write(fu,'(a,a,i0.0,a,i0.0,a)') & - IN_2, '' - - !------------------------! - ! ! - ! Vertex coordinates ! - ! ! - !------------------------! - write(fu,'(a,a)') IN_3, '' - write(fu,'(a,a)') IN_4, '' - do v = 1, Front % n_verts - Vert => Front % Vert(v) - write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, Vert % x_n, Vert % y_n, Vert % z_n - end do - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_3, '' - - !----------------! - ! ! - ! Point data ! - ! ! - !----------------! - write(fu,'(a,a)') IN_3, '' - - !--------------------! - ! Particle i.d.s ! - !--------------------! - write(fu,'(a,a)') IN_4, '' - do v = 1, Front % n_verts - write(fu,'(a,i9)') IN_5, v - end do - write(fu,'(a,a)') IN_4, '' - - !--------------------------! - ! Number of neighbours ! - !--------------------------! - write(fu,'(a,a)') IN_4, '' - do v = 1, Front % n_verts - write(fu,'(a,i9)') IN_5, Front % Vert(v) % nne - end do - write(fu,'(a,a)') IN_4, '' - - !-----------------------------! - ! Curvatures at the nodes ! - !-----------------------------! - write(fu,'(a,a)') IN_4, '' - do v = 1, Front % n_verts - Vert => Front % Vert(v) - write(fu,'(a,1pe16.6e4)') IN_5, Vert % curv - end do - write(fu,'(a,a)') IN_4, '' - - write(fu,'(a,a)') IN_3, '' - - !-----------! - ! ! - ! Cells ! - ! ! - !-----------! - write(fu,'(a,a)') IN_3, '' - write(fu,'(a,a)') IN_4, '' - ! Cell topology - do e = 1, Front % n_elems - write(fu,'(a,99i9)') IN_5, Front % Elem(e) % v(1:Front % Elem(e) % nv)-1 - end do - - ! Cell offsets - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - offset = 0 - do e = 1, Front % n_elems - offset = offset + Front % Elem(e) % nv - write(fu,'(a,i9)') IN_5, offset - end do - - ! Cell types - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - do e = 1, Front % n_elems - write(fu,'(a,i9)') IN_5, VTK_POLYGON - end do - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_3, '' - - !---------------! - ! ! - ! Cell data ! - ! ! - !---------------! - - ! Beginning of cell data - write(fu,'(a,a)') IN_3, '' - - !-------------------------------------! - ! Number of neighbouring elements ! - !-------------------------------------! - write(fu,'(a,a)') IN_4, '' - do e = 1, Front % n_elems - write(fu,'(a,i9)') IN_5, Front % Elem(e) % nne - end do - write(fu,'(a,a)') IN_4, '' - - !---------------------! - ! Surface normals ! - !---------------------! - write(fu,'(4a)') IN_4, & - '' - do e = 1, Front % n_elems - write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, Front % Elem(e) % nx, & - Front % Elem(e) % ny, & - Front % Elem(e) % nz - end do - write(fu,'(a,a)') IN_4, '' - - !-------------------! - ! Element areas ! - !-------------------! - write(fu,'(4a)') IN_4, & - '' - do e = 1, Front % n_elems - write(fu,'(a,1pe16.6e4)') IN_5, Front % Elem(e) % area - end do - write(fu,'(a,a)') IN_4, '' - - !-------------------------! - ! Element coordinates ! - !-------------------------! - write(fu,'(4a)') IN_4, & - '' - do e = 1, Front % n_elems - write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, Front % Elem(e) % xe, & - Front % Elem(e) % ye, & - Front % Elem(e) % ze - end do - write(fu,'(a,a)') IN_4, '' - - !------------------------! - ! Surface curvatures ! - !------------------------! - write(fu,'(4a)') IN_4, & - '' - do e = 1, Front % n_elems - write(fu,'(a,1pe16.6e4)') IN_5, Front % Elem(e) % curv - end do - write(fu,'(a,a)') IN_4, '' - - ! End of cell data - write(fu,'(a,a)') IN_3, '' - - !------------! - ! ! - ! Footer ! - ! ! - !------------! - write(fu,'(a,a)') IN_2, '' - write(fu,'(a,a)') IN_1, '' - write(fu,'(a,a)') IN_0, '' - close(fu) - - !------------------------------------! - ! ! - ! Create .intersections.vtu file ! - ! ! - !------------------------------------! - - ! Count number of intersections in a very simple way - n_int = 0 - do s = 1, Grid % n_faces - if(.not. Math % Approx_Real(Grid % xs(s), 0.0) .and. & - .not. Math % Approx_Real(Grid % ys(s), 0.0) .and. & - .not. Math % Approx_Real(Grid % zs(s), 0.0)) then - n_int = n_int + 1 - end if - end do - print *, '# Number of intersecton = ', n_int - - call File % Set_Name(name_out, & - time_step=time_step, & - appendix ='-intersections', & - extension='.vtu') - call File % Open_For_Writing_Ascii(name_out, fu) - - !------------! - ! ! - ! Header ! - ! ! - !------------! - write(fu,'(a,a)') IN_0, '' - write(fu,'(a,a)') IN_0, '' - write(fu,'(a,a)') IN_1, '' - - write(fu,'(a,a,i0.0,a)') & - IN_2, '' - - !-------------------------------! - ! ! - ! Intersections coordinates ! - ! ! - !-------------------------------! - write(fu,'(a,a)') IN_3, '' - write(fu,'(a,a)') IN_4, '' - do s = 1, Grid % n_faces - if(.not. Math % Approx_Real(Grid % xs(s), 0.0) .and. & - .not. Math % Approx_Real(Grid % ys(s), 0.0) .and. & - .not. Math % Approx_Real(Grid % zs(s), 0.0)) then - write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, Grid % xs(s), Grid % ys(s), Grid % zs(s) - end if - end do - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_3, '' - - !-----------! - ! ! - ! Cells ! - ! ! - !-----------! - write(fu,'(a,a)') IN_3, '' - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_4, '' - write(fu,'(a,a)') IN_3, '' - - !------------! - ! ! - ! Footer ! - ! ! - !------------! - write(fu,'(a,a)') IN_2, '' - write(fu,'(a,a)') IN_1, '' - write(fu,'(a,a)') IN_0, '' - close(fu) - -! end if + call File % Set_Name(name_out, & + processor = This_Proc(), & + time_step = time_step, & + appendix = '-front', & + extension = '.vtu', & + domain=Grid % rank) + call File % Open_For_Writing_Ascii(name_out, fu) + + !------------! + ! ! + ! Header ! + ! ! + !------------! + write(fu,'(a,a)') IN_0, '' + write(fu,'(a,a)') IN_0, '' + write(fu,'(a,a)') IN_1, '' + + write(fu,'(a,a,i0.0,a,i0.0,a)') & + IN_2, '' + + !------------------------! + ! ! + ! Vertex coordinates ! + ! ! + !------------------------! + write(fu,'(a,a)') IN_3, '' + write(fu,'(a,a)') IN_4, '' + do v = 1, Front % n_verts + Vert => Front % Vert(v) + write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & + IN_5, Vert % x_n, Vert % y_n, Vert % z_n + end do + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_3, '' + + !----------------! + ! ! + ! Point data ! + ! ! + !----------------! + write(fu,'(a,a)') IN_3, '' + + !--------------------! + ! Particle i.d.s ! + !--------------------! + write(fu,'(a,a)') IN_4, '' + do v = 1, Front % n_verts + write(fu,'(a,i9)') IN_5, v + end do + write(fu,'(a,a)') IN_4, '' + + !--------------------------! + ! Number of neighbours ! + !--------------------------! + write(fu,'(a,a)') IN_4, '' + do v = 1, Front % n_verts + write(fu,'(a,i9)') IN_5, Front % Vert(v) % nne + end do + write(fu,'(a,a)') IN_4, '' + + !-----------------------------! + ! Curvatures at the nodes ! + !-----------------------------! + write(fu,'(a,a)') IN_4, '' + do v = 1, Front % n_verts + Vert => Front % Vert(v) + write(fu,'(a,1pe16.6e4)') IN_5, Vert % curv + end do + write(fu,'(a,a)') IN_4, '' + + write(fu,'(a,a)') IN_3, '' + + !-----------! + ! ! + ! Cells ! + ! ! + !-----------! + write(fu,'(a,a)') IN_3, '' + write(fu,'(a,a)') IN_4, '' + ! Cell topology + do e = 1, Front % n_elems + write(fu,'(a,99i9)') IN_5, Front % Elem(e) % v(1:Front % Elem(e) % nv)-1 + end do + + ! Cell offsets + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + offset = 0 + do e = 1, Front % n_elems + offset = offset + Front % Elem(e) % nv + write(fu,'(a,i9)') IN_5, offset + end do + + ! Cell types + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + do e = 1, Front % n_elems + write(fu,'(a,i9)') IN_5, VTK_POLYGON + end do + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_3, '' + + !---------------! + ! ! + ! Cell data ! + ! ! + !---------------! + + ! Beginning of cell data + write(fu,'(a,a)') IN_3, '' + + !-------------------------------------! + ! Number of neighbouring elements ! + !-------------------------------------! + write(fu,'(a,a)') IN_4, '' + do e = 1, Front % n_elems + write(fu,'(a,i9)') IN_5, Front % Elem(e) % nne + end do + write(fu,'(a,a)') IN_4, '' + + !---------------------! + ! Surface normals ! + !---------------------! + write(fu,'(4a)') IN_4, & + '' + do e = 1, Front % n_elems + write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & + IN_5, Front % Elem(e) % nx, & + Front % Elem(e) % ny, & + Front % Elem(e) % nz + end do + write(fu,'(a,a)') IN_4, '' + + !-------------------! + ! Element areas ! + !-------------------! + write(fu,'(4a)') IN_4, & + '' + do e = 1, Front % n_elems + write(fu,'(a,1pe16.6e4)') IN_5, Front % Elem(e) % area + end do + write(fu,'(a,a)') IN_4, '' + + !-------------------------! + ! Element coordinates ! + !-------------------------! + write(fu,'(4a)') IN_4, & + '' + do e = 1, Front % n_elems + write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & + IN_5, Front % Elem(e) % xe, & + Front % Elem(e) % ye, & + Front % Elem(e) % ze + end do + write(fu,'(a,a)') IN_4, '' + + !------------------------! + ! Surface curvatures ! + !------------------------! + write(fu,'(4a)') IN_4, & + '' + do e = 1, Front % n_elems + write(fu,'(a,1pe16.6e4)') IN_5, Front % Elem(e) % curv + end do + write(fu,'(a,a)') IN_4, '' + + ! End of cell data + write(fu,'(a,a)') IN_3, '' + + !------------! + ! ! + ! Footer ! + ! ! + !------------! + write(fu,'(a,a)') IN_2, '' + write(fu,'(a,a)') IN_1, '' + write(fu,'(a,a)') IN_0, '' + close(fu) + + !------------------------------------! + ! ! + ! Create .intersections.vtu file ! + ! ! + !------------------------------------! + + ! Count number of intersections in a very simple way + n_int = 0 + do s = 1, Grid % n_faces + if(.not. Math % Approx_Real(Grid % xs(s), 0.0) .and. & + .not. Math % Approx_Real(Grid % ys(s), 0.0) .and. & + .not. Math % Approx_Real(Grid % zs(s), 0.0)) then + n_int = n_int + 1 + end if + end do + print *, '# Number of intersecton = ', n_int + + call File % Set_Name(name_out, & + time_step=time_step, & + appendix ='-intersections', & + extension='.vtu', & + domain=Grid % rank) + call File % Open_For_Writing_Ascii(name_out, fu) + + !------------! + ! ! + ! Header ! + ! ! + !------------! + write(fu,'(a,a)') IN_0, '' + write(fu,'(a,a)') IN_0, '' + write(fu,'(a,a)') IN_1, '' + + write(fu,'(a,a,i0.0,a)') & + IN_2, '' + + !-------------------------------! + ! ! + ! Intersections coordinates ! + ! ! + !-------------------------------! + write(fu,'(a,a)') IN_3, '' + write(fu,'(a,a)') IN_4, '' + do s = 1, Grid % n_faces + if(.not. Math % Approx_Real(Grid % xs(s), 0.0) .and. & + .not. Math % Approx_Real(Grid % ys(s), 0.0) .and. & + .not. Math % Approx_Real(Grid % zs(s), 0.0)) then + write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & + IN_5, Grid % xs(s), Grid % ys(s), Grid % zs(s) + end if + end do + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_3, '' + + !-----------! + ! ! + ! Cells ! + ! ! + !-----------! + write(fu,'(a,a)') IN_3, '' + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_4, '' + write(fu,'(a,a)') IN_3, '' + + !------------! + ! ! + ! Footer ! + ! ! + !------------! + write(fu,'(a,a)') IN_2, '' + write(fu,'(a,a)') IN_1, '' + write(fu,'(a,a)') IN_0, '' + close(fu) end subroutine diff --git a/Sources/Process/Info_Mod.f90 b/Sources/Process/Info_Mod.f90 index 6e8c74fe9..9a953ce21 100644 --- a/Sources/Process/Info_Mod.f90 +++ b/Sources/Process/Info_Mod.f90 @@ -23,45 +23,74 @@ module Info_Mod end type !--------------------! - ! Time_Info type ! + ! Time Info type ! !--------------------! type Time_Info_Type character(len=L_LINE) :: line_lead = '' character(len=L_LINE) :: line_trail = '' - character(len=L_LINE) :: lines(6) = '' + character(len=L_LINE) :: line(6) = '' end type !--------------------! - ! Iter_Info type ! + ! Iter Info type ! !--------------------! type Iter_Info_Type - integer :: n_user_lines = 0 - character(len=L_LINE) :: line_lead = '' - character(len=L_LINE) :: line_sep = '' - character(len=L_LINE) :: line_iter = '' - character(len=L_LINE) :: lines(4) = '' + integer :: n_user_lines = 0 + character(len=L_LINE) :: line_lead = '' + character(len=L_LINE) :: line_sep = '' + character(len=L_LINE) :: line_iter = '' + character(len=L_LINE) :: line(4) = '' character(len=L_LINE) :: lines_user(MAX_USER_LINES) = '' end type !--------------------! - ! Bulk_Info type ! + ! Bulk Info type ! !--------------------! type Bulk_Info_Type character(len=L_LINE) :: line_lead = '' character(len=L_LINE) :: line_foll = '' character(len=L_LINE) :: line_sep = '' character(len=L_LINE) :: line_trail = '' - character(len=L_LINE) :: lines(3) = '' + character(len=L_LINE) :: line(3) = '' end type - type(System_Clock_Type), save :: sys_clock - type(Time_Info_Type), save :: time_info - type(Iter_Info_Type), save :: iter_info - type(Bulk_Info_Type), save :: bulk_info + !---------------! + ! Info type ! + !---------------! + type Info_Type + type(System_Clock_Type), private :: clock + type(Time_Info_Type), private :: time + type(Iter_Info_Type), private :: iter + type(Bulk_Info_Type), private :: bulk + + contains + procedure :: Start_Info + procedure :: Time_To_Exit + + procedure :: Time_Start + procedure :: Time_Fill + procedure :: Time_Print + + procedure :: Iter_Start + procedure :: Iter_Fill + procedure :: Iter_Fill_At + procedure :: Iter_Fill_Scalar_At + procedure :: Iter_Print + + procedure :: Bulk_Start + procedure :: Bulk_Fill + procedure :: Bulk_Print + + end type + + !---------------------------------! + ! Singletone type Info object ! + !---------------------------------! + type(Info_Type) :: Info contains -# include "Info_Mod/Start.f90" +# include "Info_Mod/Start_Info.f90" # include "Info_Mod/Time_To_Exit.f90" # include "Info_Mod/Time_Start.f90" @@ -71,7 +100,7 @@ module Info_Mod # include "Info_Mod/Iter_Start.f90" # include "Info_Mod/Iter_Fill.f90" # include "Info_Mod/Iter_Fill_At.f90" -# include "Info_Mod/Iter_Fill_User_At.f90" +# include "Info_Mod/Iter_Fill_Scalar_At.f90" # include "Info_Mod/Iter_Print.f90" # include "Info_Mod/Bulk_Start.f90" diff --git a/Sources/Process/Info_Mod/Bulk_Fill.f90 b/Sources/Process/Info_Mod/Bulk_Fill.f90 index af4764f3a..ec678b017 100644 --- a/Sources/Process/Info_Mod/Bulk_Fill.f90 +++ b/Sources/Process/Info_Mod/Bulk_Fill.f90 @@ -1,35 +1,36 @@ !==============================================================================! - subroutine Info_Mod_Bulk_Fill(Flow) + subroutine Bulk_Fill(Info, Flow) !------------------------------------------------------------------------------! ! Fills the info box with information to be written on the screen. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type) :: Flow + class(Info_Type) :: Info + type(Field_Type), intent(in) :: Flow !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then ! Courant and Peclet numbers - write(bulk_info % lines(1)( 27: 49), '(a23)') 'Maximum Courant number:' - write(bulk_info % lines(1)( 51: 60), '(1pe9.3)') Flow % cfl_max + write(Info % bulk % line(1)( 27: 49), '(a23)') 'Maximum Courant number:' + write(Info % bulk % line(1)( 51: 60), '(1pe9.3)') Flow % cfl_max - write(bulk_info % lines(1)( 69: 90), '(a22)') 'Maximum Peclet number:' - write(bulk_info % lines(1)( 92:100), '(1pe9.3)') Flow % pe_max + write(Info % bulk % line(1)( 69: 90), '(a22)') 'Maximum Peclet number:' + write(Info % bulk % line(1)( 92:100), '(1pe9.3)') Flow % pe_max - write(bulk_info % lines(2)( 27: 34), '(a8)') 'Flux x :' - write(bulk_info % lines(2)( 36: 45), '(1pe10.3)') Flow % bulk % flux_x - write(bulk_info % lines(2)( 55: 62), '(a8)') 'Flux y :' - write(bulk_info % lines(2)( 64: 75), '(1pe10.2)') Flow % bulk % flux_y - write(bulk_info % lines(2)( 83: 90), '(a8)') 'Flux z :' - write(bulk_info % lines(2)( 92:101), '(1pe10.2)') Flow % bulk % flux_z + write(Info % bulk % line(2)( 27: 34), '(a8)') 'Flux x :' + write(Info % bulk % line(2)( 36: 45), '(1pe10.3)') Flow % bulk % flux_x + write(Info % bulk % line(2)( 55: 62), '(a8)') 'Flux y :' + write(Info % bulk % line(2)( 64: 75), '(1pe10.2)') Flow % bulk % flux_y + write(Info % bulk % line(2)( 83: 90), '(a8)') 'Flux z :' + write(Info % bulk % line(2)( 92:101), '(1pe10.2)') Flow % bulk % flux_z - write(bulk_info % lines(3)( 27: 34), '(a8)') 'Pdrop x:' - write(bulk_info % lines(3)( 36: 45), '(1pe10.3)') Flow % bulk % p_drop_x - write(bulk_info % lines(3)( 55: 62), '(a8)') 'Pdrop y:' - write(bulk_info % lines(3)( 64: 75), '(1pe10.2)') Flow % bulk % p_drop_y - write(bulk_info % lines(3)( 83: 90), '(a8)') 'Pdrop z:' - write(bulk_info % lines(3)( 92:101), '(1pe10.2)') Flow % bulk % p_drop_z + write(Info % bulk % line(3)( 27: 34), '(a8)') 'Pdrop x:' + write(Info % bulk % line(3)( 36: 45), '(1pe10.3)') Flow % bulk % p_drop_x + write(Info % bulk % line(3)( 55: 62), '(a8)') 'Pdrop y:' + write(Info % bulk % line(3)( 64: 75), '(1pe10.2)') Flow % bulk % p_drop_y + write(Info % bulk % line(3)( 83: 90), '(a8)') 'Pdrop z:' + write(Info % bulk % line(3)( 92:101), '(1pe10.2)') Flow % bulk % p_drop_z end if end subroutine diff --git a/Sources/Process/Info_Mod/Bulk_Print.f90 b/Sources/Process/Info_Mod/Bulk_Print.f90 index d191e2322..58ac7b14b 100644 --- a/Sources/Process/Info_Mod/Bulk_Print.f90 +++ b/Sources/Process/Info_Mod/Bulk_Print.f90 @@ -1,30 +1,31 @@ !==============================================================================! - subroutine Info_Mod_Bulk_Print(Flow, dom, n_dom) + subroutine Bulk_Print(Info, Flow, dom, n_dom) !------------------------------------------------------------------------------! ! Prints information about inner iteration on the screen. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type) :: Flow - integer :: dom, n_dom + class(Info_Type) :: Info + type(Field_Type), intent(in) :: Flow + integer, intent(in) :: dom, n_dom !==============================================================================! - call Info_Mod_Bulk_Fill(Flow) + call Info % Bulk_Fill(Flow) - if(this_proc < 2) then + if(First_Proc()) then ! String is L_LINE+2 long if(dom .eq. 1) then - print '(a129)', trim(bulk_info % line_lead) + print '(a129)', trim(Info % bulk % line_lead) else - print '(a108)', trim(bulk_info % line_foll) + print '(a108)', trim(Info % bulk % line_foll) end if - print '(a108)', trim(bulk_info % lines(1)) - print '(a108)', trim(bulk_info % line_sep) - print '(a108)', trim(bulk_info % lines(2)) - print '(a108)', trim(bulk_info % lines(3)) + print '(a108)', trim(Info % bulk % line(1)) + print '(a108)', trim(Info % bulk % line_sep) + print '(a108)', trim(Info % bulk % line(2)) + print '(a108)', trim(Info % bulk % line(3)) if(dom .eq. n_dom) then - print '(a108)', trim(bulk_info % line_trail) + print '(a108)', trim(Info % bulk % line_trail) print '(a)', '' end if diff --git a/Sources/Process/Info_Mod/Bulk_Start.f90 b/Sources/Process/Info_Mod/Bulk_Start.f90 index c90a3b584..37f4b9337 100644 --- a/Sources/Process/Info_Mod/Bulk_Start.f90 +++ b/Sources/Process/Info_Mod/Bulk_Start.f90 @@ -1,59 +1,61 @@ !==============================================================================! - subroutine Info_Mod_Bulk_Start() + subroutine Bulk_Start(Info) !------------------------------------------------------------------------------! ! Essentially creates a box in which iteration residuls will be written. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info !-----------------------------------[Locals]-----------------------------------! integer :: i !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then ! Create a frame do i = 1, L_LINE - bulk_info % line_lead(i:i) = '-' - bulk_info % line_foll(i:i) = ' ' + Info % bulk % line_lead(i:i) = '-' + Info % bulk % line_foll(i:i) = ' ' end do - bulk_info % line_lead( 1: 1) = '#' - bulk_info % line_lead(L_LINE:L_LINE) = '#' + Info % bulk % line_lead( 1: 1) = '#' + Info % bulk % line_lead(L_LINE:L_LINE) = '#' do i = L_BOX + 1, 5*L_BOX + 1 - bulk_info % line_lead (i:i) = '=' - bulk_info % line_foll (i:i) = '=' - bulk_info % line_sep (i:i) = '-' - bulk_info % line_trail(i:i) = '-' + Info % bulk % line_lead (i:i) = '=' + Info % bulk % line_foll (i:i) = '=' + Info % bulk % line_sep (i:i) = '-' + Info % bulk % line_trail(i:i) = '-' end do - bulk_info % line_lead( L_BOX+1: L_BOX+1) = '+' - bulk_info % line_foll( L_BOX+1: L_BOX+1) = '+' - bulk_info % line_lead(5*L_BOX+1:5*L_BOX+1) = '+' - bulk_info % line_foll(5*L_BOX+1:5*L_BOX+1) = '+' + Info % bulk % line_lead( L_BOX+1: L_BOX+1) = '+' + Info % bulk % line_foll( L_BOX+1: L_BOX+1) = '+' + Info % bulk % line_lead(5*L_BOX+1:5*L_BOX+1) = '+' + Info % bulk % line_foll(5*L_BOX+1:5*L_BOX+1) = '+' do i = 22, 106, 106-22 - bulk_info % lines(1) (i:i) = '#' - bulk_info % line_sep (i:i) = '#' - bulk_info % lines(2) (i:i) = '#' - bulk_info % lines(3) (i:i) = '#' - bulk_info % line_trail(i:i) = '#' + Info % bulk % line(1) (i:i) = '#' + Info % bulk % line_sep (i:i) = '#' + Info % bulk % line(2) (i:i) = '#' + Info % bulk % line(3) (i:i) = '#' + Info % bulk % line_trail(i:i) = '#' end do ! Create separators - bulk_info % line_lead(L_LINE/2+1:L_LINE/2+1) = '+' - bulk_info % line_foll(L_LINE/2+1:L_LINE/2+1) = '+' - bulk_info % lines(1) (L_LINE/2+1:L_LINE/2+1) = '|' - bulk_info % line_sep (L_LINE/2+1:L_LINE/2+1) = '+' - - bulk_info % line_sep (50:50) = '+' - bulk_info % lines(2) (50:50) = '|' - bulk_info % lines(3) (50:50) = '|' - bulk_info % line_trail(50:50) = '+' - - bulk_info % line_sep (78:78) = '+' - bulk_info % lines(2) (78:78) = '|' - bulk_info % lines(3) (78:78) = '|' - bulk_info % line_trail(78:78) = '+' + Info % bulk % line_lead(L_LINE/2+1:L_LINE/2+1) = '+' + Info % bulk % line_foll(L_LINE/2+1:L_LINE/2+1) = '+' + Info % bulk % line(1) (L_LINE/2+1:L_LINE/2+1) = '|' + Info % bulk % line_sep (L_LINE/2+1:L_LINE/2+1) = '+' + + Info % bulk % line_sep (50:50) = '+' + Info % bulk % line(2) (50:50) = '|' + Info % bulk % line(3) (50:50) = '|' + Info % bulk % line_trail(50:50) = '+' + + Info % bulk % line_sep (78:78) = '+' + Info % bulk % line(2) (78:78) = '|' + Info % bulk % line(3) (78:78) = '|' + Info % bulk % line_trail(78:78) = '+' end if diff --git a/Sources/Process/Info_Mod/Iter_Fill.f90 b/Sources/Process/Info_Mod/Iter_Fill.f90 index 4af3a7fa2..600f66976 100644 --- a/Sources/Process/Info_Mod/Iter_Fill.f90 +++ b/Sources/Process/Info_Mod/Iter_Fill.f90 @@ -1,27 +1,28 @@ !==============================================================================! - subroutine Info_Mod_Iter_Fill(n) + subroutine Iter_Fill(Info, n) !------------------------------------------------------------------------------! ! Fills the info box with information to be written on the screen. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n ! inner iteration + class(Info_Type) :: Info + integer, intent(in) :: n ! inner iteration !-----------------------------------[Locals]-----------------------------------! integer :: c !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then ! Write basic info c = 1 ! a column - write(iter_info % line_iter((c-1)*L_BOX+58 : & - (c-1)*L_BOX+67), '(a10)') 'Iteration:' - write(iter_info % line_iter((c-1)*L_BOX+68 : & - (c-1)*L_BOX+70), '(i3)') n + write(Info % iter % line_iter((c-1)*L_BOX+58 : & + (c-1)*L_BOX+67), '(a10)') 'Iteration:' + write(Info % iter % line_iter((c-1)*L_BOX+68 : & + (c-1)*L_BOX+70), '(i3)') n c = 5 ! a column - write(iter_info % lines(1)((c-1)*L_BOX+3 : & - (c-1)*L_BOX+7), '(a5)') 'MASS:' + write(Info % iter % line(1)((c-1)*L_BOX+3 : & + (c-1)*L_BOX+7), '(a5)') 'MASS:' end if diff --git a/Sources/Process/Info_Mod/Iter_Fill_At.f90 b/Sources/Process/Info_Mod/Iter_Fill_At.f90 index 00a7b90a5..4c2cefe6f 100644 --- a/Sources/Process/Info_Mod/Iter_Fill_At.f90 +++ b/Sources/Process/Info_Mod/Iter_Fill_At.f90 @@ -1,33 +1,34 @@ !==============================================================================! - subroutine Info_Mod_Iter_Fill_At(r, c, name_var, n_iter, res) + subroutine Iter_Fill_At(Info, r, c, name_var, res, n_iter) !------------------------------------------------------------------------------! ! Inserts infromation at specified position in the information box. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: r ! row - integer :: c ! column - character(len=*) :: name_var - integer :: n_iter ! number of iterations - real :: res + class(Info_Type) :: Info + integer, intent(in) :: r ! row + integer, intent(in) :: c ! column + character(len=*), intent(in) :: name_var + real, intent(in) :: res + integer, optional, intent(in) :: n_iter ! number of iterations !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then ! Normal variables - if(n_iter > -1) then ! if n_iter .eq. -1, iterations won't be written - ! (that's useful for mass residual) - write(iter_info % lines(r)((c-1)*L_BOX+ 3 : & - (c-1)*L_BOX+ 6), '(a4)') name_var - write(iter_info % lines(r)((c-1)*L_BOX+ 7 : & - (c-1)*L_BOX+ 7), '(a1)') ':' - write(iter_info % lines(r)((c-1)*L_BOX+ 8 : & - (c-1)*L_BOX+10), '(i3)') n_iter + if(present(n_iter)) then ! if n_iter not present, iterations won't be + ! written (that's useful for mass residual) + write(Info % iter % line(r)((c-1)*L_BOX+ 3 : & + (c-1)*L_BOX+ 6), '(a4)') name_var + write(Info % iter % line(r)((c-1)*L_BOX+ 7 : & + (c-1)*L_BOX+ 7), '(a1)') ':' + write(Info % iter % line(r)((c-1)*L_BOX+ 8 : & + (c-1)*L_BOX+10), '(i3)') n_iter endif - ! Residual - write(iter_info % lines(r)((c-1)*L_BOX+12 : & - (c-1)*L_BOX+20), '(1pe9.3)') res + ! Residual + write(Info % iter % line(r)((c-1)*L_BOX+12 : & + (c-1)*L_BOX+20), '(1pe9.3)') res end if diff --git a/Sources/Process/Info_Mod/Iter_Fill_Scalar_At.f90 b/Sources/Process/Info_Mod/Iter_Fill_Scalar_At.f90 new file mode 100644 index 000000000..1125b9024 --- /dev/null +++ b/Sources/Process/Info_Mod/Iter_Fill_Scalar_At.f90 @@ -0,0 +1,34 @@ +!==============================================================================! + subroutine Iter_Fill_Scalar_At(Info, r, c, name_var, res, n_iter) +!------------------------------------------------------------------------------! +! Inserts infromation at specified position in the information box. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info + integer, intent(in) :: r ! row + integer, intent(in) :: c ! column + character(len=*), intent(in) :: name_var + real, intent(in) :: res + integer, intent(in) :: n_iter ! number of iterations +!==============================================================================! + + if(First_Proc()) then + + ! Update the number of lines you'll have to print in the end + Info % iter % n_user_lines = max(Info % iter % n_user_lines, r) + + ! User variables + write(Info % iter % lines_user(r)((c-1)*L_BOX+ 3 : & + (c-1)*L_BOX+ 6), '(a4)') name_var + write(Info % iter % lines_user(r)((c-1)*L_BOX+ 7 : & + (c-1)*L_BOX+ 7), '(a1)') ':' + write(Info % iter % lines_user(r)((c-1)*L_BOX+ 8 : & + (c-1)*L_BOX+10), '(i3)') n_iter + ! Residual + write(Info % iter % lines_user(r)((c-1)*L_BOX+12 : & + (c-1)*L_BOX+20), '(1pe9.3)') res + + end if + + end subroutine diff --git a/Sources/Process/Info_Mod/Iter_Fill_User_At.f90 b/Sources/Process/Info_Mod/Iter_Fill_User_At.f90 deleted file mode 100644 index ad5038acc..000000000 --- a/Sources/Process/Info_Mod/Iter_Fill_User_At.f90 +++ /dev/null @@ -1,33 +0,0 @@ -!==============================================================================! - subroutine Info_Mod_Iter_Fill_User_At(r, c, name_var, n_iter, res) -!------------------------------------------------------------------------------! -! Inserts infromation at specified position in the information box. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - integer :: r ! row - integer :: c ! column - character(len=*) :: name_var - integer :: n_iter ! number of iterations - real :: res -!==============================================================================! - - if(this_proc < 2) then - - ! Update the number of lines you'll have to print in the end - iter_info % n_user_lines = max(iter_info % n_user_lines, r) - - ! User variables - write(iter_info % lines_user(r)((c-1)*L_BOX+ 3 : & - (c-1)*L_BOX+ 6), '(a4)') name_var - write(iter_info % lines_user(r)((c-1)*L_BOX+ 7 : & - (c-1)*L_BOX+ 7), '(a1)') ':' - write(iter_info % lines_user(r)((c-1)*L_BOX+ 8 : & - (c-1)*L_BOX+10), '(i3)') n_iter - ! Residual - write(iter_info % lines_user(r)((c-1)*L_BOX+12 : & - (c-1)*L_BOX+20), '(1pe9.3)') res - - end if - - end subroutine diff --git a/Sources/Process/Info_Mod/Iter_Print.f90 b/Sources/Process/Info_Mod/Iter_Print.f90 index 8a5d838d8..c4412e25f 100644 --- a/Sources/Process/Info_Mod/Iter_Print.f90 +++ b/Sources/Process/Info_Mod/Iter_Print.f90 @@ -1,42 +1,43 @@ !==============================================================================! - subroutine Info_Mod_Iter_Print(d) + subroutine Iter_Print(Info, d) !------------------------------------------------------------------------------! ! Prints information about inner iteration on the screen. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: d ! domain + class(Info_Type) :: Info + integer, intent(in) :: d ! domain !-----------------------------------[Locals]-----------------------------------! integer :: i character(len=L_LINE) :: tmp !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then if(d .eq. 1) then - print '(a129)', iter_info % line_lead - print '(a129)', iter_info % line_iter - print '(a129)', iter_info % line_sep + print '(a129)', Info % iter % line_lead + print '(a129)', Info % iter % line_iter + print '(a129)', Info % iter % line_sep end if ! Print only lines which have colon in the first column :-) - print '(a129)', iter_info % lines(1) + print '(a129)', Info % iter % line(1) ! First print normal lines do i = 2, 4 - tmp = iter_info % lines(i) - if( tmp(7:7) .eq. ':') print '(a129)', iter_info % lines(i) - iter_info % lines(i)(7:7) = ' ' ! remove the column for other domains + tmp = Info % iter % line(i) + if( tmp(7:7) .eq. ':') print '(a129)', Info % iter % line(i) + Info % iter % line(i)(7:7) = ' ' ! remove column for other domains end do ! Then print user lines - do i = 1, iter_info % n_user_lines - tmp = iter_info % lines_user(i) - if( tmp(7:7) .eq. ':') print '(a129)', iter_info % lines_user(i) - iter_info % lines_user(i)(7:7) = ' ' ! remove the column for other domains + do i = 1, Info % iter % n_user_lines + tmp = Info % iter % lines_user(i) + if( tmp(7:7) .eq. ':') print '(a129)', Info % iter % lines_user(i) + Info % iter % lines_user(i)(7:7) = ' ' ! remove column for other domains end do - call Info_Mod_Iter_Start() + call Info % Iter_Start() end if diff --git a/Sources/Process/Info_Mod/Iter_Start.f90 b/Sources/Process/Info_Mod/Iter_Start.f90 index 44b61153d..dc798423c 100644 --- a/Sources/Process/Info_Mod/Iter_Start.f90 +++ b/Sources/Process/Info_Mod/Iter_Start.f90 @@ -1,40 +1,42 @@ !==============================================================================! - subroutine Info_Mod_Iter_Start() + subroutine Iter_Start(Info) !------------------------------------------------------------------------------! ! Essentially creates a box in which iteration residuls will be written. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info !-----------------------------------[Locals]-----------------------------------! integer :: i, l !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then ! Create frame do i = 1, L_LINE, L_LINE-1 - iter_info % line_lead (i:i) = '#' - iter_info % line_iter (i:i) = '#' - iter_info % line_sep (i:i) = '#' + Info % iter % line_lead (i:i) = '#' + Info % iter % line_iter (i:i) = '#' + Info % iter % line_sep (i:i) = '#' end do ! For normal lines do l = 1, 4 - iter_info % lines(l)( 1:L_LINE) = ' ' - iter_info % lines(l)( 1: 1) = '#' - iter_info % lines(l)(L_LINE:L_LINE) = '#' + Info % iter % line(l)( 1:L_LINE) = ' ' + Info % iter % line(l)( 1: 1) = '#' + Info % iter % line(l)(L_LINE:L_LINE) = '#' end do ! For user lines do l = 1, MAX_USER_LINES - iter_info % lines_user(l)( 1:L_LINE) = ' ' - iter_info % lines_user(l)( 1: 1) = '#' - iter_info % lines_user(l)(L_LINE:L_LINE) = '#' + Info % iter % lines_user(l)( 1:L_LINE) = ' ' + Info % iter % lines_user(l)( 1: 1) = '#' + Info % iter % lines_user(l)(L_LINE:L_LINE) = '#' end do ! Lead and separating lines do i = 2, L_LINE-1 - iter_info % line_lead(i:i) = '=' - iter_info % line_sep (i:i) = '-' + Info % iter % line_lead(i:i) = '=' + Info % iter % line_sep (i:i) = '-' end do ! Create separators (character must be length of L_BOX) @@ -42,15 +44,15 @@ subroutine Info_Mod_Iter_Start() ! For normal lines do l = 1, 4 - write(iter_info % lines(l) (i:i+L_BOX-1), '(a21)') '|' + write(Info % iter % line(l) (i:i+L_BOX-1), '(a21)') '|' end do ! For user lines do l = 1, MAX_USER_LINES - write(iter_info % lines_user(l) (i:i+L_BOX-1), '(a21)') '|' + write(Info % iter % lines_user(l) (i:i+L_BOX-1), '(a21)') '|' end do - write(iter_info % line_sep(i+L_BOX-1 : & - i+L_BOX-1), '(a1)') '+' + write(Info % iter % line_sep(i+L_BOX-1 : & + i+L_BOX-1), '(a1)') '+' end do end if diff --git a/Sources/Process/Info_Mod/Start.f90 b/Sources/Process/Info_Mod/Start_Info.f90 similarity index 56% rename from Sources/Process/Info_Mod/Start.f90 rename to Sources/Process/Info_Mod/Start_Info.f90 index 78bf1f720..6c39cfede 100644 --- a/Sources/Process/Info_Mod/Start.f90 +++ b/Sources/Process/Info_Mod/Start_Info.f90 @@ -1,20 +1,22 @@ !==============================================================================! - subroutine Info_Mod_Start() + subroutine Start_Info(Info) !------------------------------------------------------------------------------! ! Start Info_Mod by taking system count rate and initial count rate ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info !==============================================================================! ! Get system clock clock rate and initial clock count - call system_clock(count_rate = sys_clock % cnt) - call system_clock(sys_clock % ini) + call system_clock(count_rate = Info % clock % cnt) + call system_clock(Info % clock % ini) ! Read maximum wall clock hours - call Control_Mod_Wall_Time_Max_Hours(sys_clock % wall_time_max, & - verbose=.true.) + call Control % Wall_Time_Max_Hours(Info % clock % wall_time_max, & + verbose=.true.) ! Make it in seconds - sys_clock % wall_time_max = sys_clock % wall_time_max * 3600 + Info % clock % wall_time_max = Info % clock % wall_time_max * 3600 end subroutine diff --git a/Sources/Process/Info_Mod/Time_Fill.f90 b/Sources/Process/Info_Mod/Time_Fill.f90 index 364232ee0..ca6ac4e82 100644 --- a/Sources/Process/Info_Mod/Time_Fill.f90 +++ b/Sources/Process/Info_Mod/Time_Fill.f90 @@ -1,43 +1,45 @@ !==============================================================================! - subroutine Info_Mod_Time_Fill(n, sim_time) + subroutine Time_Fill(Info, n, sim_time) !------------------------------------------------------------------------------! ! Fills the info box with information to be written on the screen. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n ! time step - real :: sim_time ! simulation time + class(Info_Type) :: Info + integer, intent(in) :: n ! time step + real, intent(in) :: sim_time ! simulation time !-----------------------------------[Locals]-----------------------------------! integer :: hours, minutes, seconds real(DP) :: wall_time ! number of seconds of wall-clock time !==============================================================================! ! Update current system clock and wall time - call system_clock(sys_clock % cur) - wall_time = real(sys_clock % cur - sys_clock % ini) / real(sys_clock % cnt) + call system_clock(Info % clock % cur) + wall_time = real(Info % clock % cur - Info % clock % ini) & + / real(Info % clock % cnt) - if(this_proc < 2) then + if(First_Proc()) then ! Write time step number - write(time_info % lines(2)(55:65), '(a11)') 'Time step :' - write(time_info % lines(2)(67:72), '(i6)') n + write(Info % time % line(2)(55:65), '(a11)') 'Time step :' + write(Info % time % line(2)(67:72), '(i6)') n ! Write simulation time - write(time_info % lines(4)(45:61), '(a17)') 'Simulation time :' - write(time_info % lines(4)(63:71), '(1pe9.3)') sim_time - write(time_info % lines(4)(73:83), '(a3)') '[s]' + write(Info % time % line(4)(45:61), '(a17)') 'Simulation time :' + write(Info % time % line(4)(63:71), '(1pe9.3)') sim_time + write(Info % time % line(4)(73:75), '(a3)') '[s]' ! Write wall-clock time - write(time_info % lines(5)(45:61), '(a17)') 'Wall-clock time :' + write(Info % time % line(5)(45:61), '(a17)') 'Wall-clock time :' hours = floor( wall_time / 3600.0 ) minutes = floor( (wall_time - 3600.0 * hours) / 60.0) seconds = floor( wall_time - 3600.0 * hours - 60.0 * minutes ) - write(time_info % lines(5)(63:65), '(i3.3)') hours - write(time_info % lines(5)(66:66), '(a1)') ':' - write(time_info % lines(5)(67:69), '(i2.2)') minutes - write(time_info % lines(5)(69:69), '(a1)') ':' - write(time_info % lines(5)(70:71), '(i2.2)') seconds - write(time_info % lines(5)(73:83), '(a11)') '[hhh:mm:ss]' + write(Info % time % line(5)(63:65), '(i3.3)') hours + write(Info % time % line(5)(66:66), '(a1)') ':' + write(Info % time % line(5)(67:68), '(i2.2)') minutes + write(Info % time % line(5)(69:69), '(a1)') ':' + write(Info % time % line(5)(70:71), '(i2.2)') seconds + write(Info % time % line(5)(73:83), '(a11)') '[hhh:mm:ss]' end if diff --git a/Sources/Process/Info_Mod/Time_Print.f90 b/Sources/Process/Info_Mod/Time_Print.f90 index 7b426f65c..218ad4e4e 100644 --- a/Sources/Process/Info_Mod/Time_Print.f90 +++ b/Sources/Process/Info_Mod/Time_Print.f90 @@ -1,25 +1,27 @@ !==============================================================================! - subroutine Info_Mod_Time_Print() + subroutine Time_Print(Info) !------------------------------------------------------------------------------! ! Prints information about inner iteration on the screen. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info !-----------------------------------[Locals]-----------------------------------! integer :: i !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then print '(a)', '' print '(a)', '' - print '(a90)', trim(time_info % line_lead) + print '(a90)', trim(Info % time % line_lead) ! Print only lines which have colon in the first column :-) - do i=1,6 - print '(a90)', trim(time_info % lines(i)) + do i = 1, 6 + print '(a90)', trim(Info % time % line(i)) end do - print '(a90)', trim(time_info % line_trail) + print '(a90)', trim(Info % time % line_trail) print '(a)', '' end if diff --git a/Sources/Process/Info_Mod/Time_Start.f90 b/Sources/Process/Info_Mod/Time_Start.f90 index a4174679e..2b1c8c929 100644 --- a/Sources/Process/Info_Mod/Time_Start.f90 +++ b/Sources/Process/Info_Mod/Time_Start.f90 @@ -1,37 +1,39 @@ !==============================================================================! - subroutine Info_Mod_Time_Start() + subroutine Time_Start(Info) !------------------------------------------------------------------------------! ! Essentially creates a box in which iteration residuls will be written. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info !-----------------------------------[Locals]-----------------------------------! integer :: i !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then ! Create a frame - time_info % line_lead (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % lines(1) (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % lines(2) (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % lines(3) (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % lines(4) (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % lines(5) (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % lines(6) (2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % line_trail(2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line_lead (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line(1) (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line(2) (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line(3) (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line(4) (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line(5) (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line(6) (2*L_BOX-2 : 2*L_BOX-2) = '#' + Info % time % line_trail(2*L_BOX-2 : 2*L_BOX-2) = '#' - time_info % line_lead (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % lines(1) (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % lines(2) (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % lines(3) (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % lines(4) (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % lines(5) (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % lines(6) (4*L_BOX+4 : 4*L_BOX+4) = '#' - time_info % line_trail(4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line_lead (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line(1) (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line(2) (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line(3) (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line(4) (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line(5) (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line(6) (4*L_BOX+4 : 4*L_BOX+4) = '#' + Info % time % line_trail(4*L_BOX+4 : 4*L_BOX+4) = '#' do i = 2*L_BOX-1, 4*L_BOX+3 - time_info % line_lead (i:i) = '=' - time_info % line_trail(i:i) = '-' + Info % time % line_lead (i:i) = '=' + Info % time % line_trail(i:i) = '-' end do end if diff --git a/Sources/Process/Info_Mod/Time_To_Exit.f90 b/Sources/Process/Info_Mod/Time_To_Exit.f90 index d8b3cf9ed..5aee9c40b 100644 --- a/Sources/Process/Info_Mod/Time_To_Exit.f90 +++ b/Sources/Process/Info_Mod/Time_To_Exit.f90 @@ -1,14 +1,16 @@ !==============================================================================! - logical function Info_Mod_Time_To_Exit() + logical function Time_To_Exit(Info) !------------------------------------------------------------------------------! ! Returns true if it is time to exit Process because maximum wall clock time ! ! has been reached ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Info_Type) :: Info !==============================================================================! - Info_Mod_Time_To_Exit = real(sys_clock % cur - sys_clock % ini) & - / real(sys_clock % cnt) & - > sys_clock % wall_time_max + Time_To_Exit = real(Info % clock % cur - Info % clock % ini) & + / real(Info % clock % cnt) & + > Info % clock % wall_time_max end function diff --git a/Sources/Process/Interface_Mod/Create.f90 b/Sources/Process/Interface_Mod/Create.f90 index 6f07c597c..f584caa1e 100644 --- a/Sources/Process/Interface_Mod/Create.f90 +++ b/Sources/Process/Interface_Mod/Create.f90 @@ -42,9 +42,9 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) call Work % Connect_Int_Face(ic_1, ib_1, ip_1, ic_2, ib_2, ip_2) ! Allocate memory for offsets - if(n_proc > 1) then - allocate(off_1(n_proc)); off_1 = 0 - allocate(off_2(n_proc)); off_2 = 0 + if(Parallel_Run()) then + allocate(off_1(N_Procs())); off_1 = 0 + allocate(off_2(N_Procs())); off_2 = 0 end if !--------------------------------------------! @@ -72,18 +72,18 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) !-----------------------------------------------------------------! ! Try to find specified interface condition between d1 and d2 ! !-----------------------------------------------------------------! - call Control_Mod_Position_At_Three_Keys('INTERFACE_CONDITION', & - trim(problem_name(d1)), & - trim(problem_name(d2)), & - found, & - verbose=.false.) + call Control % Position_At_Three_Keys('INTERFACE_CONDITION', & + trim(problem_name(d1)), & + trim(problem_name(d2)), & + found, & + verbose=.false.) !---------------------------------------------------! ! Found specification between domains d1 and d2 ! !---------------------------------------------------! if(found) then - call Control_Mod_Read_Strings_On('BOUNDARY_CONDITIONS', & - keys, nks, .false.) + call Control % Read_Strings_On('BOUNDARY_CONDITIONS', & + keys, nks, .false.) do k = 1, nks call String % To_Upper_Case(keys(k)) end do @@ -99,7 +99,7 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) do s = 1, Grid(d1) % n_faces c2 = Grid(d1) % faces_c(2,s) if(c2 < 0) then - if(Grid(d1) % Bnd_Cond_Name(c2) .eq. keys(1)) then + if(Grid(d1) % Bnd_Cond_Name_At_Cell(c2) .eq. keys(1)) then n1 = n1 + 1 end if end if @@ -109,8 +109,8 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) do s = 1, Grid(d1) % n_faces if(Grid(d1) % faces_s(s) > 0) then ! only if it has a shadow c1 = Grid(d1) % faces_c(1,s) - if(Grid(d1) % Bnd_Cond_Name(s) .eq. keys(1) .and. & - Grid(d1) % Comm % cell_proc(c1) .eq. this_proc) then + if(Grid(d1) % Bnd_Cond_Name_At_Face(s) .eq. keys(1) .and. & + Grid(d1) % Comm % cell_proc(c1) .eq. This_Proc()) then n1 = n1 + 1 end if end if @@ -124,7 +124,7 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) do s = 1, Grid(d2) % n_faces c2 = Grid(d2) % faces_c(2,s) if(c2 < 0) then - if(Grid(d2) % Bnd_Cond_Name(c2) .eq. keys(2)) then + if(Grid(d2) % Bnd_Cond_Name_At_Cell(c2) .eq. keys(2)) then n2 = n2 + 1 end if end if @@ -134,8 +134,8 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) do s = 1, Grid(d2) % n_faces if(Grid(d2) % faces_s(s) > 0) then ! only if it has a shadow c1 = Grid(d2) % faces_c(1,s) - if(Grid(d2) % Bnd_Cond_Name(s) .eq. keys(2) .and. & - Grid(d2) % Comm % cell_proc(c1) .eq. this_proc) then + if(Grid(d2) % Bnd_Cond_Name_At_Face(s) .eq. keys(2) .and. & + Grid(d2) % Comm % cell_proc(c1) .eq. This_Proc()) then n2 = n2 + 1 end if end if @@ -149,22 +149,20 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) !------------------------------------------! n1_tot = n1 n2_tot = n2 - call Comm_Mod_Global_Sum_Int(n1_tot) - call Comm_Mod_Global_Sum_Int(n2_tot) + call Global % Sum_Int(n1_tot) + call Global % Sum_Int(n2_tot) if(n1_tot .ne. n2_tot) then - if(this_proc < 2) then - print *, '# Number of cells at the interface between ', & - trim(problem_name(d1)), ' and ', & - trim(problem_name(d2)), ' is not the same!' - print *, '# Only conformal mappings are supported. Exiting!' - end if - call Comm_Mod_End - stop + call Message % Error(72, & + 'Number of cells at the interface between '// & + trim(problem_name(d1))//' and '// & + trim(problem_name(d2))//' is not the same! '// & + 'Only conformal mappings are supported. Exiting!', & + file=__FILE__, line=__LINE__, one_proc=.true.) else n_tot = n1_tot inter(d1, d2) % n_tot = n_tot - if(this_proc < 2) then + if(First_Proc()) then print '(5a,i6,a)', ' # Domains ', trim(problem_name(d1)), & ' and ', trim(problem_name(d2)), & ' are connected with ', n_tot, ' interface cells!' @@ -184,15 +182,15 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) inter(d1, d2) % phi_2(:,:) = 0.0 ! Work out offsets for each interface for each processor - if(n_proc > 1) then - off_1(1:n_proc) = 0 - off_2(1:n_proc) = 0 - off_1(this_proc) = n1 - off_2(this_proc) = n2 - call Comm_Mod_Global_Sum_Int_Array(n_proc, off_1) - call Comm_Mod_Global_Sum_Int_Array(n_proc, off_2) - - do p = n_proc, 2, -1 + if(Parallel_Run()) then + off_1(1:N_Procs()) = 0 + off_2(1:N_Procs()) = 0 + off_1(This_Proc()) = n1 + off_2(This_Proc()) = n2 + call Global % Sum_Int_Array(N_Procs(), off_1) + call Global % Sum_Int_Array(N_Procs(), off_2) + + do p = N_Procs(), 2, -1 off_1(p) = sum(off_1(1:p-1)) off_2(p) = sum(off_2(1:p-1)) end do @@ -206,13 +204,13 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) c1 = Grid(d1) % faces_c(1,s) c2 = Grid(d1) % faces_c(2,s) if(c2 < 0) then - if(Grid(d1) % Bnd_Cond_Name(c2) .eq. keys(1)) then + if(Grid(d1) % Bnd_Cond_Name_At_Cell(c2) .eq. keys(1)) then n1 = n1 + 1 pos = n1 - if(n_proc > 1) pos = pos + off_1(this_proc) + if(Parallel_Run()) pos = pos + off_1(This_Proc()) ic_1(pos) = c1 ib_1(pos) = c2 - ip_1(pos) = this_proc + ip_1(pos) = This_Proc() xf_1(pos) = Grid(d1) % xf(s) yf_1(pos) = Grid(d1) % yf(s) zf_1(pos) = Grid(d1) % zf(s) @@ -223,14 +221,14 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) c1 = Grid(d1) % faces_c(1,s) c2 = Grid(d1) % faces_c(2,s) if(Grid(d1) % faces_s(s) > 0) then ! only if it has a shadow - if(Grid(d1) % Bnd_Cond_Name(s) .eq. keys(1) .and. & - Grid(d1) % Comm % cell_proc(c1) .eq. this_proc) then + if(Grid(d1) % Bnd_Cond_Name_At_Face(s) .eq. keys(1) .and. & + Grid(d1) % Comm % cell_proc(c1) .eq. This_Proc()) then n1 = n1 + 1 pos = n1 - if(n_proc > 1) pos = pos + off_1(this_proc) + if(Parallel_Run()) pos = pos + off_1(This_Proc()) ic_1(pos) = c1 ib_1(pos) = c2 - ip_1(pos) = this_proc + ip_1(pos) = This_Proc() xf_1(pos) = Grid(d1) % xf(s) yf_1(pos) = Grid(d1) % yf(s) zf_1(pos) = Grid(d1) % zf(s) @@ -244,13 +242,13 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) c1 = Grid(d2) % faces_c(1,s) c2 = Grid(d2) % faces_c(2,s) if(c2 < 0) then - if(Grid(d2) % Bnd_Cond_Name(c2) .eq. keys(2)) then + if(Grid(d2) % Bnd_Cond_Name_At_Cell(c2) .eq. keys(2)) then n2 = n2 + 1 pos = n2 - if(n_proc > 1) pos = pos + off_2(this_proc) + if(Parallel_Run()) pos = pos + off_2(This_Proc()) ic_2(pos) = c1 ib_2(pos) = c2 - ip_2(pos) = this_proc + ip_2(pos) = This_Proc() xf_2 (pos) = Grid(d2) % xf(s) yf_2 (pos) = Grid(d2) % yf(s) zf_2 (pos) = Grid(d2) % zf(s) @@ -261,14 +259,14 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) c1 = Grid(d2) % faces_c(1,s) c2 = Grid(d2) % faces_c(2,s) if(Grid(d2) % faces_s(s) > 0) then ! only if it has a shadow - if(Grid(d2) % Bnd_Cond_Name(s) .eq. keys(2) .and. & - Grid(d2) % Comm % cell_proc(c1) .eq. this_proc) then + if(Grid(d2) % Bnd_Cond_Name_At_Face(s) .eq. keys(2) .and. & + Grid(d2) % Comm % cell_proc(c1) .eq. This_Proc()) then n2 = n2 + 1 pos = n2 - if(n_proc > 1) pos = pos + off_2(this_proc) + if(Parallel_Run()) pos = pos + off_2(This_Proc()) ic_2(pos) = c1 ib_2(pos) = c2 - ip_2(pos) = this_proc + ip_2(pos) = This_Proc() xf_2 (pos) = Grid(d2) % xf(s) yf_2 (pos) = Grid(d2) % yf(s) zf_2 (pos) = Grid(d2) % zf(s) @@ -279,18 +277,18 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) !----------------------------------------------------------! ! Distribute interface coordinates over all processors ! !----------------------------------------------------------! - call Comm_Mod_Global_Sum_Real_Array(n_tot, xf_1(1:n_tot)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, yf_1(1:n_tot)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, zf_1(1:n_tot)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, xf_2(1:n_tot)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, yf_2(1:n_tot)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, zf_2(1:n_tot)) - call Comm_Mod_Global_Sum_Int_Array (n_tot, ic_1(1:n_tot)) - call Comm_Mod_Global_Sum_Int_Array (n_tot, ib_1(1:n_tot)) - call Comm_Mod_Global_Sum_Int_Array (n_tot, ip_1(1:n_tot)) - call Comm_Mod_Global_Sum_Int_Array (n_tot, ic_2(1:n_tot)) - call Comm_Mod_Global_Sum_Int_Array (n_tot, ib_2(1:n_tot)) - call Comm_Mod_Global_Sum_Int_Array (n_tot, ip_2(1:n_tot)) + call Global % Sum_Real_Array(n_tot, xf_1(1:n_tot)) + call Global % Sum_Real_Array(n_tot, yf_1(1:n_tot)) + call Global % Sum_Real_Array(n_tot, zf_1(1:n_tot)) + call Global % Sum_Real_Array(n_tot, xf_2(1:n_tot)) + call Global % Sum_Real_Array(n_tot, yf_2(1:n_tot)) + call Global % Sum_Real_Array(n_tot, zf_2(1:n_tot)) + call Global % Sum_Int_Array (n_tot, ic_1(1:n_tot)) + call Global % Sum_Int_Array (n_tot, ib_1(1:n_tot)) + call Global % Sum_Int_Array (n_tot, ip_1(1:n_tot)) + call Global % Sum_Int_Array (n_tot, ic_2(1:n_tot)) + call Global % Sum_Int_Array (n_tot, ib_2(1:n_tot)) + call Global % Sum_Int_Array (n_tot, ip_2(1:n_tot)) ! Sort interfaces from domain 1 carrying ! information of cells surrounding it along @@ -311,7 +309,7 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) ip_2(1:n_tot)) ! ! Write some debugging information ! do n = 1, inter(d1, d2) % n_tot -! write(100*this_proc+d1*10+d2, '(i4, 6f10.5)') & +! write(100*This_Proc()+d1*10+d2, '(i4, 6f10.5)') & ! n, & ! xf_1(n), yf_1(n), zf_1(n), & ! xf_2(n), yf_2(n), zf_2(n) @@ -338,7 +336,7 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) do n = 1, inter(d1, d2) % n_tot ! browse through interface now ! Handle domain 1 - if(ip_1(n) .eq. this_proc) then + if(ip_1(n) .eq. This_Proc()) then n1 = n1 + 1 do c = 1, Grid(d1) % n_cells if(c .eq. ic_1(n)) then @@ -352,7 +350,7 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) end if ! Handle domain 2 - if(ip_2(n) .eq. this_proc) then + if(ip_2(n) .eq. This_Proc()) then n2 = n2 + 1 do c = 1, Grid(d2) % n_cells if(c .eq. ic_2(n)) then @@ -373,7 +371,7 @@ subroutine Interface_Mod_Create(inter, Grid, n_dom) end do end do - if(n_proc > 1) then + if(Parallel_Run()) then deallocate(off_1) deallocate(off_2) end if diff --git a/Sources/Process/Interface_Mod/To_Buffer.f90 b/Sources/Process/Interface_Mod/To_Buffer.f90 index 35a5b3dec..e12e8f6d0 100644 --- a/Sources/Process/Interface_Mod/To_Buffer.f90 +++ b/Sources/Process/Interface_Mod/To_Buffer.f90 @@ -62,8 +62,8 @@ subroutine Interface_Mod_To_Buffer(inter, var1, var2, v, boundary) end do ! Here we exchange (global sum) of phi_1 and phi_2 - call Comm_Mod_Global_Sum_Real_Array(n_tot, inter % phi_1(1:n_tot,v)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, inter % phi_2(1:n_tot,v)) + call Global % Sum_Real_Array(n_tot, inter % phi_1(1:n_tot,v)) + call Global % Sum_Real_Array(n_tot, inter % phi_2(1:n_tot,v)) end if diff --git a/Sources/Process/Iter_Mod.f90 b/Sources/Process/Iter_Mod.f90 new file mode 100644 index 000000000..82d87b5c0 --- /dev/null +++ b/Sources/Process/Iter_Mod.f90 @@ -0,0 +1,55 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Unused.h90" + +!==============================================================================! + module Iter_Mod +!------------------------------------------------------------------------------! +! Module containing data and procedures pertinent to SIMPLE/PISO iterations ! +!------------------------------------------------------------------------------! +!----------------------------------[Modules]-----------------------------------! + use Field_Mod +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + !---------------! + ! Iter type ! + !---------------! + type Iter_Type + + integer, private :: current_iteration = 0 + integer, private :: max_iterations ! maximum number of iterations + integer, private :: min_iterations ! minimum number of iterations + real, private :: tolerance ! tolerance for iterations + + contains + procedure :: Current + procedure :: Get_Max + procedure :: Get_Min + procedure :: Get_Tol + procedure :: Max_Fields_Residual + procedure :: Needs_More_Iterations + procedure :: Set_Max + procedure :: Set_Min + procedure :: Set_Tol + + end type + + !----------------------! + ! Singleton object ! + !----------------------! + type(Iter_Type) :: Iter + + contains + +# include "Iter_Mod/Current.f90" +# include "Iter_Mod/Get_Max.f90" +# include "Iter_Mod/Get_Min.f90" +# include "Iter_Mod/Get_Tol.f90" +# include "Iter_Mod/Max_Fields_Residual.f90" +# include "Iter_Mod/Needs_More_Iterations.f90" +# include "Iter_Mod/Set_Max.f90" +# include "Iter_Mod/Set_Min.f90" +# include "Iter_Mod/Set_Tol.f90" + + end module diff --git a/Sources/Process/Iter_Mod/Current.f90 b/Sources/Process/Iter_Mod/Current.f90 new file mode 100644 index 000000000..82e291de5 --- /dev/null +++ b/Sources/Process/Iter_Mod/Current.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure integer function Current(Iter) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(in) :: Iter +!==============================================================================! + + Current = Iter % current_iteration + + end function diff --git a/Sources/Process/Iter_Mod/Get_Max.f90 b/Sources/Process/Iter_Mod/Get_Max.f90 new file mode 100644 index 000000000..52cdf4c2e --- /dev/null +++ b/Sources/Process/Iter_Mod/Get_Max.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure integer function Get_Max(Iter) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(in) :: Iter +!==============================================================================! + + Get_Max = Iter % max_iterations + + end function diff --git a/Sources/Process/Iter_Mod/Get_Min.f90 b/Sources/Process/Iter_Mod/Get_Min.f90 new file mode 100644 index 000000000..8c71fb273 --- /dev/null +++ b/Sources/Process/Iter_Mod/Get_Min.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure integer function Get_Min(Iter) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(in) :: Iter +!==============================================================================! + + Get_Min = Iter % min_iterations + + end function diff --git a/Sources/Process/Iter_Mod/Get_Tol.f90 b/Sources/Process/Iter_Mod/Get_Tol.f90 new file mode 100644 index 000000000..b9bc992b3 --- /dev/null +++ b/Sources/Process/Iter_Mod/Get_Tol.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure real function Get_Tol(Iter) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(in) :: Iter +!==============================================================================! + + Get_Tol = Iter % tolerance + + end function diff --git a/Sources/Process/Iter_Mod/Max_Fields_Residual.f90 b/Sources/Process/Iter_Mod/Max_Fields_Residual.f90 new file mode 100644 index 000000000..4a64ee2eb --- /dev/null +++ b/Sources/Process/Iter_Mod/Max_Fields_Residual.f90 @@ -0,0 +1,32 @@ +!==============================================================================! + pure real function Max_Fields_Residual(Iter, Flow, n_dom) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(in) :: Iter + type(Field_Type), intent(in) :: Flow(MD) + integer, intent(in) :: n_dom +!-----------------------------------[Locals]-----------------------------------! + integer :: d, sc + real :: mr +!==============================================================================! + + mr = 0.0 + + do d = 1, n_dom + mr = max(mr, Flow(d) % vol_res) + mr = max(mr, Flow(d) % u % res) + mr = max(mr, Flow(d) % v % res) + mr = max(mr, Flow(d) % w % res) + if(Flow(d) % heat_transfer) then + mr = max(mr, Flow(d) % t % res) + end if + do sc = 1, Flow(d) % n_scalars + mr = max(mr, Flow(d) % scalar(sc) % res) + end do + end do + + Max_Fields_Residual = mr + + end function + diff --git a/Sources/Process/Iter_Mod/Needs_More_Iterations.f90 b/Sources/Process/Iter_Mod/Needs_More_Iterations.f90 new file mode 100644 index 000000000..36b0c95aa --- /dev/null +++ b/Sources/Process/Iter_Mod/Needs_More_Iterations.f90 @@ -0,0 +1,53 @@ +!==============================================================================! + logical function Needs_More_Iterations(Iter, Flow, n_dom) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(inout) :: Iter + type(Field_Type), intent(in) :: Flow(MD) + integer, intent(in) :: n_dom +!==============================================================================! + + !--------------------------------! + ! Increase current iteration ! + !--------------------------------! + Iter % current_iteration = Iter % current_iteration + 1 + + !------------------------------------------------------------------! + ! Minimum number of iterations hasn't been reached -> continue ! + !------------------------------------------------------------------! + if(Iter % Current() .le. Iter % Get_Min()) then + Needs_More_Iterations = .true. + return + end if + + !-----------------------------------------------------------! + ! Maximum number of iterations has been reached -> stop ! + !-----------------------------------------------------------! + if(Iter % Current() .gt. Iter % Get_Max()) then + Iter % current_iteration = 0 + Needs_More_Iterations = .false. + return + end if + + !--------------------------------------------! + ! You are in between minimum and maximum ! + ! number of iterations, check residuals ! + !--------------------------------------------! + + ! Residuals reached the tolerance level -> stop + if(Iter % Max_Fields_Residual(Flow, n_dom) <= Iter % Get_Tol()) then + Iter % current_iteration = 0 + Needs_More_Iterations = .false. + return + + ! Residuals did not reached the tolerance level -> continue + else + Needs_More_Iterations = .true. + return + end if + + ! You shouldn't be here + Assert(.false.) + + end function diff --git a/Sources/Process/Iter_Mod/Set_Max.f90 b/Sources/Process/Iter_Mod/Set_Max.f90 new file mode 100644 index 000000000..a68111070 --- /dev/null +++ b/Sources/Process/Iter_Mod/Set_Max.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_Max(Iter, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(inout) :: Iter + integer, intent(in) :: val +!==============================================================================! + + Iter % max_iterations = val + + end subroutine diff --git a/Sources/Process/Iter_Mod/Set_Min.f90 b/Sources/Process/Iter_Mod/Set_Min.f90 new file mode 100644 index 000000000..eb5f77807 --- /dev/null +++ b/Sources/Process/Iter_Mod/Set_Min.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_Min(Iter, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(inout) :: Iter + integer, intent(in) :: val +!==============================================================================! + + Iter % min_iterations = val + + end subroutine diff --git a/Sources/Process/Iter_Mod/Set_Tol.f90 b/Sources/Process/Iter_Mod/Set_Tol.f90 new file mode 100644 index 000000000..26b0acf1a --- /dev/null +++ b/Sources/Process/Iter_Mod/Set_Tol.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_Tol(Iter, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Iter_Type), intent(inout) :: Iter + real, intent(in) :: val +!==============================================================================! + + Iter % tolerance = val + + end subroutine diff --git a/Sources/Process/Main_Pro.f90 b/Sources/Process/Main_Pro.f90 index 286789592..c1b52a20b 100644 --- a/Sources/Process/Main_Pro.f90 +++ b/Sources/Process/Main_Pro.f90 @@ -9,7 +9,7 @@ program Process_Prog !----------------------------------[Locals]------------------------------------! character(len=7) :: root_control = 'control' character(len=9) :: dom_control(MD) = 'control.d' - integer :: curr_dt, sc, tp + integer :: sc, tp, ldt logical :: read_backup(MD), exit_now, pot_init type(Grid_Type) :: Grid(MD) ! grid used in computations type(Field_Type) :: Flow(MD) ! flow field we will be solving for @@ -21,18 +21,10 @@ program Process_Prog type(Monitor_Type) :: monitor(MD) ! monitors type(Porosity_Type) :: Por(MD) ! porosity type(Interface_Type) :: inter(MD,MD) ! interfaces between domains - real :: time ! physical time of the simulation - integer :: first_dt ! first time step in this run - integer :: last_dt ! number of time steps - integer :: max_ini ! max number of inner iterations - integer :: min_ini ! min number of inner iterations integer :: n_stat_t ! first time step for turb. statistic integer :: n_stat_p ! first time step for swarm statistic integer :: first_dt_p ! first t.s. for swarm computation - integer :: ini ! inner iteration counter - real :: simple_tol ! tolerance for SIMPLE algorithm - integer :: n_dom ! number of domains - integer :: d ! domain counter + integer :: n_dom, d ! number of domains, domain counter !==============================================================================! ! Initialize program profler @@ -45,13 +37,13 @@ program Process_Prog end do ! Initialize variables - time = 0. ! initialize time to zero - read_backup(:) = .false. ! can turn .true. in Load_Backup + call Time % Set_Time(0.0) ! initialize time to zero + read_backup(:) = .false. ! can turn .true. in Load_Backup !------------------------------! ! Start parallel execution ! !------------------------------! - call Comm_Mod_Start + call Global % Start_Parallel !--------------------------------! ! Splash out the logo screen ! @@ -61,58 +53,48 @@ program Process_Prog !-----------------------! ! Open control file ! !-----------------------! - call Control_Mod_Open_Root_File(root_control) + call Control % Open_Root_File(root_control) - call Control_Mod_Number_Of_Domains(n_dom) + call Control % Number_Of_Domains(n_dom) if(n_dom > 1) then do d = 1, n_dom - call Control_Mod_Open_Domain_File(d, dom_control(d)) + call Control % Open_Domain_File(d, dom_control(d)) end do end if !-------------------------! ! Initialize Info_Mod ! !-------------------------! - call Info_Mod_Start() + call Info % Start_Info() - !--------------------! - ! Read all grids ! - !--------------------! + !-----------------------------------------------! + ! Load and prepare all grids for processing ! + !-----------------------------------------------! do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) ! take domain's d control file - call Control_Mod_Problem_Name(problem_name(d)) - - ! Load the finite volume Grid - call Grid(d) % Load_Cfn(this_proc, domain=d) - call Grid(d) % Load_Dim(this_proc, domain=d) - call Grid(d) % Calculate_Face_Geometry() - - ! Find communication patterns - call Grid(d) % Form_Cells_Comm() - call Grid(d) % Form_Maps() + call Control % Switch_To_Domain(d) ! take domain's d control file + call Grid(d) % Load_And_Prepare_For_Processing(d) end do - - ! Out of domain loop - go back to root - call Control_Mod_Switch_To_Root() + call Control % Switch_To_Root() ! out of domain loop - go back to root ! Allocate memory for working arrays (RSM models are memory hungry) call Work % Allocate_Work(Grid, n_r_cell=24, n_r_face=8, n_r_node=8, & n_i_cell= 8, n_i_face=8, n_i_node=8) ! Initialize first and current and read the last time step - curr_dt = 0 - first_dt = 0 - call Control_Mod_Number_Of_Time_Steps(last_dt, verbose=.true.) - call Control_Mod_Starting_Time_Step_For_Turb_Statistics(n_stat_t, & + call Time % Set_Curr_Dt(0) + call Time % Set_First_Dt(0) + call Control % Number_Of_Time_Steps(ldt, verbose=.true.) + call Time % Set_Last_Dt(ldt) + call Control % Starting_Time_Step_For_Turb_Statistics(n_stat_t, & + verbose = .true.) + call Control % Starting_Time_Step_For_Swarm_Statistics(n_stat_p, & + verbose = .true.) + call Control % Starting_Time_Step_For_Swarm_Computation(first_dt_p, & verbose = .true.) - call Control_Mod_Starting_Time_Step_For_Swarm_Statistics(n_stat_p, & - verbose = .true.) - call Control_Mod_Starting_Time_Step_For_Swarm_Computation(first_dt_p, & - verbose = .true.) ! Read physical models for each domain from control file do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) ! take proper control file + call Control % Switch_To_Domain(d) ! take proper control file call Read_Control % Physical_Models(Flow(d), Turb(d), Vof(d), Swarm(d)) end do @@ -120,20 +102,20 @@ program Process_Prog ! Allocate memory for all variables (over all domains) ! !----------------------------------------------------------! do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) ! take proper control file + call Control % Switch_To_Domain(d) ! take proper control file call Flow(d) % Allocate_Field(Grid(d)) call Turb(d) % Allocate_Turb(Flow(d)) call Vof(d) % Allocate_Vof(Flow(d)) call Swarm(d) % Allocate_Swarm(Flow(d), Turb(d), Vof(d)) ! Read time step from root - call Control_Mod_Switch_To_Root() - call Control_Mod_Time_Step(Flow(d) % dt, verbose=.true.) - call Control_Mod_Switch_To_Domain(d) ! go back to local domain's control + call Control % Switch_To_Root() + call Control % Time_Step(Flow(d) % dt, verbose=.true.) + call Control % Switch_To_Domain(d) ! go back to local domain's control ! Read numerical models from control file (after the memory is allocated) - call Read_Control % Numerical_Schemes(Flow(d), Turb(d), Vof(d), Sol(d)) - call Read_Control % Linear_Solvers (Flow(d), Turb(d), Vof(d), Sol(d)) + call Read_Control % Numerical_Schemes(Flow(d), Turb(d), Vof(d)) + call Read_Control % Solvers(Flow(d), Turb(d), Vof(d), Sol(d)) call Grid(d) % Find_Nodes_Cells() call Grid(d) % Calculate_Weights_Cells_To_Nodes() ! needed for front @@ -150,14 +132,13 @@ program Process_Prog end do ! Create interfaces - call Control_Mod_Switch_To_Root() + call Control % Switch_To_Root() call Interface_Mod_Create(inter, Grid, n_dom) ! Read backup file if directed so, and set the "backup" to .true. or .false. do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) ! take proper control file - call Backup_Mod_Load(Flow(d), Turb(d), Vof(d), Swarm(d), & - time, first_dt, read_backup(d)) + call Control % Switch_To_Domain(d) ! take proper control file + call Backup % Load(Flow(d), Turb(d), Vof(d), Swarm(d), read_backup(d)) ! Initialize variables if(.not. read_backup(d)) then @@ -178,10 +159,9 @@ program Process_Prog call Por(d) % Create_Porosity(Grid(d)) ! Plane for calcution of overall mass fluxes - call Control_Mod_Point_For_Monitoring_Planes(Flow(d) % bulk % xp, & - Flow(d) % bulk % yp, & - Flow(d) % bulk % zp) - + call Control % Point_For_Monitoring_Planes(Flow(d) % bulk % xp, & + Flow(d) % bulk % yp, & + Flow(d) % bulk % zp) ! Prepare ... call Bulk_Mod_Monitoring_Planes_Areas(Flow(d) % bulk, Grid(d)) @@ -198,13 +178,12 @@ program Process_Prog ! Time loop ! ! ! !---------------! - - call Control_Mod_Switch_To_Root() - call Control_Mod_Backup_Save_Interval (backup % interval, verbose=.true.) - call Control_Mod_Results_Save_Interval (Results % interval, verbose=.true.) - call Control_Mod_Save_Initial_Condition(Results % initial, verbose=.true.) - call Control_Mod_Save_Results_At_Boundaries(Results % boundary) - call Control_Mod_Swarm_Save_Interval(Results % interval_swarm, verbose=.true.) + call Control % Switch_To_Root() + call Control % Backup_Save_Interval (backup % interval, verbose=.true.) + call Control % Results_Save_Interval (Results % interval, verbose=.true.) + call Control % Save_Initial_Condition(Results % initial, verbose=.true.) + call Control % Save_Results_At_Boundaries(Results % boundary) + call Control % Swarm_Save_Interval(Results % interval_swarm, verbose=.true.) !-------------------------------------------------------! ! Compute wall distance - it is not saved in backup ! @@ -217,38 +196,33 @@ program Process_Prog !-------------------------------------------------------------! ! Perform potential initialization in the first time step ! !-------------------------------------------------------------! - if(first_dt .eq. 0) then + if(Time % First_Dt() .eq. 0) then do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) ! not sure if this call is needed - call Control_Mod_Potential_Initialization(pot_init, .true.) - if(pot_init) call Flow(d) % Potential_Initialization(Sol(d)) + call Control % Switch_To_Domain(d) ! not sure if this call is needed + call Control % Potential_Initialization(pot_init, .true.) + if(pot_init) call Flow(d) % Potential_Initialisation(Sol(d)) end do end if ! Good time to call user function for beginning of simulation do d = 1, n_dom - call User_Mod_Beginning_Of_Simulation(Flow(d), Turb(d), & - Vof(d), Swarm(d), & - first_dt, time) + call User_Mod_Beginning_Of_Simulation(Flow(d), Turb(d), Vof(d), Swarm(d)) end do ! Save initial condition - if(first_dt .eq. 0 .and. Results % initial) then - call Results % Main_Results(curr_dt, last_dt, time, n_dom, & - Flow, Turb, Vof, Swarm, exit_now) - end if + call Results % Main_Results(n_dom, Flow, Turb, Vof, Swarm, exit_now) !-------------------------------------! ! The time loop really begins now ! !-------------------------------------! - do curr_dt = first_dt + 1, last_dt + do while (Time % Needs_More_Steps()) !------------------------------------! ! Preparations for new time step ! !------------------------------------! do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) ! not sure if this call is needed + call Control % Switch_To_Domain(d) ! not sure if this call is needed ! Update turbulent planes do tp = 1, turb_planes(d) % n_planes @@ -256,21 +230,20 @@ program Process_Prog call Eddies_Mod_Advance (turb_planes(d) % plane(tp)) end do - if(d .eq. 1) time = time + Flow(d) % dt + if(d .eq. 1) call Time % Increase_Time(Flow(d) % dt) ! Beginning of time step - call User_Mod_Beginning_Of_Time_Step(Flow(d), Turb(d), Vof(d), & - Swarm(d), curr_dt, time) + call User_Mod_Beginning_Of_Time_Step(Flow(d), Turb(d), Vof(d), Swarm(d)) - ! Start info boxes. - call Info_Mod_Time_Start() - call Info_Mod_Iter_Start() - call Info_Mod_Bulk_Start() + ! Start info boxes + call Info % Time_Start() + call Info % Iter_Start() + call Info % Bulk_Start() ! Initialize and print time info box if(d .eq. 1) then - call Info_Mod_Time_Fill(curr_dt, time) - call Info_Mod_Time_Print() + call Info % Time_Fill(Time % Curr_Dt(), Time % Get_Time()) + call Info % Time_Print() end if ! Turbulence models initializations @@ -279,14 +252,13 @@ program Process_Prog ! Interface tracking if(Flow(d) % with_interface) then call Process % Update_Boundary_Values(Flow(d), Turb(d), Vof(d), 'VOF') - call Vof(d) % Main_Vof(Flow(d), Turb(d), Sol(d), curr_dt) + call Vof(d) % Main_Vof(Flow(d), Turb(d), Sol(d)) call Vof(d) % Update_Physical_Properties() end if ! Lagrangian particle tracking if(Flow(d) % with_particles) then - call User_Mod_Insert_Particles(Flow(d), Turb(d), Vof(d), & - Swarm(d), curr_dt, time) + call User_Mod_Insert_Particles(Flow(d), Turb(d), Vof(d), Swarm(d)) end if end do ! through domains @@ -294,28 +266,24 @@ program Process_Prog !--------------------------! ! Inner-iteration loop ! !--------------------------! - call Control_Mod_Switch_To_Root() - call Control_Mod_Max_Simple_Iterations(max_ini) - call Control_Mod_Min_Simple_Iterations(min_ini) - call Control_Mod_Tolerance_For_Simple_Algorithm(simple_tol) + call Control % Switch_To_Root() + call Read_Control % Iterations() - do ini = 1, max_ini + do while (Iter % Needs_More_Iterations(Flow, n_dom)) ! Exchange data between domains call User_Mod_Interface_Exchange(inter, Flow, Turb, Vof, Swarm, n_dom) do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) + call Control % Switch_To_Domain(d) ! Beginning of iteration - call User_Mod_Beginning_Of_Iteration(Flow(d), Turb(d), Vof(d), & - Swarm(d), curr_dt, time) + call User_Mod_Beginning_Of_Iteration(Flow(d), Turb(d), Vof(d), Swarm(d)) - call Info_Mod_Iter_Fill(ini) + call Info % Iter_Fill(Iter % Current()) - ! Future? call Process % Simple_Step(Flow(d), Turb(d), Vof(d), & - ! Future? Sol(d), curr_dt, ini) + ! Future? call Process % Simple_Step(Flow(d), Turb(d), Vof(d), Sol(d)) ! Compute velocity gradients call Flow(d) % Grad_Variable(Flow(d) % u) @@ -324,114 +292,95 @@ program Process_Prog ! All three velocity components one after another call Process % Compute_Momentum(Flow(d), Turb(d), Vof(d), Por(d), & - Sol(d), curr_dt, ini) - call Process % Compute_Pressure(Flow(d), Vof(d), Sol(d), curr_dt, ini) - call Process % Correct_Velocity(Flow(d), Vof(d), Sol(d), curr_dt, ini) + Sol(d)) + call Process % Compute_Pressure(Flow(d), Vof(d), Sol(d)) + call Process % Correct_Velocity(Flow(d), Vof(d), Sol(d)) - call Process % Piso_Algorithm(Flow(d), Turb(d), Vof(d), Por(d), & - Sol(d), curr_dt, ini) + call Process % Piso_Algorithm(Flow(d), Turb(d), Vof(d), Por(d), Sol(d)) - call Flow(d) % Calculate_Fluxes(Flow(d) % v_flux % n) + call Flow(d) % Calculate_Bulk_Fluxes(Flow(d) % v_flux % n) - ! Deal with turbulence (if you dare ;-)) - call Turb(d) % Main_Turb(Sol(d), curr_dt, ini) + ! Deal with turbulence + call Turb(d) % Main_Turb(Sol(d)) ! Energy (practically temperature) - if(Flow(d) % heat_transfer) then - call Process % Compute_Energy(Flow(d), Turb(d), Vof(d), & - Sol(d), curr_dt, ini) - end if + call Process % Compute_Energy(Flow(d), Turb(d), Vof(d), Sol(d)) ! Passive scalars do sc = 1, Flow(d) % n_scalars - call Process % Compute_Scalar(Flow(d), Turb(d), Vof(d), & - Sol(d), curr_dt, ini, sc) + call Process % Compute_Scalar(Flow(d), Turb(d), Vof(d), Sol(d), sc) end do ! Update the values at boundaries call Process % Update_Boundary_Values(Flow(d), Turb(d), Vof(d), 'ALL') ! End of the current iteration - call Info_Mod_Iter_Print(d) + call Info % Iter_Print(d) ! End of iteration - call User_Mod_End_Of_Iteration(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, time) - end do ! through domains + call User_Mod_End_Of_Iteration(Flow(d), Turb(d), Vof(d), Swarm(d)) - if(ini >= min_ini) then - if( maxval(Flow(1:n_dom) % u % res) <= simple_tol .and. & - maxval(Flow(1:n_dom) % v % res) <= simple_tol .and. & - maxval(Flow(1:n_dom) % w % res) <= simple_tol .and. & - maxval(Flow(1:n_dom) % t % res) <= simple_tol .and. & - maxval(Flow(1:n_dom) % vol_res) <= simple_tol ) goto 1 - end if + end do ! through domains - end do ! through inner iterations + end do ! through outer iterations !----------------------------------! ! End of the current time step ! !----------------------------------! -1 continue - do d = 1, n_dom - call Process % Convective_Outflow(Flow(d), Turb(d), Vof(d), curr_dt) + call Process % Convective_Outflow(Flow(d), Turb(d), Vof(d)) end do do d = 1, n_dom - call Info_Mod_Bulk_Print(Flow(d), d, n_dom) + call Info % Bulk_Print(Flow(d), d, n_dom) end do do d = 1, n_dom - - call Control_Mod_Switch_To_Domain(d) + call Control % Switch_To_Domain(d) ! Write the values in monitoring points - call Monitor(d) % Write_Vars(Flow(d), curr_dt) + call Monitor(d) % Write_Vars(Flow(d), Time % Curr_Dt()) ! Calculate mean values - call Turb(d) % Calculate_Mean(n_stat_t, curr_dt) - call User_Mod_Calculate_Mean(Turb(d), n_stat_t, curr_dt) + call Turb(d) % Calculate_Mean(n_stat_t) + call User_Mod_Calculate_Mean(Turb(d), n_stat_t) ! Adjust pressure drops to keep the mass fluxes constant call Bulk_Mod_Adjust_P_Drops(Flow(d) % bulk, Flow(d) % dt) ! Lagrangian particle tracking if(Flow(d) % with_particles) then - if(curr_dt >= first_dt_p) then - call Swarm_Mod_Advance_Particles(Swarm(d), curr_dt, & - n_stat_p, first_dt_p) + if(Time % Curr_Dt() >= first_dt_p) then + call Swarm_Mod_Advance_Particles(Swarm(d), n_stat_p, first_dt_p) end if end if ! Just before the end of time step call User_Mod_End_Of_Time_Step(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) end do !----------------------! ! Save the results ! !----------------------! - call Results % Main_Results(curr_dt, last_dt, time, n_dom, & - Flow, Turb, Vof, Swarm, exit_now) + call Results % Main_Results(n_dom, Flow, Turb, Vof, Swarm, exit_now) ! Ran more than a set wall clock time limit - if(Info_Mod_Time_To_Exit() .or. exit_now) then + if(Info % Time_To_Exit() .or. exit_now) then goto 2 end if ! Last time step reached; call user function for end of simulation - if(curr_dt .eq. last_dt) then + if(Time % Curr_Dt() .eq. Time % Last_Dt()) then do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) - call User_Mod_End_Of_Simulation(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, time) + call Control % Switch_To_Domain(d) + call User_Mod_End_Of_Simulation(Flow(d), Turb(d), Vof(d), Swarm(d)) end do end if end do ! curr_dt until the last time step -2 if(this_proc < 2) print *, '# Exiting !' +2 if(First_Proc()) print *, '# Exiting !' do d = 1, n_dom ! Close monitoring files @@ -446,7 +395,7 @@ program Process_Prog ! Finalize the program profler call Profiler % Stop('Main') - call Profiler % Statistics(indent=34) + call Profiler % Statistics(indent=33) !--------------------------! ! Finalize the solvers ! @@ -458,6 +407,6 @@ program Process_Prog !----------------------------! ! End parallel execution ! !----------------------------! - call Comm_Mod_End + call Global % End_Parallel end program diff --git a/Sources/Process/Monitor_Mod/Initialize.f90 b/Sources/Process/Monitor_Mod/Initialize.f90 index 7ae04c327..b30b69bdb 100644 --- a/Sources/Process/Monitor_Mod/Initialize.f90 +++ b/Sources/Process/Monitor_Mod/Initialize.f90 @@ -24,8 +24,8 @@ subroutine Initialize(Monitor, Flow, restart, domain) Monitor % pnt_grid => Grid ! Read number of Monitoring points from control file - call Control_Mod_Read_Int_Item('NUMBER_OF_MONITORING_POINTS', 0, & - Monitor % n_points, .true.) + call Control % Read_Int_Item('NUMBER_OF_MONITORING_POINTS', 0, & + Monitor % n_points, .true.) if(Monitor % n_points .eq. 0) return @@ -46,7 +46,7 @@ subroutine Initialize(Monitor, Flow, restart, domain) write(point_name, '(a,i3.3)') 'MONITORING_POINT_', n def = 0. ! don't have a better idea what to set - call Control_Mod_Read_Real_Array(point_name, 3, def, xyz, .true.) + call Control % Read_Real_Vector(point_name, 3, def, xyz, .true.) Monitor % x(n) = xyz(1) Monitor % y(n) = xyz(2) @@ -81,9 +81,9 @@ subroutine Initialize(Monitor, Flow, restart, domain) end do ! Check if smaller distance is found on another processor - if(n_proc > 1) then + if(Parallel_Run()) then min_dist_all = min_dist(m) - call Comm_Mod_Global_Min_Real(min_dist_all) + call Global % Min_Real(min_dist_all) ! If there is, erase Monitoring point at this_proc if(abs(min_dist_all - min_dist(m)) >= TINY) then diff --git a/Sources/Process/Native_Mod.f90 b/Sources/Process/Native_Mod.f90 index 1da0aa136..7cfebf1d7 100644 --- a/Sources/Process/Native_Mod.f90 +++ b/Sources/Process/Native_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Unused.h90" + !==============================================================================! module Native_Mod !------------------------------------------------------------------------------! @@ -25,9 +27,6 @@ module Native_Mod ! Matrix for discretized momentum equations type(Matrix_Type) :: M - ! Preconditioning matrix for all variables (used inside solvers only) - type(Matrix_Type), private :: D - ! Right-hand side for all variables ! (used in solvers and during discretization) type(Vector_Type) :: b @@ -35,7 +34,6 @@ module Native_Mod contains procedure, private :: Bicg ! bicg solver procedure, private :: Cg ! cg solver - procedure, private :: Cgs ! cgs solver procedure :: Create_Native procedure, private :: Normalized_Root_Mean_Square procedure, private :: Prec_Form @@ -50,7 +48,6 @@ module Native_Mod # include "Native_Mod/Bicg.f90" # include "Native_Mod/Cg.f90" -# include "Native_Mod/Cgs.f90" # include "Native_Mod/Create_Native.f90" # include "Native_Mod/Normalized_Root_Mean_Square.f90" # include "Native_Mod/Prec_Form.f90" diff --git a/Sources/Process/Native_Mod/Bicg.f90 b/Sources/Process/Native_Mod/Bicg.f90 index 39d750434..0e1bce90d 100644 --- a/Sources/Process/Native_Mod/Bicg.f90 +++ b/Sources/Process/Native_Mod/Bicg.f90 @@ -5,33 +5,38 @@ subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization + class(Native_Type), target, intent(in) :: Nat + type(Matrix_Type), target, intent(in) :: A + real, intent(out) :: x(-Nat % pnt_grid % n_bnd_cells:& + Nat % pnt_grid % n_cells) + real, intent(inout) :: b( Nat % pnt_grid % n_cells) + character(SL), intent(in) :: prec ! preconditioner + integer, intent(in) :: miter ! maximum and actual ... + integer, intent(out) :: niter ! ... num. of iterations + real, intent(in) :: tol ! tolerance + real, intent(out) :: fin_res ! final residual + real, optional, intent(in) :: norm ! normalization !-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - type(Grid_Type), pointer :: Grid - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter - real :: sum_a, fn - integer :: sum_n - real, contiguous, pointer :: p1(:), q1(:), r1(:), p2(:), q2(:), r2(:) + type(Grid_Type), pointer :: Grid + integer :: nt, ni, nb + real :: alfa, beta, rho, rho_old, bnrm2, res + integer :: i, j, k, iter + real :: sum_a, fn + integer :: sum_n + real, contiguous, pointer :: p1(:), q1(:), r1(:), p2(:), q2(:), r2(:) + real, contiguous, pointer :: d(:), d_inv(:) + real, contiguous, pointer :: a_val(:) + integer, contiguous, pointer :: a_col(:), a_row(:), a_dia(:) !==============================================================================! - call Work % Connect_Real_Cell(p1, q1, r1, p2, q2, r2) + call Work % Connect_Real_Cell(p1, q1, r1, p2, q2, r2, d, d_inv) ! Take some aliases - Grid => Nat % pnt_grid - D => Nat % D + Grid => Nat % pnt_grid + a_val => A % val + a_col => A % col + a_row => A % row + a_dia => A % dia nt = Grid % n_cells ni = Grid % n_cells - Grid % Comm % n_buff_cells @@ -44,25 +49,32 @@ subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !--------------------------! sum_a = 0.0 sum_n = 0 + !$omp parallel do private(i) shared(a_val, a_dia) & + !$omp reduction(+ : sum_a) reduction(+ : sum_n) do i = 1, ni - sum_a = sum_a + A % val(A % dia(i)) + sum_a = sum_a + a_val(a_dia(i)) sum_n = sum_n + 1 end do - call Comm_Mod_Global_Sum_Real(sum_a) - call Comm_Mod_Global_Sum_Int (sum_n) ! this is stored somewhere, check + !$omp end parallel do + + call Global % Sum_Real(sum_a) + call Global % Sum_Int (sum_n) ! this is stored somewhere, check + sum_a = sum_a / sum_n fn = 1.0 / sum_a + !$omp parallel do private(i, j) shared(a_row, a_val, b, fn) do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) * fn + do j = a_row(i), a_row(i+1)-1 + a_val(j) = a_val(j) * fn end do b(i) = b(i) * fn end do + !$omp end parallel do !---------------------! ! Preconditioning ! !---------------------! - call Nat % Prec_Form(ni, A, D, prec) + call Nat % Prec_Form(ni, A, d(1:nt), d_inv(1:nt), prec) !-----------------------------------! ! This is quite tricky point. ! @@ -97,9 +109,11 @@ subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !-----------------------! ! Choose initial r~ ! !-----------------------! + !$omp parallel do private(i) shared(r2, r1) do i = 1, ni r2(i) = r1(i) end do + !$omp end parallel do !---------------! ! ! @@ -113,26 +127,35 @@ subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) ! solve M^T z~ = r~ ! don't have M^T!!! ! (q instead of z) ! !------------------------! - call Nat % Prec_Solve(ni, A, D, q1(1:nt), r1(1:nt), prec) - call Nat % Prec_Solve(ni, A, D, q2(1:nt), r2(1:nt), prec) + call Nat % Prec_Solve(ni, A, d(1:nt), d_inv(1:nt), q1(1:nt), r1(1:nt), prec) + call Nat % Prec_Solve(ni, A, d(1:nt), d_inv(1:nt), q2(1:nt), r2(1:nt), prec) !------------------! ! rho = (z,r~) ! !------------------! - rho = dot_product(q1(1:ni), r2(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) + rho = 0.0 + !$omp parallel do private(i) shared(q1, r2) reduction(+ : rho) + do i = 1, ni + rho = rho + q1(i) * r2(i) + end do + !$omp end parallel do + call Global % Sum_Real(rho) if(iter .eq. 1) then + !$omp parallel do private(i) shared(p1, q1, p2, q2) do i = 1, ni p1(i) = q1(i) p2(i) = q2(i) end do + !$omp end parallel do else beta = rho / rho_old + !$omp parallel do private(i) shared(p1, p2, q1, q2, beta) do i = 1, ni p1(i) = q1(i) + beta * p1(i) p2(i) = q2(i) + beta * p2(i) end do + !$omp end parallel do end if !---------------! @@ -141,33 +164,42 @@ subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !---------------! call Grid % Exchange_Cells_Real(p1(-nb:ni)) call Grid % Exchange_Cells_Real(p2(-nb:ni)) + !$omp parallel do private(i, j, k) & + !$omp shared(p1, q1, p2, q2, a_row, a_col, a_val) do i = 1, ni q1(i) = 0.0 q2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q1(i) = q1(i) + A % val(j) * p1(k) - q2(i) = q2(i) + A % val(j) * p2(k) + do j = a_row(i), a_row(i+1)-1 + k = a_col(j) + q1(i) = q1(i) + a_val(j) * p1(k) + q2(i) = q2(i) + a_val(j) * p2(k) end do end do + !$omp end parallel do !----------------------! ! alfa = rho/(p,q) ! !----------------------! alfa = 0.0 - alfa = alfa + dot_product(p2(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) + !$omp parallel do private(i) shared(p2, q1) reduction(+ : alfa) + do i = 1, ni + alfa = alfa + p2(i) * q1(i) + end do + !$omp end parallel do + call Global % Sum_Real(alfa) alfa = rho / alfa !--------------------! ! x = x + alfa p ! ! r = r - alfa q ! !--------------------! + !$omp parallel do private(i) shared(x, r1, r2, p1, q1, q2, alfa) do i = 1, ni - x (i) = x (i) + alfa*p1(i) - r1(i) = r1(i) - alfa*q1(i) - r2(i) = r2(i) - alfa*q2(i) + x (i) = x (i) + alfa * p1(i) + r1(i) = r1(i) - alfa * q1(i) + r2(i) = r2(i) - alfa * q2(i) end do + !$omp end parallel do !-----------------------! ! Check convergence ! @@ -203,16 +235,18 @@ subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !-----------------------------! ! De-normalize the system ! !-----------------------------! + !$omp parallel do private(i, j) shared(a_row, a_val, b, fn) do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) / fn + do j = a_row(i), a_row(i+1)-1 + a_val(j) = a_val(j) / fn end do b(i) = b(i) / fn end do + !$omp end parallel do fin_res = res niter = iter - call Work % Disconnect_Real_Cell(p1, q1, r1, p2, q2, r2) + call Work % Disconnect_Real_Cell(p1, q1, r1, p2, q2, r2, d, d_inv) end subroutine diff --git a/Sources/Process/Native_Mod/Cg.f90 b/Sources/Process/Native_Mod/Cg.f90 index 4474877c1..e2a522fae 100644 --- a/Sources/Process/Native_Mod/Cg.f90 +++ b/Sources/Process/Native_Mod/Cg.f90 @@ -5,33 +5,37 @@ subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization + class(Native_Type), target, intent(in) :: Nat + type(Matrix_Type), target, intent(in) :: A + real, intent(out) :: x(-Nat % pnt_grid % n_bnd_cells:& + Nat % pnt_grid % n_cells) + real, intent(inout) :: b( Nat % pnt_grid % n_cells) + character(SL), intent(in) :: prec ! preconditioner + integer, intent(in) :: miter ! maximum and actual ... + integer, intent(out) :: niter ! ... num. of iterations + real, intent(in) :: tol ! tolerance + real, intent(out) :: fin_res ! final residual + real, optional, intent(in) :: norm ! normalization !-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - type(Grid_Type), pointer :: Grid - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter - real :: sum_a, fn - integer :: sum_n - real, contiguous, pointer :: p1(:), q1(:), r1(:) + type(Grid_Type), pointer :: Grid + integer :: nt, ni, nb + real :: alfa, beta, rho, rho_old, bnrm2, res + integer :: i, j, k, iter + real :: sum_a, fn + integer :: sum_n + real, contiguous, pointer :: p1(:), q1(:), r1(:), d(:), d_inv(:) + real, contiguous, pointer :: a_val(:) + integer, contiguous, pointer :: a_col(:), a_row(:), a_dia(:) !==============================================================================! - call Work % Connect_Real_Cell(p1, q1, r1) + call Work % Connect_Real_Cell(p1, q1, r1, d, d_inv) ! Take some aliases - Grid => Nat % pnt_grid - D => Nat % D + Grid => Nat % pnt_grid + a_val => A % val + a_col => A % col + a_row => A % row + a_dia => A % dia nt = Grid % n_cells ni = Grid % n_cells - Grid % Comm % n_buff_cells @@ -44,25 +48,32 @@ subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !--------------------------! sum_a = 0.0 sum_n = 0 + !$omp parallel do private(i) shared(a_val, a_dia) & + !$omp reduction(+ : sum_a) reduction(+ : sum_n) do i = 1, ni - sum_a = sum_a + A % val(A % dia(i)) + sum_a = sum_a + a_val(a_dia(i)) sum_n = sum_n + 1 end do - call Comm_Mod_Global_Sum_Real(sum_a) - call Comm_Mod_Global_Sum_Int (sum_n) ! this is stored somewhere, check + !$omp end parallel do + + call Global % Sum_Real(sum_a) + call Global % Sum_Int (sum_n) ! this is stored somewhere, check + sum_a = sum_a / sum_n fn = 1.0 / sum_a + !$omp parallel do private(i, j) shared(a_row, a_val, b, fn) do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) * fn + do j = a_row(i), a_row(i+1)-1 + a_val(j) = a_val(j) * fn end do b(i) = b(i) * fn end do + !$omp end parallel do !---------------------! ! Preconditioning ! !---------------------! - call Nat % Prec_Form(ni, A, D, prec) + call Nat % Prec_Form(ni, A, d(1:nt), d_inv(1:nt), prec) !-----------------------------------! ! This is quite tricky point. ! @@ -97,9 +108,11 @@ subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) !-----------! ! p = r ! !-----------! + !$omp parallel do private(i) shared(p1, r1) do i = 1, ni p1(i) = r1(i) end do + !$omp end parallel do !---------------! ! ! @@ -112,52 +125,71 @@ subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) ! solve Mz = r ! ! (q instead of z) ! !----------------------! - call Nat % Prec_Solve(ni, A, D, q1(1:nt), r1(1:nt), prec) + call Nat % Prec_Solve(ni, A, d(1:nt), d_inv(1:nt), q1(1:nt), r1(1:nt), prec) !-----------------! ! rho = (r,z) ! !-----------------! - rho = dot_product(r1(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) + rho = 0.0 + !$omp parallel do private(i) shared(q1, r1) reduction(+ : rho) + do i = 1, ni + rho = rho + q1(i) * r1(i) + end do + !$omp end parallel do + call Global % Sum_Real(rho) if(iter .eq. 1) then + !$omp parallel do private(i) shared(p1, q1) do i = 1, ni p1(i) = q1(i) end do + !$omp end parallel do else beta = rho / rho_old + !$omp parallel do private(i) shared(p1, q1, beta) do i = 1, ni p1(i) = q1(i) + beta * p1(i) end do + !$omp end parallel do end if !------------! ! q = Ap ! !------------! call Grid % Exchange_Cells_Real(p1(-nb:ni)) + !$omp parallel do private(i, j, k) shared(p1, q1, a_row, a_col, a_val) do i = 1, ni q1(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q1(i) = q1(i) + A % val(j) * p1(k) + do j = a_row(i), a_row(i+1)-1 + k = a_col(j) + q1(i) = q1(i) + a_val(j) * p1(k) end do end do + !$omp end parallel do !------------------------! ! alfa = (r,z)/(p,q) ! !------------------------! - alfa = dot_product(p1(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa = rho/alfa + alfa = 0.0 + !$omp parallel do private(i) shared(p1, q1) reduction(+ : alfa) + do i = 1, ni + alfa = alfa + p1(i) * q1(i) + end do + !$omp end parallel do + + call Global % Sum_Real(alfa) + alfa = rho / alfa !---------------------! ! x = x + alfa p ! ! r = r - alfa Ap ! !---------------------! + !$omp parallel do private(i) shared(x, r1, p1, q1, alfa) do i = 1, ni x (i) = x (i) + alfa * p1(i) r1(i) = r1(i) - alfa * q1(i) end do + !$omp end parallel do !-----------------------! ! Check convergence ! @@ -194,8 +226,8 @@ subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) ! De-normalize the system ! !-----------------------------! do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) / fn + do j = a_row(i), a_row(i+1)-1 + a_val(j) = a_val(j) / fn end do b(i) = b(i) / fn end do @@ -203,6 +235,6 @@ subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) fin_res = res niter = iter - call Work % Disconnect_Real_Cell(p1, q1, r1) + call Work % Disconnect_Real_Cell(p1, q1, r1, d, d_inv) end subroutine diff --git a/Sources/Process/Native_Mod/Cgs.f90 b/Sources/Process/Native_Mod/Cgs.f90 deleted file mode 100644 index da4fb5e7f..000000000 --- a/Sources/Process/Native_Mod/Cgs.f90 +++ /dev/null @@ -1,245 +0,0 @@ -!==============================================================================! - subroutine Cgs(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned CGS method ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - type(Grid_Type), pointer :: Grid - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter - real :: sum_a, fn - integer :: sum_n - real, contiguous, pointer :: p1(:), q1(:), r1(:), p2(:), q2(:), r2(:), & - u1(:), u2(:), v2(:), u1_plus_q1(:) -!==============================================================================! - - call Work % Connect_Real_Cell(p1, q1, r1, p2, q2, r2, & - u1, u2, v2, u1_plus_q1) - - ! Take some aliases - Grid => Nat % pnt_grid - D => Nat % D - - nt = Grid % n_cells - ni = Grid % n_cells - Grid % Comm % n_buff_cells - nb = Grid % n_bnd_cells - - res = 0.0 - - !--------------------------! - ! Normalize the system ! - !--------------------------! - sum_a = 0.0 - sum_n = 0 - do i = 1, ni - sum_a = sum_a + A % val(A % dia(i)) - sum_n = sum_n + 1 - end do - call Comm_Mod_Global_Sum_Real(sum_a) - call Comm_Mod_Global_Sum_Int (sum_n) ! this is stored somewhere, check - sum_a = sum_a / sum_n - fn = 1.0 / sum_a - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) * fn - end do - b(i) = b(i) * fn - end do - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter=0 - goto 1 - end if - - !-----------------! - ! r1 = b - Ax ! - !-----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter = 0 - goto 1 - end if - - !-------------! - ! r2 = r1 ! - !-------------! - do i = 1, ni - r2(i) = r1(i) - end do - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !-------------------! - ! rho = (r2,z1) ! - !-------------------! - rho = dot_product(r1(1:ni), r2(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - do i = 1, ni - u1(i) = r1(i) - u2(i) = u1(i) - end do - else - beta = rho / rho_old - do i = 1, ni - u1(i) = r1(i) + beta * q1(i) - u2(i) = u1(i) + beta * (q1(i) + beta*u2(i)) - end do - end if - - !---------------------! - ! Solve M p2 = u2 ! - !---------------------! - call Nat % Prec_Solve(ni, A, D, p2(1:nt), u2(1:nt), prec) - - !--------------! - ! v2 = Ap2 ! - !--------------! - call Grid % Exchange_Cells_Real(p2(-nb:ni)) - do i = 1, ni - v2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - v2(i) = v2(i) + A % val(j) * p2(k) - end do - alfa = alfa + r2(i) * v2(i) - end do - - !------------------------! - ! alfa = rho/(r2,v2) ! - !------------------------! - alfa = dot_product(r2(1:ni), v2(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa=rho / alfa - - !-------------------------! - ! q1 = u1 - alfa * v2 ! - !-------------------------! - do i = 1, ni - q1(i) = u1(i) - alfa * v2(i) - end do - - !-------------------------! - ! solve Mp1 = u1 + q1 ! - !-------------------------! - do i = 1, ni - u1_plus_q1(i) = u1(i) + q1(i) - end do - call Nat % Prec_Solve(ni, A, D, p1(1:nt), u1_plus_q1(1:nt), prec) - - !---------------------! - ! x = x + alfa p1 ! - !---------------------! - do i = 1, ni - x(i) = x(i) + alfa * p1(i) - end do - - !---------------! - ! q2 = A p1 ! - !---------------! - call Grid % Exchange_Cells_Real(p1(-nb:ni)) - do i = 1, ni - q2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q2(i) = q2(i) + A % val(j) * p1(k) - end do - end do - - !---------------------! - ! r = r - alfa q2 ! - !---------------------! - do i = 1, ni - r1(i) = r1(i) - alfa * q2(i) - end do - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old = rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call Grid % Exchange_Cells_Real(x(-nb:ni)) - - !-----------------------------! - ! De-normalize the system ! - !-----------------------------! - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) / fn - end do - b(i) = b(i) / fn - end do - - fin_res = res - niter = iter - - call Work % Disconnect_Real_Cell(p1, q1, r1, p2, q2, r2, & - u1, u2, v2, u1_plus_q1) - - end subroutine diff --git a/Sources/Process/Native_Mod/Create_Native.f90 b/Sources/Process/Native_Mod/Create_Native.f90 index 743e2aca0..aba74b83b 100644 --- a/Sources/Process/Native_Mod/Create_Native.f90 +++ b/Sources/Process/Native_Mod/Create_Native.f90 @@ -3,19 +3,18 @@ subroutine Create_Native(Nat, Grid) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Nat - type(Grid_Type), target :: Grid + class(Native_Type), intent(out) :: Nat + type(Grid_Type), target, intent(in) :: Grid !==============================================================================! Nat % pnt_grid => Grid - if(this_proc < 2) print *, '# Determining matrix topology.' + if(First_Proc()) print *, '# Determining matrix topology.' call Nat % A % Create_Matrix(Grid) call Nat % M % Create_Matrix(Grid) - call Nat % D % Create_Matrix(Grid) call Vector_Mod_Allocate(Nat % b, Grid) - if(this_proc < 2) print *, '# Finished !' + if(First_Proc()) print *, '# Finished !' end subroutine diff --git a/Sources/Process/Native_Mod/Normalized_Root_Mean_Square.f90 b/Sources/Process/Native_Mod/Normalized_Root_Mean_Square.f90 index c24d01f5b..f1f2c97c3 100644 --- a/Sources/Process/Native_Mod/Normalized_Root_Mean_Square.f90 +++ b/Sources/Process/Native_Mod/Normalized_Root_Mean_Square.f90 @@ -1,47 +1,73 @@ !==============================================================================! - real function Normalized_Root_Mean_Square(Native, ni, r, A, x, norm) + real function Normalized_Root_Mean_Square(Nat, ni, r, A, x, norm) !------------------------------------------------------------------------------! ! Calculates root means square of vector r, normalizing it with entries ! ! in the system matrix (a), values of unknown (x) and optional norm. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Native - integer :: ni - real :: r(:) ! this may be only in inner cells - type(Matrix_Type) :: A - real :: x(:) ! presumably, this goes to buffer cells - real, optional :: norm ! optional number for normalization + class(Native_Type), intent(in) :: Nat + integer, intent(in) :: ni + real, intent(in) :: r(:) ! this may be in inner cells + type(Matrix_Type), target, intent(in) :: A + real, intent(in) :: x(:) ! this goes to buffer cells + real, optional, intent(in) :: norm ! number for normalization !-----------------------------------[Locals]-----------------------------------! - real :: rms, x_max, x_min - integer :: i + real :: rms, x_max, x_min, x_max_min + integer :: i + real, contiguous, pointer :: a_val(:) + integer, contiguous, pointer :: a_dia(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Nat) !==============================================================================! + ! Take some aliases + a_val => A % val + a_dia => A % dia + ! Compute rms normalizing it with main diagonal in the system matrix rms = 0.0 + !$omp parallel do private(i) shared(r, a_val, a_dia) reduction(+ : rms) do i = 1, ni - rms = rms + r(i)**2 / A % val(A % dia(i))**2 + rms = rms + r(i)**2 / a_val(a_dia(i))**2 end do - call Comm_Mod_Global_Sum_Real(rms) + !$omp end parallel do + + call Global % Sum_Real(rms) rms = sqrt(rms) ! Normalize it with absolute values of the unknown if(.not. present(norm)) then - x_min = minval(x(1:ni)) - x_max = maxval(x(1:ni)) + x_min = +HUGE + x_max = -HUGE + !$omp parallel do private(i) shared(x) & + !$omp reduction(max : x_max) & + !$omp reduction(min : x_min) + do i = 1, ni + x_min = min(x_min, x(i)) + x_max = max(x_max, x(i)) + end do + !$omp end parallel do else x_min = 0.0 x_max = norm endif - call Comm_Mod_Global_Min_Real(x_min) - call Comm_Mod_Global_Max_Real(x_max) + call Global % Min_Real(x_min) + call Global % Max_Real(x_max) ! Create a plateau for very small sources and values - if( (x_max-x_min) < NANO .and. rms < NANO ) then - rms = PICO - else - rms = rms / (x_max - x_min + TINY) - end if + !if( (x_max-x_min) < NANO .and. rms < NANO ) then + ! rms = PICO + !else + ! rms = rms / (x_max - x_min + TINY) + !end if + + ! avoid roundoff error and divided-by-zero + ! don't do rms = rms / (x_max - x_min + TINY) + ! because e.g. 1.0 - 1.0 + 1e-30 = 0.0 + x_max_min = x_max - x_min + x_max_min = max (x_max_min, TINY) + rms = rms / x_max_min Normalized_Root_Mean_Square = rms diff --git a/Sources/Process/Native_Mod/Prec_Form.f90 b/Sources/Process/Native_Mod/Prec_Form.f90 index c0b9c0bd9..6be0b090b 100644 --- a/Sources/Process/Native_Mod/Prec_Form.f90 +++ b/Sources/Process/Native_Mod/Prec_Form.f90 @@ -1,48 +1,64 @@ !==============================================================================! - subroutine Prec_Form(Native, ni, A, D, prec) + subroutine Prec_Form(Nat, ni, A, d, d_inv, prec) !------------------------------------------------------------------------------! ! Forms preconditioning matrix "D" from provided matrix "A". ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Native - integer :: ni - type(Matrix_Type) :: A - type(Matrix_Type) :: D - character(SL) :: prec ! preconditioner + class(Native_Type), intent(in) :: Nat + integer, intent(in) :: ni + type(Matrix_Type), target, intent(in) :: A + real, intent(out) :: d(:) + real, intent(out) :: d_inv(:) + character(SL), intent(in) :: prec ! preconditioner !-----------------------------------[Locals]-----------------------------------! - real :: sum1 - integer :: i, j, k + real :: sum + integer :: i, j, k + integer, contiguous, pointer :: a_col(:), a_row(:), a_dia(:) + real, contiguous, pointer :: a_val(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Nat) !==============================================================================! - !---------------------------------! + ! Take some aliases + a_col => A % col + a_row => A % row + a_dia => A % dia + a_val => A % val + + !---------------------------------! ! 1) diagonal preconditioning ! !---------------------------------! if(prec .eq. 'jacobi') then + !$omp parallel do private(i) shared (d, a_val, a_dia) do i = 1, ni - D % val(D % dia(i)) = A % val(A % dia(i)) + d(i) = a_val(a_dia(i)) end do + !$omp end parallel do !--------------------------------------------! ! 2) incomplete cholesky preconditioning ! !--------------------------------------------! else if(prec .eq. 'icc') then do i = 1, ni - sum1 = A % val(A % dia(i)) ! take diaginal entry - do j = A % row(i), A % dia(i)-1 ! only lower traingular - k = A % col(j) - sum1 = sum1 - D % val(D % dia(k)) * A % val(j) * A % val(j) + sum = a_val(a_dia(i)) ! take diaginal entry + do j = a_row(i), a_dia(i) - 1 ! only lower traingular + k = a_col(j) + sum = sum - d(k) * a_val(j) * a_val(j) end do - D % val(D % dia(i)) = 1.0 / sum1 + d_inv(i) = sum + d(i) = 1.0 / sum end do !---------------------------! ! .) no preconditioning ! !---------------------------! else + !$omp parallel do private(i) shared (d) do i = 1, ni - D % val(D % dia(i)) = 1.0 + d(i) = 1.0 end do + !$omp end parallel do end if end subroutine diff --git a/Sources/Process/Native_Mod/Prec_Solve.f90 b/Sources/Process/Native_Mod/Prec_Solve.f90 index d195a8431..769a2ac22 100644 --- a/Sources/Process/Native_Mod/Prec_Solve.f90 +++ b/Sources/Process/Native_Mod/Prec_Solve.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Prec_Solve(Native, ni, A, D, x, b, prec) + subroutine Prec_Solve(Nat, ni, A, d, d_inv, x, b, prec) !------------------------------------------------------------------------------! ! Solves the preconditioning system [D]{x}={b} ! !------------------------------------------------------------------------------! @@ -13,25 +13,38 @@ subroutine Prec_Solve(Native, ni, A, D, x, b, prec) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Native - integer :: ni - type(Matrix_Type) :: A - type(Matrix_Type) :: D - real :: x(:) - real :: b(:) - character(SL) :: prec ! preconditioner + class(Native_Type), intent(in) :: Nat + integer, intent(in) :: ni + type(Matrix_Type), target, intent(in) :: A + real, intent(in) :: d(:) + real, intent(in) :: d_inv(:) + real, intent(out) :: x(:) + real, intent(in) :: b(:) + character(SL), intent(in) :: prec ! preconditioner !-----------------------------------[Locals]-----------------------------------! - integer :: i, j, k - real :: sum1 + integer :: i, j, k + real :: sum + integer, contiguous, pointer :: a_col(:), a_row(:), a_dia(:) + real, contiguous, pointer :: a_val(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Nat) !==============================================================================! + ! Take some aliases + a_col => A % col + a_row => A % row + a_dia => A % dia + a_val => A % val + !---------------------------------! ! 1) diagonal preconditioning ! !---------------------------------! if(prec .eq. 'jacobi') then + !$omp parallel do private(i) shared (x, b, d_inv) do i = 1, ni - x(i) = b(i)/D % val(D % dia(i)) + x(i) = b(i) * d_inv(i) end do + !$omp end parallel do !--------------------------------------------! ! 2) incomplete cholesky preconditioning ! @@ -40,35 +53,39 @@ subroutine Prec_Solve(Native, ni, A, D, x, b, prec) ! Forward substitutionn do i = 1, ni - sum1 = b(i) - do j = A % row(i),A % dia(i)-1 ! only the lower triangular - k = A % col(j) - sum1 = sum1 - A % val(j)*x(k) + sum = b(i) + do j = a_row(i), a_dia(i) - 1 ! only the lower triangular + k = a_col(j) + sum = sum - a_val(j) * x(k) end do - x(i) = sum1 * D % val(D % dia(i)) ! BUG ? + x(i) = sum * d(i) end do + !$omp parallel do private(i) shared (x, d_inv) do i = 1, ni - x(i) = x(i) / ( D % val(D % dia(i)) + TINY ) + x(i) = x(i) * d_inv(i) end do + !$omp end parallel do ! Backward substitution do i = ni, 1, -1 - sum1 = x(i) - do j = A % dia(i)+1, A % row(i+1)-1 ! upper triangular - k = A % col(j) - if(k <= ni) sum1 = sum1 - A % val(j)*x(k) ! avoid buffer entries + sum = x(i) + do j = a_dia(i) + 1, a_row(i+1) - 1 ! upper triangular + k = a_col(j) + if(k <= ni) sum = sum - a_val(j) * x(k) ! avoid buffer entries end do - x(i) = sum1* D % val(D % dia(i)) ! BUG ? + x(i) = sum * d(i) end do !---------------------------! ! .) no preconditioning ! !---------------------------! else + !$omp parallel do private(i) shared (x, b) do i = 1, ni x(i) = b(i) end do + !$omp end parallel do end if end subroutine diff --git a/Sources/Process/Native_Mod/Residual_Vector.f90 b/Sources/Process/Native_Mod/Residual_Vector.f90 index b1d3e280f..82be279d8 100644 --- a/Sources/Process/Native_Mod/Residual_Vector.f90 +++ b/Sources/Process/Native_Mod/Residual_Vector.f90 @@ -1,30 +1,40 @@ !==============================================================================! - subroutine Residual_Vector(Native, ni, r, b, A, x) + subroutine Residual_Vector(Nat, ni, r, b, A, x) !------------------------------------------------------------------------------! ! Calculates residual vector {r} = {b} - [A]{x} ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Native - integer :: ni - real :: r(:) ! this might be only for inner cells - real :: b(:) ! this might be only for inner cells - type(Matrix_Type) :: A - real :: x(:) ! this may incude buffer cells + class(Native_Type), intent(in) :: Nat + integer, intent(in) :: ni + real, intent(out) :: r(:) ! only for inner cells + real, intent(in) :: b(:) ! only for inner cells + type(Matrix_Type), target, intent(in) :: A + real, intent(in) :: x(:) ! may incude buffer cells !-----------------------------------[Locals]-----------------------------------! - integer :: i, j, k + integer :: i, j, k + real, contiguous, pointer :: a_val(:) + integer, contiguous, pointer :: a_col(:), a_row(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Nat) !==============================================================================! + ! Take some aliases + a_col => A % col + a_row => A % row + a_val => A % val + !----------------! ! r = b - Ax ! !----------------! - ! Why not callig this: call exchange(x) ??? + !$omp parallel do private(i, j) shared (r, b, x) do i = 1, ni r(i) = b(i) - do j = A % row(i), A % row(i+1) - 1 - k = A % col(j) - r(i) = r(i) - A % val(j) * x(k) + do j = a_row(i), a_row(i+1) - 1 + k = a_col(j) + r(i) = r(i) - a_val(j) * x(k) end do end do + !$omp end parallel do end subroutine diff --git a/Sources/Process/Native_Mod/Root_Mean_Square.f90 b/Sources/Process/Native_Mod/Root_Mean_Square.f90 index 3788d9e21..f731febea 100644 --- a/Sources/Process/Native_Mod/Root_Mean_Square.f90 +++ b/Sources/Process/Native_Mod/Root_Mean_Square.f90 @@ -1,25 +1,29 @@ !==============================================================================! - real function Root_Mean_Square(Native, ni, r) + real function Root_Mean_Square(Nat, ni, r) !------------------------------------------------------------------------------! ! Calculates root means square of vector r without normalization. ! ! This non-normalized variant seems to be better option for ACM. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Native - integer :: ni - real :: r(:) ! this may be only in inner cells + class(Native_Type), intent(in) :: Nat + integer, intent(in) :: ni + real, intent(in) :: r(:) ! this may be only in inner cells !-----------------------------------[Locals]-----------------------------------! real :: rms integer :: i +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Nat) !==============================================================================! ! Compute rms normalizing it with main diagonal in the system matrix rms = 0.0 + !$omp parallel do private(i) shared(r) reduction(+ : rms) do i = 1, ni rms = rms + r(i)**2 end do - call Comm_Mod_Global_Sum_Real(rms) + !$omp end parallel do + call Global % Sum_Real(rms) rms = sqrt(rms) Root_Mean_Square = rms diff --git a/Sources/Process/Native_Mod/Solve_Native.f90 b/Sources/Process/Native_Mod/Solve_Native.f90 index c8301ed0f..f5fefd7d8 100644 --- a/Sources/Process/Native_Mod/Solve_Native.f90 +++ b/Sources/Process/Native_Mod/Solve_Native.f90 @@ -8,18 +8,18 @@ subroutine Solve_Native(Nat, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Native_Type) :: Nat - character(*) :: solver ! solver - character(*) :: prec ! preconditioner - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization + class(Native_Type), intent(in) :: Nat + character(*), intent(in) :: solver ! solver + character(*), intent(in) :: prec ! preconditioner + type(Matrix_Type), intent(in) :: A + real, intent(out) :: x(-Nat % pnt_grid % n_bnd_cells : & + Nat % pnt_grid % n_cells) + real, intent(inout) :: b( Nat % pnt_grid % n_cells) + integer, intent(in) :: miter ! maximum and actual ... + integer, intent(out) :: niter ! ... number of iterations + real, intent(in) :: tol ! tolerance + real, intent(out) :: fin_res ! final residual + real, optional, intent(in) :: norm ! normalization !==============================================================================! ! Call the desired linear solver to solve the equations @@ -27,13 +27,13 @@ subroutine Solve_Native(Nat, & call Nat % Bicg(A, x, b, prec, miter, niter, tol, fin_res, norm) else if(solver .eq. 'cg') then call Nat % Cg (A, x, b, prec, miter, niter, tol, fin_res, norm) - else if(solver .eq. 'cgs') then - call Nat % Cgs (A, x, b, prec, miter, niter, tol, fin_res, norm) else - print *, '# ERROR: Unknown native solver: ', solver - print *, '# This error is critical, stopping!' - call Comm_Mod_End - stop + call Message % Error(64, 'Unknown native solver: '//trim(solver) // & + '. This error is critical, exiting! ' // & + 'Check the file: Documents/all_control' // & + '_keywords to see which solvers are ' // & + 'available.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Process/Numerics_Mod.f90 b/Sources/Process/Numerics_Mod.f90 index b2a85e2ed..10f121a1f 100644 --- a/Sources/Process/Numerics_Mod.f90 +++ b/Sources/Process/Numerics_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Browse.h90" + !==============================================================================! module Numerics_Mod !------------------------------------------------------------------------------! diff --git a/Sources/Process/Numerics_Mod/Advection_Scheme_Code.f90 b/Sources/Process/Numerics_Mod/Advection_Scheme_Code.f90 index 6dbd92c95..4102072e2 100644 --- a/Sources/Process/Numerics_Mod/Advection_Scheme_Code.f90 +++ b/Sources/Process/Numerics_Mod/Advection_Scheme_Code.f90 @@ -36,13 +36,12 @@ integer function Numerics_Mod_Advection_Scheme_Code(name) Numerics_Mod_Advection_Scheme_Code = STACS case default - if(this_proc < 2) then - print *, '# ERROR! Unknown advection scheme: ', trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(64, 'Unknown advection scheme: '//trim(name) // & + '. This error is critical, exiting! ' // & + 'Check the file: Documents/all_control' // & + '_keywords to see which advection schemes ' // & + 'are currently available in the code.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end select end function diff --git a/Sources/Process/Numerics_Mod/Advection_Term.f90 b/Sources/Process/Numerics_Mod/Advection_Term.f90 index 1934e9332..a0bf84d97 100644 --- a/Sources/Process/Numerics_Mod/Advection_Term.f90 +++ b/Sources/Process/Numerics_Mod/Advection_Term.f90 @@ -13,10 +13,12 @@ subroutine Numerics_Mod_Advection_Term(phi, coef, v_flux, b) !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid real :: phif ! phi and coef at the cell face - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real, contiguous, pointer :: phi_min(:), phi_max(:), advect(:), upwind(:) !==============================================================================! + call Profiler % Start('Advection_Term') + ! Take alias to Grid Grid => phi % pnt_grid @@ -35,11 +37,41 @@ subroutine Numerics_Mod_Advection_Term(phi, coef, v_flux, b) advect(:) = 0.0 upwind(:) = 0.0 - !----------------------------------! - ! Browse through all the faces ! - !----------------------------------! - do s=1, Grid % n_faces + !-----------------------------------! + ! Browse through boundary faces ! + !-----------------------------------! + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + ! This could be computed with gradient extrapolation + phif = Grid % f(s) * phi % n(c1) & + + (1.0-Grid % f(s)) * phi % n(c2) + + ! Compute phif with desired advection scheme + if(phi % adv_scheme .ne. CENTRAL) then + call Numerics_Mod_Advection_Scheme(phif, s, phi, & + phi_min, phi_max, v_flux) + end if + + ! Compute advection term (volume-conservative form) + advect(c1) = advect(c1) - v_flux(s) * phif * coef(c1) + + ! Store upwinded part of the advection term + if(v_flux(s) .lt. 0) then ! from c2 to c1 + upwind(c1) = upwind(c1) - v_flux(s) * phi % n(c2) * coef(c1) + else + upwind(c1) = upwind(c1) - v_flux(s) * phi % n(c1) * coef(c1) + end if + + end do ! faces + end do ! regions + !---------------------------------! + ! Browse through inside faces ! + !---------------------------------! + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) @@ -53,36 +85,30 @@ subroutine Numerics_Mod_Advection_Term(phi, coef, v_flux, b) end if ! Compute advection term (volume-conservative form) - if(c2 > 0) then - advect(c1) = advect(c1) - v_flux(s) * phif * coef(c1) - advect(c2) = advect(c2) + v_flux(s) * phif * coef(c2) - else - advect(c1) = advect(c1) - v_flux(s) * phif * coef(c1) - end if + advect(c1) = advect(c1) - v_flux(s) * phif * coef(c1) + advect(c2) = advect(c2) + v_flux(s) * phif * coef(c2) ! Store upwinded part of the advection term if(v_flux(s) .lt. 0) then ! from c2 to c1 upwind(c1) = upwind(c1) - v_flux(s) * phi % n(c2) * coef(c1) - if(c2 > 0) then - upwind(c2) = upwind(c2) + v_flux(s) * phi % n(c2) * coef(c2) - end if + upwind(c2) = upwind(c2) + v_flux(s) * phi % n(c2) * coef(c2) else upwind(c1) = upwind(c1) - v_flux(s) * phi % n(c1) * coef(c1) - if(c2 > 0) then - upwind(c2) = upwind(c2) + v_flux(s) * phi % n(c1) * coef(c2) - end if + upwind(c2) = upwind(c2) + v_flux(s) * phi % n(c1) * coef(c2) end if - end do ! through faces + end do ! through faces in domain !------------------------------------------------! ! Source term contains difference between ! ! explicity and implicitly treated advection ! !------------------------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() b(c) = b(c) + advect(c) - upwind(c) end do call Work % Disconnect_Real_Cell(phi_min, phi_max, advect, upwind) + call Profiler % Stop('Advection_Term') + end subroutine diff --git a/Sources/Process/Numerics_Mod/Gradient_Method_Code.f90 b/Sources/Process/Numerics_Mod/Gradient_Method_Code.f90 index 26fba3f94..6119985ec 100644 --- a/Sources/Process/Numerics_Mod/Gradient_Method_Code.f90 +++ b/Sources/Process/Numerics_Mod/Gradient_Method_Code.f90 @@ -16,13 +16,13 @@ integer function Numerics_Mod_Gradient_Method_Code(name) Numerics_Mod_Gradient_Method_Code = GAUSS_THEOREM case default - if(this_proc < 2) then - print *, '# ERROR! Unknown gradient computation method: ', trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(80, 'Unknown gradient calculation method: ' // & + trim(name)//'. This error is critical, ' // & + ' exiting! Check the file: ' // & + 'Documents/all_control_keywords to see ' // & + 'which gradient computation methods are ' // & + 'currently available in the code.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end select end function diff --git a/Sources/Process/Numerics_Mod/Inertial_Term.f90 b/Sources/Process/Numerics_Mod/Inertial_Term.f90 index d966b520c..935a555a1 100644 --- a/Sources/Process/Numerics_Mod/Inertial_Term.f90 +++ b/Sources/Process/Numerics_Mod/Inertial_Term.f90 @@ -22,7 +22,7 @@ subroutine Numerics_Mod_Inertial_Term(phi, coef, A, b, dt) ! Two time levels; Linear interpolation if(phi % td_scheme .eq. LINEAR) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() a0 = coef(c) * Grid % vol(c) / dt A % val(A % dia(c)) = A % val(A % dia(c)) + a0 b(c) = b(c) + a0 * phi % o(c) @@ -31,7 +31,7 @@ subroutine Numerics_Mod_Inertial_Term(phi, coef, A, b, dt) ! Three time levels; parabolic interpolation if(phi % td_scheme .eq. PARABOLIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() a0 = coef(c) * Grid % vol(c) / dt A % val(A % dia(c)) = A % val(A % dia(c)) + 1.5 * a0 b(c) = b(c) + 2.0 * a0 * phi % o(c) - 0.5 * a0 * phi % oo(c) diff --git a/Sources/Process/Numerics_Mod/Pressure_Momentum_Coupling_Code.f90 b/Sources/Process/Numerics_Mod/Pressure_Momentum_Coupling_Code.f90 index 15979783a..875437d39 100644 --- a/Sources/Process/Numerics_Mod/Pressure_Momentum_Coupling_Code.f90 +++ b/Sources/Process/Numerics_Mod/Pressure_Momentum_Coupling_Code.f90 @@ -15,14 +15,9 @@ integer function Numerics_Mod_Pressure_Momentum_Coupling_Code(name) Numerics_Mod_Pressure_Momentum_Coupling_Code = PISO case default - if(this_proc < 2) then - print *, '# ERROR! Unknown pressure-momentum coupling algorithm: ', & - trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(72, & + 'Unknown pressure-momentum coupling algorithm: '//trim(name)// & + '. \n Exiting!', one_proc=.true.) end select end function diff --git a/Sources/Process/Numerics_Mod/Time_Integration_Scheme_Code.f90 b/Sources/Process/Numerics_Mod/Time_Integration_Scheme_Code.f90 index b6d176a2e..2d4baaedb 100644 --- a/Sources/Process/Numerics_Mod/Time_Integration_Scheme_Code.f90 +++ b/Sources/Process/Numerics_Mod/Time_Integration_Scheme_Code.f90 @@ -1,12 +1,12 @@ !==============================================================================! - integer function Numerics_Mod_Time_Integration_Scheme_Code(scheme_name) + integer function Numerics_Mod_Time_Integration_Scheme_Code(name) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: scheme_name + character(SL) :: name !==============================================================================! - select case(scheme_name) + select case(name) case('LINEAR') Numerics_Mod_Time_Integration_Scheme_Code = LINEAR @@ -16,14 +16,9 @@ integer function Numerics_Mod_Time_Integration_Scheme_Code(scheme_name) Numerics_Mod_Time_Integration_Scheme_Code = RUNGE_KUTTA_3 case default - if(this_proc < 2) then - print *, '# ERROR! Unknown time-integration scheme: ', & - trim(scheme_name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(60, & + 'Unknown time-integration scheme: '//trim(name)// & + '. \n Exiting!', one_proc=.true.) end select end function diff --git a/Sources/Process/Particle_Mod/Initialize_Particle.f90 b/Sources/Process/Particle_Mod/Initialize_Particle.f90 index 228b294ac..011aaaada 100644 --- a/Sources/Process/Particle_Mod/Initialize_Particle.f90 +++ b/Sources/Process/Particle_Mod/Initialize_Particle.f90 @@ -56,7 +56,7 @@ subroutine Initialize_Particle(Particle, Flow, diameter, density) Particle % trapped = .false. ! Set some processor number to particle - Particle % proc = min(1, n_proc) - Particle % buff = min(1, n_proc) + Particle % proc = min(1, N_Procs()) + Particle % buff = min(1, N_Procs()) end subroutine diff --git a/Sources/Process/Petsc_Mod.f90 b/Sources/Process/Petsc_Mod.f90 index 2bd2c7949..4636ce051 100644 --- a/Sources/Process/Petsc_Mod.f90 +++ b/Sources/Process/Petsc_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Unused.h90" + #if T_FLOWS_PETSC == 1 #include #include diff --git a/Sources/Process/Petsc_Mod/Fake/Create_Petsc.f90 b/Sources/Process/Petsc_Mod/Fake/Create_Petsc.f90 index 0b5252ea5..190138435 100644 --- a/Sources/Process/Petsc_Mod/Fake/Create_Petsc.f90 +++ b/Sources/Process/Petsc_Mod/Fake/Create_Petsc.f90 @@ -6,11 +6,13 @@ subroutine Create_Petsc(Pet, Nat, Grid) class(Petsc_Type) :: Pet type(Native_Type) :: Nat type(Grid_Type), target :: Grid +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Nat) !==============================================================================! Pet % pnt_grid => Grid - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # NOTE! This version was compiled without PETSc,' // & ' so the PETSc class was not created ...' print '(a)', ' # ... which is OK as long as you don''t specify' // & diff --git a/Sources/Process/Petsc_Mod/Fake/Solve_Petsc.f90 b/Sources/Process/Petsc_Mod/Fake/Solve_Petsc.f90 index d250d4ae0..2a950eda4 100644 --- a/Sources/Process/Petsc_Mod/Fake/Solve_Petsc.f90 +++ b/Sources/Process/Petsc_Mod/Fake/Solve_Petsc.f90 @@ -21,20 +21,32 @@ subroutine Solve_Petsc(Pet, & real, intent(in) :: tol ! tolerance real, intent(out) :: fin_res ! final residual real, optional :: norm ! normalization +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Pet) + Unused(solver) + Unused(prec) + Unused(prec_opts) + Unused(A) + Unused(x) + Unused(b) + Unused(miter) + Unused(niter) + Unused(tol) + Unused(fin_res) + Unused(norm) !==============================================================================! ! Just to avoid compiler's warning niter = 0 fin_res = 0.0 - if(this_proc < 2) then - print '(a)', ' # This version was compiled without PETSc, ' // & - 'and yet they were specified in the control file.' - print '(a)', ' # This error is critical, exiting. Fix the control file.' - end if - - call Comm_Mod_End - stop + call Message % Error(60, & + 'This version was compiled without PETSc, and yet ' // & + 'they are specified in the control file. This error ' // & + 'is critical, exiting. Eithrt fix the control file ' // & + 'by setting LINEAR_SOLVERS to native, or install ' // & + 'PETSc on your system', & + file=__FILE__, line=__LINE__, one_proc=.true.) end subroutine diff --git a/Sources/Process/Petsc_Mod/True/Create_Petsc.f90 b/Sources/Process/Petsc_Mod/True/Create_Petsc.f90 index 43dba424d..138a997e9 100644 --- a/Sources/Process/Petsc_Mod/True/Create_Petsc.f90 +++ b/Sources/Process/Petsc_Mod/True/Create_Petsc.f90 @@ -13,7 +13,7 @@ subroutine Create_Petsc(Pet, Nat, Grid) Pet % pnt_grid => Grid - if(this_proc < 2) print *, '# Initializing PETSc.' + if(First_Proc()) print *, '# Initializing PETSc.' ! Total number of unknowns and unknowns in this processor only Pet % m_upper = Grid % Comm % nc_tot @@ -31,18 +31,18 @@ subroutine Create_Petsc(Pet, Nat, Grid) allocate(Pet % glo(-Grid % n_bnd_cells:Grid % n_cells)) Pet % glo(:) = 0 - if(n_proc < 2) then + if(Sequential_Run()) then Pet % glo(1:Grid % n_cells) = Grid % Comm % cell_glo(1:Grid % n_cells) - 1 else start = 1 ! first row - allocate(all_lower_ms(n_proc)); ! allocate array for all m_lowers - all_lower_ms(:) = 0 ! important to initialize to zero + allocate(all_lower_ms(N_Procs())); ! allocate array for all m_lowers + all_lower_ms(:) = 0 ! important to initialize to zero ! Distribute m_lowers among all processors - all_lower_ms(this_proc) = Pet % m_lower - call Comm_Mod_Global_Sum_Int_Array(n_proc, all_lower_ms) + all_lower_ms(This_Proc()) = Pet % m_lower + call Global % Sum_Int_Array(N_Procs(), all_lower_ms) - start = sum(all_lower_ms(1:this_proc)) - Pet % m_lower + start = sum(all_lower_ms(1:This_Proc())) - Pet % m_lower ! Distribute global numbers over other processors do i = 1, Pet % m_lower @@ -87,7 +87,7 @@ subroutine Create_Petsc(Pet, Nat, Grid) do i = 1, Pet % m_lower do j = Nat % A % row(i), Nat % A % row(i+1)-1 k = Nat % A % col(j) - if(Grid % Comm % cell_proc(k) .eq. this_proc) then + if(Grid % Comm % cell_proc(k) .eq. This_Proc()) then Pet % d_nnz(i) = Pet % d_nnz(i) + 1 else Pet % o_nnz(i) = Pet % o_nnz(i) + 1 @@ -111,7 +111,7 @@ subroutine Create_Petsc(Pet, Nat, Grid) !-------------------------! call C_Petsc_Ksp_Create(Pet % ksp) - if(this_proc < 2) print *, '# Finished !' + if(First_Proc()) print *, '# Finished !' end subroutine diff --git a/Sources/Process/Petsc_Mod/True/Solve_Petsc.f90 b/Sources/Process/Petsc_Mod/True/Solve_Petsc.f90 index 38e6e8a1b..8ef3753ff 100644 --- a/Sources/Process/Petsc_Mod/True/Solve_Petsc.f90 +++ b/Sources/Process/Petsc_Mod/True/Solve_Petsc.f90 @@ -30,6 +30,8 @@ subroutine Solve_Petsc(Pet, & !-----------------------------------------------------------! ! Fill up PETSc matrix with values from original matrix ! + !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -! + ! (This can be very slow, comparable to call to solver) ! !-----------------------------------------------------------! do i = 1, Pet % m_lower do j = A % row(i), A % row(i+1)-1 @@ -58,6 +60,9 @@ subroutine Solve_Petsc(Pet, & !-----------------------------------! ! Set solver and preconditioner ! + !- - - - - - - - - - - - - - - - - -! + ! (This can be very slow, much ! + ! slower than call to solver.) ! !-----------------------------------! solvers = solver; l = len_trim(solvers); solvers(l+1:l+1) = c_null_char precs = prec; l = len_trim(precs); precs (l+1:l+1) = c_null_char @@ -101,7 +106,10 @@ subroutine Solve_Petsc(Pet, & Pet % miter) !-----------! ! Solve ! - !-----------! + !- - - - - -+------------------------------------------------------! + ! (This step takes roughly half of the time of filling up the ! + ! PETSc matrix and setiting the preconditioner, put together) ! + !------------------------------------------------------------------! call C_Petsc_Ksp_Solve(Pet % ksp, Pet % b, Pet % x) ! Check if converged @@ -126,7 +134,7 @@ subroutine Solve_Petsc(Pet, & x(i)) end do else - ! if(this_proc < 2) print *, ' # Warning: linear system failed to converge!' + ! if(First_Proc()) print *, ' # Warning: linear system failed to converge!' end if end subroutine diff --git a/Sources/Process/Point_Mod/Find_Nearest_Cell.f90 b/Sources/Process/Point_Mod/Find_Nearest_Cell.f90 index 0d7b84f05..9cadb7fb3 100644 --- a/Sources/Process/Point_Mod/Find_Nearest_Cell.f90 +++ b/Sources/Process/Point_Mod/Find_Nearest_Cell.f90 @@ -89,7 +89,7 @@ subroutine Find_Nearest_Cell(Point, n_parts_in_buffers, locally) !--------------------------------------! Point % buff = Point % proc ! assume buffer was not entered - ! If processor number in the cell is differnt than this_proc + ! If processor number in the cell is differnt than This_Proc() ! (and Point % proc in this case) you entered the buffer if(Grid % Comm % cell_proc(cc) .ne. Point % proc) then Point % buff = Grid % Comm % cell_proc(cc) ! store buffer process @@ -132,15 +132,15 @@ subroutine Find_Nearest_Cell(Point, n_parts_in_buffers, locally) Point % cell = cc min_dc_glob = min_dc - if(n_proc > 1 .and. .not. local) then - call Comm_Mod_Global_Min_Real(min_dc_glob) + if(Parallel_Run() .and. .not. local) then + call Global % Min_Real(min_dc_glob) end if Point % proc = 0 Point % buff = 0 if( min_dc .eq. min_dc_glob ) then - Point % proc = this_proc - Point % buff = this_proc + Point % proc = This_Proc() + Point % buff = This_Proc() end if !--------------------! @@ -175,8 +175,8 @@ subroutine Find_Nearest_Cell(Point, n_parts_in_buffers, locally) ! Check if point is in this processor ! !-----------------------------------------! min_db_glob = min_db - if(n_proc > 1 .and. .not. local) then - call Comm_Mod_Global_Min_Real(min_db_glob) + if(Parallel_Run() .and. .not. local) then + call Global % Min_Real(min_db_glob) end if end if ! closest node is (not) known @@ -188,7 +188,7 @@ subroutine Find_Nearest_Cell(Point, n_parts_in_buffers, locally) ! (Didn't really work) ! ! ! !------------------------------! - ! if(Point % proc .eq. this_proc & + ! if(Point % proc .eq. This_Proc() & ! .and. .not. Grid % Is_Point_In_Cell(Point % cell, & ! Point % x_n, & ! Point % y_n, & diff --git a/Sources/Process/Porosity_Mod/Create_Porosity.f90 b/Sources/Process/Porosity_Mod/Create_Porosity.f90 index e09c1862d..9650cedbd 100644 --- a/Sources/Process/Porosity_Mod/Create_Porosity.f90 +++ b/Sources/Process/Porosity_Mod/Create_Porosity.f90 @@ -11,8 +11,8 @@ subroutine Create_Porosity(Por, Grid) !==============================================================================! ! Read number of Porous regions from control file - call Control_Mod_Read_Int_Item('NUMBER_OF_POROUS_REGIONS', 0, & - Por % n_regions, .true.) + call Control % Read_Int_Item('NUMBER_OF_POROUS_REGIONS', 0, & + Por % n_regions, .true.) if(Por % n_regions .eq. 0) return @@ -38,7 +38,7 @@ subroutine Create_Porosity(Por, Grid) write(porous_region_rank, '(a,i3.3)') 'POROUS_REGION_', reg ! Look for it - call Control_Mod_Position_At_One_Key(porous_region_rank, found, .true.) + call Control % Position_At_One_Key(porous_region_rank, found, .true.) !------------------------------------------! ! Found the section with porous region ! @@ -46,19 +46,19 @@ subroutine Create_Porosity(Por, Grid) if (found) then ! Read "on", otherwise you will always find the first mention of STL_FILE - call Control_Mod_Read_Char_Item_On('STL_FILE', 'default.stl', & - Por % region(reg) % stl_name, & - .true.) + call Control % Read_Char_Item_On('STL_FILE', 'default.stl', & + Por % region(reg) % stl_name, & + .true.) print '(a)', trim(Por % region(reg) % stl_name) - call Control_Mod_Read_Real_Array('C1X_C2X', 2, def, c1c2, .true.) + call Control % Read_Real_Vector('C1X_C2X', 2, def, c1c2, .true.) Por % region(reg) % c1_x = c1c2(1) Por % region(reg) % c2_x = c1c2(2) - call Control_Mod_Read_Real_Array('C1Y_C2Y', 2, def, c1c2, .true.) + call Control % Read_Real_Vector('C1Y_C2Y', 2, def, c1c2, .true.) Por % region(reg) % c1_y = c1c2(1) Por % region(reg) % c2_y = c1c2(2) - call Control_Mod_Read_Real_Array('C1Z_C2Z', 2, def, c1c2, .true.) + call Control % Read_Real_Vector('C1Z_C2Z', 2, def, c1c2, .true.) Por % region(reg) % c1_z = c1c2(1) Por % region(reg) % c2_z = c1c2(2) else diff --git a/Sources/Process/Process_Mod.f90 b/Sources/Process/Process_Mod.f90 index f4b555436..1015dff06 100644 --- a/Sources/Process/Process_Mod.f90 +++ b/Sources/Process/Process_Mod.f90 @@ -1,4 +1,6 @@ #include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" !==============================================================================! module Process_Mod diff --git a/Sources/Process/Process_Mod/Balance_Volume.f90 b/Sources/Process/Process_Mod/Balance_Volume.f90 index 55caf79e4..a281ca708 100644 --- a/Sources/Process/Process_Mod/Balance_Volume.f90 +++ b/Sources/Process/Process_Mod/Balance_Volume.f90 @@ -26,10 +26,14 @@ subroutine Balance_Volume(Process, Flow, Vof) type(Bulk_Type), pointer :: bulk type(Var_Type), pointer :: u, v, w type(Face_Type), pointer :: v_flux - integer :: s, c1, c2 + integer :: s, c2, reg real :: fac, vol_outflow, area_outflow +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! + call Profiler % Start('Balance_Volume') + ! Take aliases Grid => Flow % pnt_grid bulk => Flow % bulk @@ -42,23 +46,21 @@ subroutine Balance_Volume(Process, Flow, Vof) ! (These might not obey the volume conservation) ! ! ! !--------------------------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Side is on the boundary - if(c2 < 0) then - - if(Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) v_flux % n(s) = 0.0 - else + end do + else + do s = Faces_In_Region(reg) + c2 = Grid % faces_c(2,s) + v_flux % n(s) = ( u % n(c2) * Grid % sx(s) & + v % n(c2) * Grid % sy(s) & + w % n(c2) * Grid % sz(s) ) - end if - end if - - end do + end do ! faces + end if ! boundary condition type + end do ! regions !--------------------------------------! ! ! @@ -77,13 +79,11 @@ subroutine Balance_Volume(Process, Flow, Vof) !----------------------------------------------------------! vol_outflow = 0.0 area_outflow = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. this_proc) then - if(Grid % Bnd_Cond_Type(c2) .eq. PRESSURE .or. & - Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. PRESSURE .or. & + Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) ! Integrate volume flux only where something does come out if(v_flux % n(s) > 0.0) then @@ -92,11 +92,12 @@ subroutine Balance_Volume(Process, Flow, Vof) ! Integrate area everywhere where outflow is specified area_outflow = area_outflow + Grid % s(s) - end if + + end do end if end do - call Comm_Mod_Global_Sum_Real(vol_outflow) - call Comm_Mod_Global_Sum_Real(area_outflow) + call Global % Sum_Real(vol_outflow) + call Global % Sum_Real(area_outflow) !------------------------------------------------------! ! ! @@ -112,17 +113,13 @@ subroutine Balance_Volume(Process, Flow, Vof) ! This works better if domain features pressure outflow ... ! !---------------------------------------------------------------! if(Flow % has_pressure) then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Volume flux at the boundary face - if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. this_proc) then - if(Grid % Bnd_Cond_Type(c2) .eq. INFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. INFLOW .or. & + Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. CONVECT .or. & + Grid % region % type(reg) .eq. PRESSURE) then + do s = Faces_In_Region(reg) if(v_flux % n(s) > 0.0) then bulk % vol_out = bulk % vol_out + v_flux % n(s) bulk % area_out = bulk % area_out + Grid % s(s) @@ -130,42 +127,37 @@ subroutine Balance_Volume(Process, Flow, Vof) bulk % vol_in = bulk % vol_in - v_flux % n(s) bulk % area_in = bulk % area_in + Grid % s(s) end if - end if - - end if - end do + end do ! faces + end if ! boundary conditions + end do ! regions !-----------------------------------------------------------------------! ! ... but this variant works better for all other types of outflows ! !-----------------------------------------------------------------------! else - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Volume flux at the boundary face - if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. this_proc) then - - if(Grid % Bnd_Cond_Type(c2) .eq. INFLOW) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. INFLOW) then + do s = Faces_In_Region(reg) bulk % vol_in = bulk % vol_in - v_flux % n(s) bulk % area_in = bulk % area_in + Grid % s(s) - end if - - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE) then + end do + end if ! boundary condition + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. CONVECT .or. & + Grid % region % type(reg) .eq. PRESSURE) then + do s = Faces_In_Region(reg) bulk % vol_out = bulk % vol_out + v_flux % n(s) bulk % area_out = bulk % area_out + Grid % s(s) - end if + end do + end if ! boundary condition + end do ! regions - end if - end do - end if + end if ! flow has pressure - call Comm_Mod_Global_Sum_Real(bulk % vol_in) - call Comm_Mod_Global_Sum_Real(bulk % vol_out) - call Comm_Mod_Global_Sum_Real(bulk % area_in) - call Comm_Mod_Global_Sum_Real(bulk % area_out) + call Global % Sum_Real(bulk % vol_in) + call Global % Sum_Real(bulk % vol_out) + call Global % Sum_Real(bulk % area_in) + call Global % Sum_Real(bulk % area_out) ! Avoid divisions by zero for the cases without any fluid motion fac = 1.0 @@ -187,13 +179,13 @@ subroutine Balance_Volume(Process, Flow, Vof) if(Math % Approx_Real(vol_outflow, 0.0, tol=FEMTO)) then bulk % vol_out = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. this_proc) then - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE) then + + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. CONVECT .or. & + Grid % region % type(reg) .eq. PRESSURE) then + do s = Faces_In_Region(reg) + c2 = Grid % faces_c(2,s) ! Update velocity components ... u % n(c2) = (bulk % vol_in + bulk % vol_src) / area_outflow & @@ -210,12 +202,12 @@ subroutine Balance_Volume(Process, Flow, Vof) ! ... and bulk volume out bulk % vol_out = bulk % vol_out + v_flux % n(s) - end if - end if - end do + end do ! faces + end if ! boundary condition + end do ! region ! Holy mackrele: summ it up over all processors - call Comm_Mod_Global_Sum_Real(bulk % vol_out) + call Global % Sum_Real(bulk % vol_out) !-------------------------------------------------! ! Something is coming out from real outflows, ! @@ -229,13 +221,13 @@ subroutine Balance_Volume(Process, Flow, Vof) ! ... and correct all velocities bulk % vol_out = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE) then + + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. CONVECT .or. & + Grid % region % type(reg) .eq. PRESSURE) then + do s = Faces_In_Region(reg) + c2 = Grid % faces_c(2,s) ! Update velocity components ... u % n(c2) = u % n(c2) * fac + bulk % vol_src / bulk % area_out & @@ -252,12 +244,12 @@ subroutine Balance_Volume(Process, Flow, Vof) ! ... and bulk volume out bulk % vol_out = bulk % vol_out + v_flux % n(s) - end if - end if - end do + end do ! faces + end if ! boundary condition + end do ! regions ! Holy mackrele: summ it up over all processors - call Comm_Mod_Global_Sum_Real(bulk % vol_out) ! not checked + call Global % Sum_Real(bulk % vol_out) ! not checked end if @@ -266,4 +258,6 @@ subroutine Balance_Volume(Process, Flow, Vof) call Grid % Exchange_Cells_Real(v % n) call Grid % Exchange_Cells_Real(w % n) + call Profiler % Stop('Balance_Volume') + end subroutine diff --git a/Sources/Process/Process_Mod/Compute_Energy.f90 b/Sources/Process/Process_Mod/Compute_Energy.f90 index c9d2316c8..c8bc728e2 100644 --- a/Sources/Process/Process_Mod/Compute_Energy.f90 +++ b/Sources/Process/Process_Mod/Compute_Energy.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) + subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! Purpose: Solve transport equation for scalar (such as temperature) ! !------------------------------------------------------------------------------! @@ -10,8 +10,6 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t @@ -22,6 +20,8 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) real :: a12, a21, con_eff, dt real :: f_ex, f_im, tx_f, ty_f, tz_f, t_stress, q_exp real, contiguous, pointer :: cap_dens(:), q_int(:), q_turb(:), cross(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !------------------------------------------------------------------------------! ! ! The form of equations which are solved: @@ -58,6 +58,8 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) ! heat flux Flow % heat_flux [W/m^2] !==============================================================================! + if(.not. Flow % heat_transfer) return + call Profiler % Start('Compute_Energy (without solvers)') call Work % Connect_Real_Cell(cap_dens, q_int, q_turb, cross) @@ -71,7 +73,7 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) call Sol % Alias_Native (A, b) ! User function - call User_Mod_Beginning_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) + call User_Mod_Beginning_Of_Compute_Energy(Flow, Turb, Vof, Sol) ! Initialize cross diffusion sources, matrix and right hand side cross (:) = 0.0 @@ -84,7 +86,7 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) q_int (:) = 0.0 ! Old values (o and oo) - if(ini .eq. 1) then + if(Iter % Current() .eq. 1) then do c = 1, Grid % n_cells t % oo(c) = t % o(c) t % o (c) = t % n(c) @@ -269,7 +271,8 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) ! Under-relax the equations call Numerics_Mod_Under_Relax(t, A, b) - call Profiler % Start('Linear_Solver_For_Energy') + call Profiler % Start(String % First_Upper(t % solver) // & + ' (solver for energy)') ! Call linear solver to solve the equations call Sol % Run(t % solver, & @@ -283,10 +286,11 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) t % tol, & t % res) - call Profiler % Stop('Linear_Solver_For_Energy') + call Profiler % Stop(String % First_Upper(t % solver) // & + ' (solver for energy)') ! Print some info on the screen - call Info_Mod_Iter_Fill_At(1, 6, t % name, t % eniter, t % res) + call Info % Iter_Fill_At(1, 6, t % name, t % res, t % eniter) ! Gradients if(.not. Flow % mass_transfer) then @@ -298,7 +302,7 @@ subroutine Compute_Energy(Process, Flow, Turb, Vof, Sol, curr_dt, ini) end if ! User function - call User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) + call User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol) call Work % Disconnect_Real_Cell(cap_dens, q_int, q_turb, cross) diff --git a/Sources/Process/Process_Mod/Compute_Momentum.f90 b/Sources/Process/Process_Mod/Compute_Momentum.f90 index 4773c6028..b0bcb26c8 100644 --- a/Sources/Process/Process_Mod/Compute_Momentum.f90 +++ b/Sources/Process/Process_Mod/Compute_Momentum.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) + subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol) !------------------------------------------------------------------------------! ! Discretizes and solves momentum conservation equations ! !------------------------------------------------------------------------------! @@ -11,8 +11,6 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol type(Porosity_Type), target :: Por - integer, intent(in) :: curr_dt - integer, intent(in) :: ini !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk @@ -32,6 +30,8 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) real :: grav_i, p_drop_i real :: ui_si, ui_di real, contiguous, pointer :: cross(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !------------------------------------------------------------------------------! ! ! ! Stress tensor on the face s: ! @@ -97,14 +97,13 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) b => Sol % Nat % b % val ! User function - call User_Mod_Beginning_Of_Compute_Momentum(Flow, Turb, Vof, Sol, & - curr_dt, ini) + call User_Mod_Beginning_Of_Compute_Momentum(Flow, Turb, Vof, Sol) !-------------------------------------------------------! ! Store the old volume fluxes for Choi's correction ! !-------------------------------------------------------! if(.not. Flow % inside_piso_loop) then ! check about this - if(ini .eq. 1) then + if(Iter % Current() .eq. 1) then do s = 1, Grid % n_faces v_flux % oo(s) = v_flux % o(s) v_flux % o (s) = v_flux % n(s) @@ -170,12 +169,12 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) do c = -Grid % n_bnd_cells, Grid % n_cells vel_max = max(vel_max, sqrt(ui % n(c)**2 + uj % n(c)**2 + uk % n(c)**2)) end do - call Comm_Mod_Global_Max_Real(vel_max) + call Global % Max_Real(vel_max) ! Old values (o) and older than old (oo) if(.not. Flow % inside_piso_loop) then - if(ini .eq. 1) then - do c = 1, Grid % n_cells + if(Iter % Current() .eq. 1) then + do c = Cells_In_Domain_And_Buffers() ui % oo(c) = ui % o(c) ui % o (c) = ui % n(c) end do @@ -269,7 +268,7 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) ! Explicit treatment for cross diffusion terms ! (Shouldn't theese, in an ideal world, ! also be treated in Rhie and Chow?) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() fi(c) = fi(c) + cross(c) end do @@ -289,14 +288,14 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) !--------------------------! ! Global pressure drop ! !--------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() fi(c) = fi(c) + p_drop_i * Grid % vol(c) end do !--------------------! ! Buoyancy force ! !--------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() fi(c) = fi(c) + cell_fi(c) * Grid % vol(c) end do @@ -310,7 +309,7 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) ! (Note: pressure gradients are not with other forces. ! ! Same is true for surface tension, see nex comments) ! !-----------------------------------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() b(c) = fi(c) - p_i(c) * Grid % vol(c) end do @@ -321,7 +320,7 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) !----------------------------------------------------------------! if(Flow % with_interface) then call Vof % Surface_Tension_Force(i) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() b(c) = b(c) + st_i(c) * Grid % vol(c) end do end if @@ -335,7 +334,7 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) ! from under-relaxation factors and Majumdar ! ! correction in Rhie_And_Chow is not needed ! !------------------------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() M % sav(c) = M % val(M % dia(c)) end do @@ -358,7 +357,8 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) ! Under-relax the equations call Numerics_Mod_Under_Relax(ui, M, b) - call Profiler % Start('Linear_Solver_For_Momentum') + call Profiler % Start(String % First_Upper(ui % solver) // & + ' (solver for momentum)') ! Call linear solver call Sol % Run(ui % solver, & @@ -373,11 +373,12 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) ui % res, & norm = vel_max) - call Profiler % Stop('Linear_Solver_For_Momentum') + call Profiler % Stop(String % First_Upper(ui % solver) // & + ' (solver for momentum)') ! Fill the info screen up if (Flow % p_m_coupling == SIMPLE) then - call Info_Mod_Iter_Fill_At(1, i, ui % name, ui % eniter, ui % res) + call Info % Iter_Fill_At(1, i, ui % name, ui % res, ui % eniter) end if end if @@ -392,7 +393,7 @@ subroutine Compute_Momentum(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) call Grid % Exchange_Cells_Real(M % sav) ! User function - call User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol, curr_dt, ini) + call User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol) call Work % Disconnect_Real_Cell(cross) diff --git a/Sources/Process/Process_Mod/Compute_Momentum_Explicit.f90 b/Sources/Process/Process_Mod/Compute_Momentum_Explicit.f90 index 4f664318e..4046fccae 100644 --- a/Sources/Process/Process_Mod/Compute_Momentum_Explicit.f90 +++ b/Sources/Process/Process_Mod/Compute_Momentum_Explicit.f90 @@ -15,6 +15,8 @@ subroutine Compute_Momentum_Explicit(Process, Flow, ui, Nat) real, contiguous, pointer :: b(:) integer :: s, c, c1, c2 real, contiguous, pointer :: sum_neigh(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! call Profiler % Start('Compute_Momentum_Explicit') @@ -31,19 +33,16 @@ subroutine Compute_Momentum_Explicit(Process, Flow, ui, Nat) ! Sum of neighbours sum_neigh(:) = 0.0 - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(Grid % Comm % cell_proc(c1) .eq. this_proc) then - if(c2 > 0) then - sum_neigh(c1) = sum_neigh(c1) - M % val(M % pos(1,s)) * ui % n(c2) - sum_neigh(c2) = sum_neigh(c2) - M % val(M % pos(2,s)) * ui % n(c1) - end if - end if + + sum_neigh(c1) = sum_neigh(c1) - M % val(M % pos(1,s)) * ui % n(c2) + sum_neigh(c2) = sum_neigh(c2) - M % val(M % pos(2,s)) * ui % n(c1) end do ! Solve velocity explicitely (no under relaxation!!) - do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells + do c = Cells_In_Domain() ui % n(c) = (sum_neigh(c) + b(c)) / M % val(M % dia(c)) end do diff --git a/Sources/Process/Process_Mod/Compute_Pressure.f90 b/Sources/Process/Process_Mod/Compute_Pressure.f90 index bf7a7bb56..afb8cb3cb 100644 --- a/Sources/Process/Process_Mod/Compute_Pressure.f90 +++ b/Sources/Process/Process_Mod/Compute_Pressure.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) + subroutine Compute_Pressure(Process, Flow, Vof, Sol) !------------------------------------------------------------------------------! ! Forms and solves pressure equation for the SIMPLE method. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) type(Field_Type), target :: Flow type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk @@ -21,10 +19,9 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) real, contiguous, pointer :: b(:) integer :: s, c, c1, c2 real :: p_max, p_min, p_nor, p_nor_c, dt, a12 - character(SL) :: solver -!==============================================================================! +!------------------------------------------------------------------------------! ! -! The form of equations which I am solving: +! The form of equations which are being solved: ! ! / / ! | | @@ -62,17 +59,17 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) call Flow % Alias_Momentum(u, v, w) ! Volume balance reporting - call Flow % Report_Volume_Balance_Start(curr_dt, ini) + call Flow % Report_Vol_Balance_Start(Iter % Current()) ! User function - call User_Mod_Beginning_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) + call User_Mod_Beginning_Of_Compute_Pressure(Flow, Vof, Sol) !--------------------------------------------------! ! Find the value for normalization of pressure ! !--------------------------------------------------! ! From control file - call Control_Mod_Normalization_For_Pressure_Solver(p_nor_c) + call Control % Normalization_For_Pressure_Solver(p_nor_c) ! Calculate pressure magnitude for normalization of pressure solution p_max = -HUGE @@ -81,8 +78,8 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) p_max = max(p_max, p % n(c)) p_min = min(p_min, p % n(c)) end do - call Comm_Mod_Global_Max_Real(p_max) - call Comm_Mod_Global_Min_Real(p_min) + call Global % Max_Real(p_max) + call Global % Min_Real(p_min) ! Normalize pressure with the maximum of pressure difference, ! value defined in control file and pressure drops. @@ -138,7 +135,7 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) end do ! Volume balance reporting - call Flow % Report_Volume_Balance(Sol, curr_dt, ini) + call Flow % Report_Vol_Balance(Sol, Iter % Current()) !------------------------------------------! ! Cross diffusion fluxes for pressure ! @@ -182,10 +179,8 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) !-------------------------------------------------------------------------! call Vof % Mass_Transfer_Pressure_Source(b) - ! Get solver - call Control_Mod_Solver_For_Pressure(solver) - - call Profiler % Start('Linear_Solver_For_Pressure') + call Profiler % Start(String % First_Upper(pp % solver) // & + ' (solver for pressure)') ! Set singularity to the matrix if(.not. Flow % has_pressure) then @@ -210,13 +205,14 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) call Sol % Remove_Singular(A) end if - call Profiler % Stop('Linear_Solver_For_Pressure') + call Profiler % Stop(String % First_Upper(pp % solver) // & + ' (solver for pressure)') if (Flow % p_m_coupling == SIMPLE) then - call Info_Mod_Iter_Fill_At(1, 4, pp % name, pp % eniter, pp % res) + call Info % Iter_Fill_At(1, 4, pp % name, pp % res, pp % eniter) else if (Flow % i_corr == Flow % n_piso_corrections) then - call Info_Mod_Iter_Fill_At(1, 4, pp % name, pp % eniter, pp % res) + call Info % Iter_Fill_At(1, 4, pp % name, pp % res, pp % eniter) end if end if @@ -237,16 +233,16 @@ subroutine Compute_Pressure(Process, Flow, Vof, Sol, curr_dt, ini) p_max = maxval(p % n(1:Grid % n_cells)) p_min = minval(p % n(1:Grid % n_cells)) - call Comm_Mod_Global_Max_Real(p_max) - call Comm_Mod_Global_Min_Real(p_min) + call Global % Max_Real(p_max) + call Global % Min_Real(p_min) p % n(:) = p % n(:) - 0.5*(p_max+p_min) ! User function - call User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) + call User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol) ! Volume balance reporting - call Flow % Report_Volume_Balance_Stop() + call Flow % Report_Vol_Balance_Stop() call Profiler % Stop('Compute_Pressure (without solvers)') diff --git a/Sources/Process/Process_Mod/Compute_Scalar.f90 b/Sources/Process/Process_Mod/Compute_Scalar.f90 index 76606ae4d..105095a4f 100644 --- a/Sources/Process/Process_Mod/Compute_Scalar.f90 +++ b/Sources/Process/Process_Mod/Compute_Scalar.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) + subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, sc) !------------------------------------------------------------------------------! ! Purpose: Solve transport equation for user defined scalar. ! !------------------------------------------------------------------------------! @@ -10,8 +10,6 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini integer, intent(in) :: sc !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -27,6 +25,8 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) real :: phi_stress, q_exp real :: phix_f, phiy_f, phiz_f real, contiguous, pointer :: q_turb(:), cross(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !------------------------------------------------------------------------------! ! ! The form of equations which are solved: @@ -39,7 +39,7 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) ! !==============================================================================! - call Profiler % Start('Compute_Scalars (without solvers)') + call Profiler % Start('Compute_Scalar (without solvers)') call Work % Connect_Real_Cell(q_turb, cross) @@ -52,8 +52,7 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) call Sol % Alias_Native (A, b) ! User function - call User_Mod_Beginning_Of_Compute_Scalar(Flow, Turb, Vof, Sol, & - curr_dt, ini, sc) + call User_Mod_Beginning_Of_Compute_Scalar(Flow, Turb, Vof, Sol, sc) ! Initialize cross diffusion sources, matrix and right hand side cross(:) = 0.0 @@ -69,7 +68,7 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) !--------------------------! ! Old values (o and oo) - if(ini.lt.2) then + if(Iter % Current() .lt. 2) then do c = 1, Grid % n_cells phi % oo(c) = phi % o(c) phi % o (c) = phi % n(c) @@ -95,7 +94,9 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) !----------------------------! ! Spatial discretization ! !----------------------------! - call Control_Mod_Turbulent_Schmidt_Number(sc_t) ! get default sc_t (0.9) + + ! It used to read sc_t from here which is an overkill, so check + Assert(sc_t > 0.0) do s = 1, Grid % n_faces @@ -205,7 +206,8 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) ! Under-relax the equations call Numerics_Mod_Under_Relax(phi, A, b) - call Profiler % Start('Linear_Solver_For_Scalars') + call Profiler % Start(String % First_Upper(phi % solver) // & + ' (solver for scalars)') ! Call linear solver to solve them call Sol % Run(phi % solver, & @@ -219,21 +221,22 @@ subroutine Compute_Scalar(Process, Flow, Turb, Vof, Sol, curr_dt, ini, sc) phi % tol, & phi % res) - call Profiler % Stop('Linear_Solver_For_Scalars') + call Profiler % Stop(String % First_Upper(phi % solver) // & + ' (solver for scalars)') read(phi % name(3:4), *) ns ! reterive the number of scalar row = ceiling(ns/6) ! will be 1 (scal. 1-6), 2 (scal. 6-12), etc. col = nint(ns) - (row-1)*6 ! will be in range 1 - 6 - call Info_Mod_Iter_Fill_User_At(row, col, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_Scalar_At(row, col, phi % name, phi % res, phi % eniter) call Flow % Grad_Variable(phi) ! User function - call User_Mod_End_Of_Compute_Scalar(Flow, Turb, Vof, Sol, curr_dt, ini, sc) + call User_Mod_End_Of_Compute_Scalar(Flow, Turb, Vof, Sol, sc) call Work % Disconnect_Real_Cell(q_turb, cross) - call Profiler % Stop('Compute_Scalars (without solvers)') + call Profiler % Stop('Compute_Scalar (without solvers)') end subroutine diff --git a/Sources/Process/Process_Mod/Convective_Outflow.f90 b/Sources/Process/Process_Mod/Convective_Outflow.f90 index 0d1bbc07e..7db47a6dd 100644 --- a/Sources/Process/Process_Mod/Convective_Outflow.f90 +++ b/Sources/Process/Process_Mod/Convective_Outflow.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) + subroutine Convective_Outflow(Process, Flow, Turb, Vof) !------------------------------------------------------------------------------! ! Extrapoloate variables on the boundaries where needed. ! !------------------------------------------------------------------------------! @@ -9,18 +9,19 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) type(Field_Type), target :: Flow type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof - integer, intent(in) :: curr_dt !------------------------------[Local parameters]------------------------------! integer, parameter :: BEGIN = 12 !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk - type(Var_Type), pointer :: u, v, w, t, phi + type(Var_Type), pointer :: u, v, w, t, phi, vis type(Var_Type), pointer :: kin, eps, zeta, f22, t2 type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw type(Face_Type), pointer :: v_flux - integer :: c1, c2, s, sc + integer :: c1, c2, s, sc, reg real :: nx, ny, nz, bulk_vel, phi_n, dt +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! ! Take aliases @@ -33,6 +34,7 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) call Turb % Alias_K_Eps_Zeta_F(kin, eps, zeta, f22) call Turb % Alias_Stresses (uu, vv, ww, uv, uw, vw) call Turb % Alias_T2 (t2) + call Turb % Alias_Vis (vis) !------------------------------------------------! ! Compute bulk velocity via a user function. ! @@ -52,19 +54,17 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) ! ! !------------------------! - if(curr_dt > BEGIN) then + if(Time % Curr_Dt() > BEGIN) then call Flow % Grad_Variable(Flow % u) call Flow % Grad_Variable(Flow % v) call Flow % Grad_Variable(Flow % w) - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) call Grid % Face_Normal(s, nx, ny, nz) phi_n = u % x(c1) * nx + u % y(c1) * ny + u % z(c1) * nz @@ -75,27 +75,26 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) phi_n = w % x(c1) * nx + w % y(c1) * ny + w % z(c1) * nz w % n(c2) = w % n(c2) - bulk_vel * phi_n * dt - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - else ! curr_dt <= BEGIN + else ! Time % Curr_Dt() <= BEGIN - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then u % n(c2) = u % n(c1) v % n(c2) = v % n(c1) w % n(c2) = w % n(c1) - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - end if ! curr_dt > BEGIN + end if ! Time % Curr_Dt() > BEGIN !--------------------------! ! ! @@ -108,7 +107,7 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) !-----------------! if(Turb % model .eq. K_EPS) then - if(curr_dt > BEGIN) then + if(Time % Curr_Dt() > BEGIN) then call Flow % Grad_Variable(kin) call Flow % Grad_Variable(eps) @@ -116,13 +115,11 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) call Flow % Grad_Variable(t2) end if - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) call Grid % Face_Normal(s, nx, ny, nz) phi_n = kin % x(c1) * nx + kin % y(c1) * ny + kin % z(c1) * nz @@ -135,29 +132,28 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) phi_n = t2 % x(c1) * nx + t2 % y(c1) * ny + t2 % z(c1) * nz t2 % n(c2) = t2 % n(c2) - bulk_vel * phi_n * dt end if - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - else ! curr_dt <= BEGIN + else ! Time % Curr_Dt() <= BEGIN - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then kin % n(c2) = kin % n(c1) eps % n(c2) = eps % n(c1) if(Flow % heat_transfer) then t2 % n(c2) = t2 % n(c1) end if - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - end if ! curr_dt > BEGIN + end if ! Time % Curr_Dt() > BEGIN end if @@ -167,7 +163,7 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) if(Turb % model .eq. K_EPS_ZETA_F .or. & Turb % model .eq. HYBRID_LES_RANS) then - if(curr_dt > BEGIN) then + if(Time % Curr_Dt() > BEGIN) then call Flow % Grad_Variable(kin) call Flow % Grad_Variable(eps) @@ -177,13 +173,12 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) call Flow % Grad_Variable(t2) end if - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then + ! On the boundary perform the extrapolation + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) call Grid % Face_Normal(s, nx, ny, nz) phi_n = kin % x(c1) * nx + kin % y(c1) * ny + kin % z(c1) * nz @@ -202,19 +197,19 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) phi_n = t2 % x(c1) * nx + t2 % y(c1) * ny + t2 % z(c1) * nz t2 % n(c2) = t2 % n(c2) - bulk_vel * phi_n * dt end if - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - else ! curr_dt <= BEGIN + else ! Time % Curr_Dt() <= BEGIN - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + ! On the boundary perform the extrapolation + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then kin % n(c2) = kin % n(c1) eps % n(c2) = eps % n(c1) f22 % n(c2) = f22 % n(c1) @@ -222,11 +217,51 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) if(Flow % heat_transfer) then t2 % n(c2) = t2 % n(c1) end if - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region + + end if ! Time % Curr_Dt() > BEGIN + + end if - end if ! curr_dt > BEGIN + !---------------------! + ! Spalart-Almaras ! + !---------------------! + if(Turb % model .eq. SPALART_ALLMARAS .or. & + Turb % model .eq. DES_SPALART) then + + if(Time % Curr_Dt() > BEGIN) then + + call Flow % Grad_Variable(vis) + + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + call Grid % Face_Normal(s, nx, ny, nz) + + phi_n = vis % x(c1) * nx + vis % y(c1) * ny + vis % z(c1) * nz + vis % n(c2) = vis % n(c2) - bulk_vel * phi_n * dt + end do ! face + end if ! boundary condition + end do ! region + + else ! Time % Curr_Dt() <= BEGIN + + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + vis % n(c2) = vis % n(c1) + end do ! face + end if ! boundary condition + end do ! region + + end if ! Time % Curr_Dt() > BEGIN end if @@ -237,7 +272,7 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - if(curr_dt > BEGIN) then + if(Time % Curr_Dt() > BEGIN) then call Flow % Grad_Variable(uu) call Flow % Grad_Variable(vv) @@ -250,13 +285,11 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) call Flow % Grad_Variable(f22) end if - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) call Grid % Face_Normal(s, nx, ny, nz) phi_n = uu % x(c1) * nx + uu % y(c1) * ny + uu % z(c1) * nz @@ -284,19 +317,18 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) phi_n = f22 % x(c1) * nx + f22 % y(c1) * ny + f22 % z(c1) * nz f22 % n(c2) = f22 % n(c2) - bulk_vel * phi_n * dt end if - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - else ! curr_dt <= BEGIN + else ! Time % Curr_Dt() <= BEGIN - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then uu % n(c2) = uu % n(c1) vv % n(c2) = vv % n(c1) ww % n(c2) = ww % n(c1) @@ -307,11 +339,11 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then f22 % n(c2) = f22 % n(c1) end if - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - end if ! curr_dt > BEGIN + end if ! Time % Curr_Dt() > BEGIN end if @@ -324,40 +356,37 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) - if(curr_dt > BEGIN) then + if(Time % Curr_Dt() > BEGIN) then call Flow % Grad_Variable(phi) - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) call Grid % Face_Normal(s, nx, ny, nz) phi_n = phi % x(c1) * nx + phi % y(c1) * ny + phi % z(c1) * nz phi % n(c2) = phi % n(c2) - bulk_vel * phi_n * dt - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - else ! curr_dt <= BEGIN + else ! Time % Curr_Dt() <= BEGIN - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then phi % n(c2) = phi % n(c1) - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - end if ! curr_dt > BEGIN + end if ! Time % Curr_Dt() > BEGIN end do ! sc @@ -369,41 +398,39 @@ subroutine Convective_Outflow(Process, Flow, Turb, Vof, curr_dt) if(Flow % heat_transfer) then - if(curr_dt > BEGIN) then + if(Time % Curr_Dt() > BEGIN) then ! Temperature gradients might have been computed and ! stored already in t % x, t % y and t % z, check it call Flow % Grad_Variable(t) - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) call Grid % Face_Normal(s, nx, ny, nz) phi_n = t % x(c1) * nx + t % y(c1) * ny + t % z(c1) * nz t % n(c2) = t % n(c2) - bulk_vel * phi_n * dt - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - else ! curr_dt <= BEGIN + else ! Time % Curr_Dt() <= BEGIN - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. CONVECT) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if( (Grid % Bnd_Cond_Type(c2) .eq. CONVECT) ) then t % n(c2) = t % n(c1) - end if - end if - end do ! s + end do ! face + end if ! boundary condition + end do ! region - end if ! curr_dt < BEGIN + end if ! Time % Curr_Dt() < BEGIN end if diff --git a/Sources/Process/Process_Mod/Correct_Velocity.f90 b/Sources/Process/Process_Mod/Correct_Velocity.f90 index 9e44e1921..767efed1f 100644 --- a/Sources/Process/Process_Mod/Correct_Velocity.f90 +++ b/Sources/Process/Process_Mod/Correct_Velocity.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) + subroutine Correct_Velocity(Process, Flow, Vof, Sol) !------------------------------------------------------------------------------! ! Corrects the velocities, and mass (or volume) fluxes on cell faces. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) type(Field_Type), target :: Flow type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk @@ -21,6 +19,8 @@ subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) real, contiguous, pointer :: b(:) integer :: c, c1, c2, s real :: cfl_t, pe_t, dens_f, visc_f, dt +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! call Profiler % Start('Correct_Velocity') @@ -38,7 +38,7 @@ subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) call Flow % Alias_Momentum(u, v, w) ! User function - call User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) + call User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol) !-----------------------------------------! ! Correct velocities and fluxes with ! @@ -70,6 +70,10 @@ subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) end if end do + + ! User function + call User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol) + !------------------------------------! ! Calculate the max volume error ! ! with the new corrected fluxes ! @@ -98,7 +102,7 @@ subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells Flow % vol_res = max(Flow % vol_res, abs(b(c))) end do - call Comm_Mod_Global_Max_Real(Flow % vol_res) + call Global % Max_Real(Flow % vol_res) !------------------------------! ! Calculate the CFL number ! @@ -124,20 +128,17 @@ subroutine Correct_Velocity(Process, Flow, Vof, Sol, curr_dt, ini) Flow % pe_max = max( Flow % pe_max, pe_t ) end if end do - call Comm_Mod_Global_Max_Real(Flow % cfl_max) - call Comm_Mod_Global_Max_Real(Flow % pe_max) + call Global % Max_Real(Flow % cfl_max) + call Global % Max_Real(Flow % pe_max) - if (Flow % p_m_coupling == SIMPLE) then - call Info_Mod_Iter_Fill_At(1, 5, 'dum', -1, Flow % vol_res) + if(Flow % p_m_coupling == SIMPLE) then + call Info % Iter_Fill_At(1, 5, 'dum', Flow % vol_res) else - if (Flow % i_corr == Flow % n_piso_corrections) then - call Info_Mod_Iter_Fill_At(1, 5, 'dum', -1, Flow % vol_res) + if(Flow % i_corr == Flow % n_piso_corrections) then + call Info % Iter_Fill_At(1, 5, 'dum', Flow % vol_res) end if end if - ! User function - call User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) - call Profiler % Stop('Correct_Velocity') end subroutine diff --git a/Sources/Process/Process_Mod/Initialize_Variables.f90 b/Sources/Process/Process_Mod/Initialize_Variables.f90 index a94502d30..4e7a0b8a9 100644 --- a/Sources/Process/Process_Mod/Initialize_Variables.f90 +++ b/Sources/Process/Process_Mod/Initialize_Variables.f90 @@ -47,15 +47,18 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) integer :: n_points, k real, allocatable :: prof(:,:), x(:), y(:), z(:), dist(:) - logical :: found + logical :: found, file_exists ! Default values for initial conditions character(3) :: u_def = '0.0', v_def = '0.0', w_def = '0.0' character(3) :: t_def = '0.0', t2_def = '0.0', phi_def = '0.0' + character(3) :: vf_def = '0.0' character(3) :: kin_def = '0.0', eps_def = '0.0', f22_def = '0.0' character(3) :: vis_def = '0.0', zeta_def = '0.0' character(3) :: uu_def = '0.0', vv_def = '0.0', ww_def = '0.0' character(3) :: uv_def = '0.0', uw_def = '0.0', vw_def = '0.0' +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! ! Take aliases @@ -73,12 +76,12 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) call Turb % Alias_T2 (t2) area = 0.0 - if (this_proc < 2) print '(a,a)', ' # Grid name: ', trim(Grid % name) + if (First_Proc()) print '(a,a)', ' # Grid name: ', trim(Grid % name) ! Found the line where boundary condition definition is defined - call Control_Mod_Position_At_One_Key('INITIAL_CONDITION', & - found, & - .true.) + call Control % Position_At_One_Key('INITIAL_CONDITION', & + found, & + .true.) !-----------------------------------------------! ! ! @@ -87,7 +90,7 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) !-----------------------------------------------! if (found) then - call Control_Mod_Read_Strings_On('VARIABLES', keys, nks, .true.) + call Control % Read_Strings_On('VARIABLES', keys, nks, .true.) ! Input is valid, turn keys to upper case do i = 1, nks @@ -95,7 +98,7 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) end do ! Check if there is file specified - call Control_Mod_Read_Strings_On('FILE', keys_file, nvs, .true.) + call Control % Read_Strings_On('FILE', keys_file, nvs, .true.) !------------------------------------------------! ! ! @@ -104,17 +107,17 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) !------------------------------------------------! if (nvs .eq. 1) then ! word 'file' was specified - if (this_proc < 2) & + if (First_Proc()) & print *, '# Values specified in the file: ', trim(keys_file(nvs)) - call File % Open_For_Reading_Ascii(keys_file(1), fu, this_proc) + call File % Open_For_Reading_Ascii(keys_file(1), fu, This_Proc()) ! Number of points call File % Read_Line(fu) read(Line % tokens(1), *) n_points - if (this_proc < 2) print '(a,i0,2a)', " # Reading ", nks, & + if (First_Proc()) print '(a,i0,2a)', " # Reading ", nks, & " columns in file " , trim(keys_file(1)) allocate(prof(n_points, 0:nks)); prof = 0. @@ -238,7 +241,7 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) end do ! c = 1, Grid % n_cells - call Comm_Mod_Wait + call Global % Wait deallocate(prof) deallocate(x) deallocate(y) @@ -255,31 +258,31 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) else ! Go back to key and read again - call Control_Mod_Position_At_One_Key('INITIAL_CONDITION', & - found, & - .true.) + call Control % Position_At_One_Key('INITIAL_CONDITION', & + found, & + .true.) - call Control_Mod_Read_Strings_On('VARIABLES', keys, nks, .true.) + call Control % Read_Strings_On('VARIABLES', keys, nks, .true.) ! Input is valid, turn keys to upper case do i = 1, nks call String % To_Upper_Case(keys(i)) end do - call Control_Mod_Read_Strings_On('VALUES', vals(1), nvs, .true.) + call Control % Read_Strings_On('VALUES', vals(1), nvs, .true.) ! Check validity of the input - if(nks .eq. 0 .or. nvs .eq. 0 .and. this_proc < 2) then - print '(2a)', '# Critical, for initial condition: ', & - ' no values or variables have been provided' - call Comm_Mod_End - stop + if(nks .eq. 0 .or. nvs .eq. 0) then + call Message % Error(72, & + 'Critical, for initial condition: '// & + 'no values or variables have been provided ', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if - if(nks .ne. nvs .and. this_proc < 2) then - print '(2a)', '# Critical for initial conditions, number of values ', & - ' is not the same as number of provided variable names' - call Comm_Mod_End - stop + if(nks .ne. nvs) then + call Message % Error(72, & + 'Critical, for initial condition: number of values '// & + 'is not the same as number of provided variable names.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if ! Input is valid, turn keys to upper case @@ -318,6 +321,15 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) t % oo(c) = t % n(c) end if + !---------! + ! Vof ! + !---------! + if(Flow % with_interface) then + vals(0) = vf_def + read(vals(Key_Ind('VOF', keys, nks)), *, err=999) Vof % fun % n(c) + 999 continue ! file name may be defined + end if + !-------------! ! Scalars ! !-------------! @@ -419,7 +431,12 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) !---------------------------------! if(Flow % with_interface) then read(vals(Key_Ind('VOF', keys, nks)), *) Vof % name_stl - call Vof % Initialize_From_Stl() + inquire(file = trim(Vof % name_stl), exist = file_exists) + + ! File exists + if(file_exists) then + call Vof % Initialize_From_Stl() + endif end if end if @@ -471,15 +488,15 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) end if end do - call Comm_Mod_Global_Sum_Int(n_wall) - call Comm_Mod_Global_Sum_Int(n_inflow) - call Comm_Mod_Global_Sum_Int(n_outflow) - call Comm_Mod_Global_Sum_Int(n_symmetry) - call Comm_Mod_Global_Sum_Int(n_heated_wall) - call Comm_Mod_Global_Sum_Int(n_convect) - call Comm_Mod_Global_Sum_Int(n_pressure) - call Comm_Mod_Global_Sum_Real(bulk % vol_in) - call Comm_Mod_Global_Sum_Real(area) + call Global % Sum_Int(n_wall) + call Global % Sum_Int(n_inflow) + call Global % Sum_Int(n_outflow) + call Global % Sum_Int(n_symmetry) + call Global % Sum_Int(n_heated_wall) + call Global % Sum_Int(n_convect) + call Global % Sum_Int(n_pressure) + call Global % Sum_Real(bulk % vol_in) + call Global % Sum_Real(area) !----------------------------------------------------------------------! ! This parameter, has_pressure_outlet, is used in Compute_Pressure ! @@ -502,7 +519,7 @@ subroutine Initialize_Variables(Process, Flow, Turb, Vof, Swarm, Sol) !----------------------! ! Initializes time ! !----------------------! - if(this_proc < 2) then + if(First_Proc()) then if(n_inflow .gt. 0) then print '(a29,es12.5)', ' # Volume inflow : ', bulk % vol_in if(Flow % with_interface) then diff --git a/Sources/Process/Process_Mod/Logo_Pro.f90 b/Sources/Process/Process_Mod/Logo_Pro.f90 index a13f9b191..3f39d6837 100644 --- a/Sources/Process/Process_Mod/Logo_Pro.f90 +++ b/Sources/Process/Process_Mod/Logo_Pro.f90 @@ -1,14 +1,14 @@ !==============================================================================! subroutine Logo_Pro(Process) !------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Const_Mod - use Solver_Mod, only: PETSC_ACTIVE, this_proc + implicit none !---------------------------------[Arguments]----------------------------------! class(Process_Type) :: Process +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then print *,'#===================================' // & '====================================' print *,'#' diff --git a/Sources/Process/Process_Mod/Piso_Algorithm.f90 b/Sources/Process/Process_Mod/Piso_Algorithm.f90 index 24b19debe..7dac377d4 100644 --- a/Sources/Process/Process_Mod/Piso_Algorithm.f90 +++ b/Sources/Process/Process_Mod/Piso_Algorithm.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Piso_Algorithm(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) + subroutine Piso_Algorithm(Process, Flow, Turb, Vof, Por, Sol) !------------------------------------------------------------------------------! ! PISO algorithm ! !------------------------------------------------------------------------------! @@ -11,8 +11,6 @@ subroutine Piso_Algorithm(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) type(Vof_Type), target :: Vof type(Porosity_Type), target :: Por type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! current inner iteration !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w @@ -29,15 +27,15 @@ subroutine Piso_Algorithm(Process, Flow, Turb, Vof, Por, Sol, curr_dt, ini) do corr_steps = 1, Flow % n_piso_corrections Flow % i_corr = corr_steps - call Process % Compute_Momentum(Flow, Turb, Vof, Por, Sol, curr_dt, ini) - call Process % Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) - call Process % Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) + call Process % Compute_Momentum(Flow, Turb, Vof, Por, Sol) + call Process % Compute_Pressure(Flow, Vof, Sol) + call Process % Correct_Velocity(Flow, Vof, Sol) end do Flow % inside_piso_loop = .false. - call Info_Mod_Iter_Fill_At(1, 1, u % name, u % eniter, u % res) - call Info_Mod_Iter_Fill_At(1, 2, v % name, v % eniter, v % res) - call Info_Mod_Iter_Fill_At(1, 3, w % name, w % eniter, w % res) + call Info % Iter_Fill_At(1, 1, u % name, u % res, u % eniter) + call Info % Iter_Fill_At(1, 2, v % name, v % res, v % eniter) + call Info % Iter_Fill_At(1, 3, w % name, w % res, w % eniter) Flow % i_corr = 1 end if diff --git a/Sources/Process/Process_Mod/Rhie_And_Chow.f90 b/Sources/Process/Process_Mod/Rhie_And_Chow.f90 index d2ec940c8..4ad174f71 100644 --- a/Sources/Process/Process_Mod/Rhie_And_Chow.f90 +++ b/Sources/Process/Process_Mod/Rhie_And_Chow.f90 @@ -32,6 +32,8 @@ subroutine Rhie_And_Chow(Process, Flow, Vof, Nat) real, contiguous, pointer :: u_c(:), v_c(:), w_c(:), v_m(:), t_m(:) real, contiguous, pointer :: pst_x(:), pst_y(:), pst_z(:), pst_d(:) real, contiguous, pointer :: u_f(:), v_f(:), w_f(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! call Profiler % Start('Rhie_And_Chow') @@ -157,11 +159,13 @@ subroutine Rhie_And_Chow(Process, Flow, Vof, Nat) !-------------------------------------------------! ! Calculate the mass fluxes on the cell faces ! !-------------------------------------------------! - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) fs = Grid % f(s) + Assert(c2 > 0) + ! Face is inside the domain if(c2 > 0) then diff --git a/Sources/Process/Process_Mod/Update_Boundary_Values.f90 b/Sources/Process/Process_Mod/Update_Boundary_Values.f90 index fc469aec9..60f217131 100644 --- a/Sources/Process/Process_Mod/Update_Boundary_Values.f90 +++ b/Sources/Process/Process_Mod/Update_Boundary_Values.f90 @@ -32,10 +32,14 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) type(Var_Type), pointer :: u, v, w, t, phi, fun type(Var_Type), pointer :: kin, eps, zeta, f22, vis, t2 type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw - integer :: c0, c1, c2, i_fac, s, s1, sc + integer :: c0, c1, c2, i_fac, s, s1, sc, reg real :: kin_vis, u_tau, dt_dn +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Process) !==============================================================================! + call Profiler % Start('Update_Boundary_Values') + ! Take aliases Grid => Flow % pnt_grid vis => Turb % vis @@ -54,11 +58,9 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) update .ne. 'ENERGY' .and. & update .ne. 'SCALARS' .and. & update .ne. 'ALL') then - if(this_proc < 2) then - print *, '# Invalid parameter in call to Update_Boundary_Values' - end if - call Comm_Mod_End - stop + call Message % Error(72, & + 'Invalid parameter in function call. Exiting!', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if !--------------! @@ -68,23 +70,21 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) !--------------! if( (update .eq. 'MOMENTUM' .or. update .eq. 'ALL') ) then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! On the boundary perform the extrapolation - if(c2 < 0) then + ! On the boundary perform the extrapolation + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. PRESSURE .or. & + Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! Extrapolate velocities on the outflow boundary - if( Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE .or. & - Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY ) then u % n(c2) = u % n(c1) v % n(c2) = v % n(c1) w % n(c2) = w % n(c1) - end if - end if ! c2 < 0 - end do + end do ! faces + end if ! boundary condition + end do ! region end if ! update momentum @@ -121,31 +121,96 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) !----------------! if(update .eq. 'TURBULENCE' .or. update .eq. 'ALL') then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + !----------------------! + ! K-epsilon-zeta-f ! + !----------------------! + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then - ! On the boundary perform the extrapolation - if(c2 < 0) then + do reg = Boundary_Regions() + ! Regions outflow, pressure or symmetry + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. PRESSURE .or. & + Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! Spalart Allmaras - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - if ( Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE .or. & - Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then - vis % n(c2) = vis % n(c1) - end if - end if + kin % n(c2) = kin % n(c1) + eps % n(c2) = eps % n(c1) + zeta % n(c2) = zeta % n(c1) + f22 % n(c2) = f22 % n(c1) + if(Flow % heat_transfer) then + t2 % n(c2) = t2 % n(c1) + end if + end do ! faces + end if ! boundary condition + end do ! regions + end if ! turbulence model + + !---------------! + ! K-epsilon ! + !---------------! + if(Turb % model .eq. K_EPS) then + + do reg = Boundary_Regions() + + ! Regions outflow, pressure or symmetry + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. PRESSURE .or. & + Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + kin % n(c2) = kin % n(c1) + eps % n(c2) = eps % n(c1) + if(Flow % heat_transfer) then + t2 % n(c2) = t2 % n(c1) + end if + end do ! faces + end if ! boundary condition + end do ! regions + end if ! turbulence model + + !----------------------! + ! Spalart-Allmaras ! + !----------------------! + if(Turb % model .eq. SPALART_ALLMARAS .or. & + Turb % model .eq. DES_SPALART) then + + do reg = Boundary_Regions() + + ! Regions outflow, pressure or symmetry + if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. PRESSURE .or. & + Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! Reynolds stress models - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + vis % n(c2) = vis % n(c1) + end do ! faces + end if ! boundary condition + end do ! regions + end if ! turbulence model + + !----------------------------! + ! Reynolds stress models ! + !----------------------------! + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + + do reg = Boundary_Regions() + + ! Regions at solid walls + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then uu % n(c2) = 0.0 vv % n(c2) = 0.0 ww % n(c2) = 0.0 @@ -161,46 +226,16 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) kin_vis, & 0.0) if(Turb % model .eq. RSM_MANCEAU_HANJALIC) f22 % n(c2) = 0.0 - end if - end if + end do ! faces - ! k-epsilon-zeta-f - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE .or. & - Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then - kin % n(c2) = kin % n(c1) - eps % n(c2) = eps % n(c1) - zeta % n(c2) = zeta % n(c1) - f22 % n(c2) = f22 % n(c1) - if(Flow % heat_transfer) then - t2 % n(c2) = t2 % n(c1) - end if - end if + ! Regions outflow, pressure or symmetry + else if(Grid % region % type(reg) .eq. OUTFLOW .or. & + Grid % region % type(reg) .eq. PRESSURE .or. & + Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - end if - - ! k-epsilon - if(Turb % model .eq. K_EPS) then - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE .or. & - Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then - kin % n(c2) = kin % n(c1) - eps % n(c2) = eps % n(c1) - if(Flow % heat_transfer) then - t2 % n(c2) = t2 % n(c1) - end if - end if - end if - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW .or. & - Grid % Bnd_Cond_Type(c2) .eq. CONVECT .or. & - Grid % Bnd_Cond_Type(c2) .eq. PRESSURE) then uu % n(c2) = uu % n(c1) vv % n(c2) = vv % n(c1) ww % n(c2) = ww % n(c1) @@ -211,10 +246,10 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) eps % n(c2) = eps % n(c1) if(Turb % model .eq. RSM_MANCEAU_HANJALIC) & f22 % n(c2) = f22 % n(c1) - end if - end if - end if ! c2 < 0 - end do + end do ! faces + end if ! boundary condition + end do ! regions + end if ! turbulence model end if ! update turbulence @@ -237,7 +272,7 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) c2 = Grid % faces_c(2,s) ! On the boundary perform the extrapolation - if(Grid % Comm % cell_proc(c1) .eq. this_proc .and. c2 < 0) then + if(Grid % Comm % cell_proc(c1) .eq. This_Proc() .and. c2 < 0) then ! Wall temperature or heat fluxes for k-eps-zeta-f ! and high-re k-eps models. @@ -284,8 +319,8 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) !-----------------------------------------------! ! Integrate (summ) heated area, and heat up ! !-----------------------------------------------! - call Comm_Mod_Global_Sum_Real(Flow % heat) - call Comm_Mod_Global_Sum_Real(Flow % heated_area) + call Global % Sum_Real(Flow % heat) + call Global % Sum_Real(Flow % heated_area) Flow % heat_flux = Flow % heat / max(Flow % heated_area, TINY) end if ! update energy and heat transfer @@ -309,7 +344,7 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(Grid % Comm % cell_proc(c1) .eq. this_proc .and. c2 < 0) then + if(Grid % Comm % cell_proc(c1) .eq. This_Proc() .and. c2 < 0) then if(Var_Mod_Bnd_Cond_Type(t,c2) .eq. WALL .or. & Var_Mod_Bnd_Cond_Type(t,c2) .eq. WALLFL) then do i_fac = 1, Grid % cells_n_faces(c1) @@ -330,7 +365,7 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) 1 continue ! On the boundary perform the extrapolation - if(Grid % Comm % cell_proc(c1) .eq. this_proc .and. c2 < 0) then + if(Grid % Comm % cell_proc(c1) .eq. This_Proc() .and. c2 < 0) then ! In the "new way" the extrapolation is ! independent from turbulence model @@ -376,8 +411,8 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) !-----------------------------------------------! ! Integrate (summ) heated area, and heat up ! !-----------------------------------------------! - call Comm_Mod_Global_Sum_Real(Flow % heat) - call Comm_Mod_Global_Sum_Real(Flow % heated_area) + call Global % Sum_Real(Flow % heat) + call Global % Sum_Real(Flow % heated_area) Flow % heat_flux = Flow % heat / max(Flow % heated_area, TINY) end if ! update energy and heat transfer @@ -436,4 +471,6 @@ subroutine Update_Boundary_Values(Process, Flow, Turb, Vof, update) end if ! update_scalars + call Profiler % Stop('Update_Boundary_Values') + end subroutine diff --git a/Sources/Process/Read_Controls_Mod.f90 b/Sources/Process/Read_Controls_Mod.f90 index 03d547a99..4089f2d7a 100644 --- a/Sources/Process/Read_Controls_Mod.f90 +++ b/Sources/Process/Read_Controls_Mod.f90 @@ -1,3 +1,7 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Read_Controls_Mod !------------------------------------------------------------------------------! @@ -20,12 +24,13 @@ module Read_Controls_Mod contains procedure :: Boundary_Conditions - procedure :: Linear_Solvers ! on top of native & PETSc + procedure :: Iterations procedure, private :: Native_Solvers procedure :: Numerical_Schemes procedure, private :: Petsc_Solvers procedure :: Physical_Models procedure :: Physical_Properties + procedure :: Solvers ! on top of native & PETSc end type @@ -35,12 +40,13 @@ module Read_Controls_Mod ! Member function # include "Read_Controls_Mod/Boundary_Conditions.f90" -# include "Read_Controls_Mod/Linear_Solvers.f90" +# include "Read_Controls_Mod/Iterations.f90" # include "Read_Controls_Mod/Native_Solvers.f90" # include "Read_Controls_Mod/Numerical_Schemes.f90" # include "Read_Controls_Mod/Petsc_Solvers.f90" # include "Read_Controls_Mod/Physical_Models.f90" # include "Read_Controls_Mod/Physical_Properties.f90" +# include "Read_Controls_Mod/Solvers.f90" # include "Key_Ind.f90" end module diff --git a/Sources/Process/Read_Controls_Mod/Boundary_Conditions.f90 b/Sources/Process/Read_Controls_Mod/Boundary_Conditions.f90 index 562d0897e..c66cb7f28 100644 --- a/Sources/Process/Read_Controls_Mod/Boundary_Conditions.f90 +++ b/Sources/Process/Read_Controls_Mod/Boundary_Conditions.f90 @@ -5,11 +5,11 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Turb_Plane_Type) :: turb_planes + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Turb_Plane_Type) :: turb_planes !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, p, fun @@ -25,15 +25,17 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) character(SL) :: bc_type_name, try_str integer :: bc_type_tag character(SL) :: keys(128) - real :: vals(0:128) ! they start from zero! - integer :: types_per_color(128) ! how many types in a color - character(SL) :: types_names(128) ! name of each type - logical :: types_file(128) ! type specified in a file? - integer :: c_types ! counter types + real :: vals(0:128) ! they start from zero! + integer :: types_per_reg(128) ! how many types in a region + character(SL) :: types_names(128) ! name of each type + logical :: types_file(128) ! type specified in a file? + integer :: c_types ! counter types integer :: edd_n real :: edd_r real :: edd_i logical :: found +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) !==============================================================================! ! Take aliases @@ -54,35 +56,35 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) ! Read wall roughness, if specified as a constant for all walls ! ! (If it is not specified in the control file, it will be zero) ! !-------------------------------------------------------------------! - call Control_Mod_Roughness_Coefficient(Turb % z_o) + call Control % Roughness_Coefficient(Turb % z_o) !----------------------------------------------------------------! ! Count number of types per boundary condition, total number ! ! of types specified, and also extract their names ! !----------------------------------------------------------------! - types_per_color(:) = 0 + types_per_reg(:) = 0 types_file(:) = .false. c_types = 0 - do bc = 1, Grid % n_bnd_cond - call Control_Mod_Position_At_Two_Keys('BOUNDARY_CONDITION', & - Grid % bnd_cond % name(bc), & - found, & - .false.) + do bc = Boundary_Regions() + call Control % Position_At_Two_Keys('BOUNDARY_CONDITION', & + Grid % region % name(bc), & + found, & + .false.) if(found) then 1 continue ! Try to read next 'TYPE' in the control file - call Control_Mod_Read_Char_Item_On('TYPE', 'VOID', bc_type_name, .false.) + call Control % Read_Char_Item_On('TYPE', 'VOID', bc_type_name, .false.) ! Get out of the loop if you fail if(bc_type_name .eq. 'VOID') goto 2 ! Skip following two lines - call Control_Mod_Read_Char_Item_On('VARIABLES', 'VOID', try_str, .false.) - call Control_Mod_Read_Char_Item_On('VALUES', 'VOID', try_str, .false.) + call Control % Read_Char_Item_On('VARIABLES', 'VOID', try_str, .false.) + call Control % Read_Char_Item_On('VALUES', 'VOID', try_str, .false.) - types_per_color(bc) = types_per_color(bc) + 1 + types_per_reg(bc) = types_per_reg(bc) + 1 c_types = c_types + 1 types_names(c_types) = bc_type_name @@ -94,14 +96,10 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) goto 1 else - if(this_proc < 2) then - print *, '# ERROR! Boundary conditions for ', & - trim(Grid % bnd_cond % name(bc)), & - ' not specified in the control file!' - print *, '# Exiting the program.' - end if - call Comm_Mod_End - stop + call Message % Error(72, & + 'Boundary conditions for '//trim(Grid % region % name(bc))// & + ' not specified in the control file! \n \n Exiting!', & + file=__FILE__, line=__LINE__) end if 2 continue @@ -117,14 +115,14 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) !------------------------------------------------! c_types = 0 - do bc = 1, Grid % n_bnd_cond + do bc = Boundary_Regions() ! Position yourself well - call Control_Mod_Position_At_Two_Keys('BOUNDARY_CONDITION', & - Grid % bnd_cond % name(bc), & - found, & - .false.) - do l = 1, types_per_color(bc) + call Control % Position_At_Two_Keys('BOUNDARY_CONDITION', & + Grid % region % name(bc), & + found, & + .false.) + do l = 1, types_per_reg(bc) ! Update the counter c_types = c_types + 1 @@ -134,40 +132,36 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) ! Read first line which is common for all ! ! ! !---------------------------------------------! - call Control_Mod_Read_Char_Item_On('TYPE', 'WALL', bc_type_name, .false.) + call Control % Read_Char_Item_On('TYPE', 'WALL', bc_type_name, .false.) call String % To_Upper_Case(bc_type_name) ! Copy boundary conditions which were given for the Grid if( bc_type_name .eq. 'INFLOW') then bc_type_tag = INFLOW - Grid % bnd_cond % type(bc) = INFLOW + Grid % region % type(bc) = INFLOW else if( bc_type_name .eq. 'WALL') then bc_type_tag = WALL - Grid % bnd_cond % type(bc) = WALL + Grid % region % type(bc) = WALL else if( bc_type_name .eq. 'OUTFLOW') then bc_type_tag = OUTFLOW - Grid % bnd_cond % type(bc) = OUTFLOW + Grid % region % type(bc) = OUTFLOW else if( bc_type_name .eq. 'SYMMETRY') then bc_type_tag = SYMMETRY - Grid % bnd_cond % type(bc) = SYMMETRY + Grid % region % type(bc) = SYMMETRY else if( bc_type_name .eq. 'WALL_FLUX') then bc_type_tag = WALLFL - Grid % bnd_cond % type(bc) = WALLFL + Grid % region % type(bc) = WALLFL else if( bc_type_name .eq. 'CONVECTIVE') then bc_type_tag = CONVECT - Grid % bnd_cond % type(bc) = CONVECT + Grid % region % type(bc) = CONVECT else if( bc_type_name .eq. 'PRESSURE') then bc_type_tag = PRESSURE - Grid % bnd_cond % type(bc) = PRESSURE + Grid % region % type(bc) = PRESSURE else - if(this_proc < 2) then - print *, '# ERROR! Read_Control_Boundary_Conditions: '// & - '# Unknown boundary condition type: ', & - bc_type_name - print *, '# This error is critical, exiting!' - call Comm_Mod_End - stop - end if + call Message % Error(72, & + 'Unknown boundary condition type: '//trim(bc_type_name)// & + '. \n \n This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if !----------------------------------------------! @@ -175,7 +169,7 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) ! Read second line which is common for all ! ! ! !----------------------------------------------! - call Control_Mod_Read_Strings_On('VARIABLES', keys, nks, .false.) + call Control % Read_Strings_On('VARIABLES', keys, nks, .false.) do i = 1, nks call String % To_Upper_Case(keys(i)) end do @@ -186,134 +180,129 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) ! ! !-----------------------------------------------------------------! if( .not. types_file(c_types) ) then - call Control_Mod_Read_Real_Array_On('VALUES', vals(1), nvs, .false.) + call Control % Read_Real_Vector_On('VALUES', vals(1), nvs, .false.) !--------------------------------------------------! ! Distribute boundary values to boundary cells ! !--------------------------------------------------! ! Distribute b.c. tags only. - do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .eq. bc) then - - ! Temperature - if(Flow % heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) Grid % bnd_cond % type(bc) = WALLFL - end if + do c = Cells_In_Region(bc) + + ! Temperature + if(Flow % heat_transfer) then + i = Key_Ind('T', keys, nks) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL + if(bc_type_tag .eq. WALLFL) Grid % region % type(bc) = WALL end if - - ! Volume of fluid -> still to be worked around - if (Flow % with_interface) then - i = Key_Ind('VOF', keys, nks) - if(i > 0) fun % bnd_cond_type(c) = bc_type_tag - i = Key_Ind('VOF_C_ANG', keys, nks) - if(i > 0) fun % bnd_cond_type(c) = bc_type_tag + i = Key_Ind('Q', keys, nks) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL + if(bc_type_tag .eq. WALL) Grid % region % type(bc) = WALLFL end if + end if - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = bc_type_tag - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do + ! Volume of fluid -> still to be worked around + if (Flow % with_interface) then + i = Key_Ind('VOF', keys, nks) + if(i > 0) fun % bnd_cond_type(c) = bc_type_tag + i = Key_Ind('VOF_C_ANG', keys, nks) + if(i > 0) fun % bnd_cond_type(c) = bc_type_tag + end if - end if ! bnd_color .eq. bc + ! For scalars + do sc = 1, Flow % n_scalars + i = Key_Ind(scalar(sc) % name, keys, nks) + if(i > 0) then + scalar(sc) % bnd_cond_type(c) = bc_type_tag + end if + i = Key_Ind(scalar(sc) % flux_name, keys, nks) + if(i > 0) then + scalar(sc) % bnd_cond_type(c) = WALLFL + end if + end do - end do + end do ! Cells_In_Region ! Distribute b.c. values - do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .eq. bc) then - - ! For velocity, pressure and wall roughness - i = Key_Ind('U', keys, nks); if(i > 0) u % b(c) = vals(i) - i = Key_Ind('V', keys, nks); if(i > 0) v % b(c) = vals(i) - i = Key_Ind('W', keys, nks); if(i > 0) w % b(c) = vals(i) - i = Key_Ind('P', keys, nks); if(i > 0) p % b(c) = vals(i) - i = Key_Ind('Z_O', keys, nks); if(i > 0) z_o (c) = vals(i) - - ! Temperature - if(Flow % heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) t % b(c) = vals(i) - i = Key_Ind('Q', keys, nks) - if(i > 0) t % q(c) = vals(i) - end if - - ! Multiphase Flow - if (Flow % with_interface) then - i = Key_Ind('VOF', keys, nks) - if(i > 0) fun % b(c) = vals(i) - i = Key_Ind('VOF_C_ANG', keys, nks) - if(i > 0) fun % q(c) = vals(i) - end if + do c = Cells_In_Region(bc) + + ! For velocity, pressure and wall roughness + i = Key_Ind('U', keys, nks); if(i > 0) u % b(c) = vals(i) + i = Key_Ind('V', keys, nks); if(i > 0) v % b(c) = vals(i) + i = Key_Ind('W', keys, nks); if(i > 0) w % b(c) = vals(i) + i = Key_Ind('P', keys, nks); if(i > 0) p % b(c) = vals(i) + i = Key_Ind('Z_O', keys, nks); if(i > 0) z_o (c) = vals(i) + + ! Temperature + if(Flow % heat_transfer) then + i = Key_Ind('T', keys, nks) + if(i > 0) t % b(c) = vals(i) + i = Key_Ind('Q', keys, nks) + if(i > 0) t % q(c) = vals(i) + end if - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) scalar(sc) % b(c) = vals(i) - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) scalar(sc) % q(c) = vals(i) - end do + ! Multiphase Flow + if (Flow % with_interface) then + i = Key_Ind('VOF', keys, nks) + if(i > 0) fun % b(c) = vals(i) + i = Key_Ind('VOF_C_ANG', keys, nks) + if(i > 0) fun % q(c) = vals(i) + end if - ! For turbulence models - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - i = Key_Ind('UU', keys, nks); if(i > 0) uu % b(c) = vals(i) - i = Key_Ind('VV', keys, nks); if(i > 0) vv % b(c) = vals(i) - i = Key_Ind('WW', keys, nks); if(i > 0) ww % b(c) = vals(i) - i = Key_Ind('UV', keys, nks); if(i > 0) uv % b(c) = vals(i) - i = Key_Ind('UW', keys, nks); if(i > 0) uw % b(c) = vals(i) - i = Key_Ind('VW', keys, nks); if(i > 0) vw % b(c) = vals(i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) + ! For scalars + do sc = 1, Flow % n_scalars + i = Key_Ind(scalar(sc) % name, keys, nks) + if(i > 0) scalar(sc) % b(c) = vals(i) + i = Key_Ind(scalar(sc) % flux_name, keys, nks) + if(i > 0) scalar(sc) % q(c) = vals(i) + end do - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - i = Key_Ind('F22', keys, nks); if(i > 0) f22 % b(c) = vals(i) - end if + ! For turbulence models + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + i = Key_Ind('UU', keys, nks); if(i > 0) uu % b(c) = vals(i) + i = Key_Ind('VV', keys, nks); if(i > 0) vv % b(c) = vals(i) + i = Key_Ind('WW', keys, nks); if(i > 0) ww % b(c) = vals(i) + i = Key_Ind('UV', keys, nks); if(i > 0) uv % b(c) = vals(i) + i = Key_Ind('UW', keys, nks); if(i > 0) uw % b(c) = vals(i) + i = Key_Ind('VW', keys, nks); if(i > 0) vw % b(c) = vals(i) + i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) + + if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then + i = Key_Ind('F22', keys, nks); if(i > 0) f22 % b(c) = vals(i) end if + end if - if(Turb % model .eq. K_EPS) then - i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = vals(i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) - Turb % y_plus(c) = 1.1 - if(Flow % heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i > 0) t2 % b(c) = vals(i) - end if + if(Turb % model .eq. K_EPS) then + i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = vals(i) + i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) + Turb % y_plus(c) = 1.1 + if(Flow % heat_transfer) then + i = Key_Ind('T2', keys, nks); if(i > 0) t2 % b(c) = vals(i) end if + end if - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = vals(i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) - i = Key_Ind('ZETA', keys, nks); if(i > 0) zeta % b(c) = vals(i) - i = Key_Ind('F22', keys, nks); if(i > 0) f22 % b(c) = vals(i) - if(Flow % heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i > 0) t2 % b(c) = vals(i) - end if + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then + i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = vals(i) + i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) + i = Key_Ind('ZETA', keys, nks); if(i > 0) zeta % b(c) = vals(i) + i = Key_Ind('F22', keys, nks); if(i > 0) f22 % b(c) = vals(i) + if(Flow % heat_transfer) then + i = Key_Ind('T2', keys, nks); if(i > 0) t2 % b(c) = vals(i) end if + end if - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - i = Key_Ind('VIS', keys, nks); if(i > 0) vis % b(c) = vals(i) - end if + if(Turb % model .eq. SPALART_ALLMARAS .or. & + Turb % model .eq. DES_SPALART) then + i = Key_Ind('VIS', keys, nks); if(i > 0) vis % b(c) = vals(i) end if - end do + end do ! Cells_In_Region !---------------------------------------------! ! ! @@ -322,7 +311,7 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) !---------------------------------------------! else ! types_file(c_types) == .true. - call Control_Mod_Read_Strings_On('FILE', name_prof, nvs, .false.) + call Control % Read_Strings_On('FILE', name_prof, nvs, .false.) call File % Open_For_Reading_Ascii(name_prof(1), fu) call File % Read_Line(fu) @@ -352,414 +341,404 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) keys(1) .eq. 'Y' .and. keys(2) .eq. 'Z') then ! Set the closest point - do c = -1, -Grid % n_bnd_cells, -1 + do c = Cells_In_Region(bc) ! Distribute b.c. types - if(Grid % bnd_cond % color(c) .eq. bc) then - ! For temperature - if(Flow % heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) Grid % bnd_cond % type(bc) = WALLFL - end if + ! For temperature + if(Flow % heat_transfer) then + i = Key_Ind('T', keys, nks) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL + if(bc_type_tag .eq. WALLFL) Grid % region % type(bc) = WALL + end if + i = Key_Ind('Q', keys, nks) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL + if(bc_type_tag .eq. WALL) Grid % region % type(bc) = WALLFL end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = bc_type_tag - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - end if + ! For scalars + do sc = 1, Flow % n_scalars + i = Key_Ind(scalar(sc) % name, keys, nks) + if(i > 0) then + scalar(sc) % bnd_cond_type(c) = bc_type_tag + end if + i = Key_Ind(scalar(sc) % flux_name, keys, nks) + if(i > 0) then + scalar(sc) % bnd_cond_type(c) = WALLFL + end if + end do + ! Distribute b.c. values - if(Grid % bnd_cond % color(c) .eq. bc) then + dist_min = HUGE + do m = 1, n_points - dist_min = HUGE - do m = 1, n_points + i = Key_Ind('X', keys, nks); prof(m,0) = 0.0; x = prof(m,i) + i = Key_Ind('Y', keys, nks); prof(m,0) = 0.0; y = prof(m,i) + i = Key_Ind('Z', keys, nks); prof(m,0) = 0.0; z = prof(m,i) - i = Key_Ind('X', keys, nks); prof(m,0) = 0.0; x = prof(m,i) - i = Key_Ind('Y', keys, nks); prof(m,0) = 0.0; y = prof(m,i) - i = Key_Ind('Z', keys, nks); prof(m,0) = 0.0; z = prof(m,i) + if(keys(1) .eq. 'Y' .and. keys(2) .eq. 'Z') then + dist = Math % Distance( & + y, z, 0.0, & + Grid % yc(c), Grid % zc(c), 0.0) - if(keys(1) .eq. 'Y' .and. keys(2) .eq. 'Z') then - dist = Math % Distance( & - y, z, 0.0, & - Grid % yc(c), Grid % zc(c), 0.0) + else if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Z') then + dist = Math % Distance( & + x, z, 0.0, & + Grid % xc(c), Grid % zc(c), 0.0) - else if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Z') then - dist = Math % Distance( & - x, z, 0.0, & - Grid % xc(c), Grid % zc(c), 0.0) + else if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Y') then + dist = Math % Distance( & + x, y, 0.0, & + Grid % xc(c), Grid % yc(c), 0.0) - else if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Y') then - dist = Math % Distance( & - x, y, 0.0, & - Grid % xc(c), Grid % yc(c), 0.0) + end if - end if + ! Store closest point in k + if(dist < dist_min) then + dist_min = dist + k = m + end if - ! Store closest point in k - if(dist < dist_min) then - dist_min = dist - k = m - end if + end do - end do + ! For velocity, pressure and wall roughness + i = Key_Ind('U', keys, nks); if(i > 0) u % b(c) = prof(k,i) + i = Key_Ind('V', keys, nks); if(i > 0) v % b(c) = prof(k,i) + i = Key_Ind('W', keys, nks); if(i > 0) w % b(c) = prof(k,i) + i = Key_Ind('P', keys, nks); if(i > 0) p % b(c) = prof(k,i) + i = Key_Ind('Z_O', keys, nks); if(i > 0) z_o (c) = prof(k,i) + + ! For temperature + if(Flow % heat_transfer) then + i = Key_Ind('T', keys, nks) + if(i > 0) t % b(c) = prof(k,i) + i = Key_Ind('Q', keys, nks) + if(i > 0) t % q(c) = prof(k,i) + end if - ! For velocity, pressure and wall roughness - i = Key_Ind('U', keys, nks); if(i > 0) u % b(c) = prof(k,i) - i = Key_Ind('V', keys, nks); if(i > 0) v % b(c) = prof(k,i) - i = Key_Ind('W', keys, nks); if(i > 0) w % b(c) = prof(k,i) - i = Key_Ind('P', keys, nks); if(i > 0) p % b(c) = prof(k,i) - i = Key_Ind('Z_O', keys, nks); if(i > 0) z_o (c) = prof(k,i) + ! For scalars + do sc = 1, Flow % n_scalars + i = Key_Ind(scalar(sc) % name, keys, nks) + if(i > 0) scalar(sc) % b(c) = prof(k,i) + i = Key_Ind(scalar(sc) % flux_name, keys, nks) + if(i > 0) scalar(sc) % q(c) = prof(k,i) + end do - ! For temperature + ! For turbulence models + if(Turb % model .eq. K_EPS) then + i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = prof(k,i) + i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = prof(k,i) if(Flow % heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) t % b(c) = prof(k,i) - i = Key_Ind('Q', keys, nks) - if(i > 0) t % q(c) = prof(k,i) + i = Key_Ind('T2', keys, nks); if(i>0) t2 % b(c) = prof(k,i) end if + end if - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) scalar(sc) % b(c) = prof(k,i) - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) scalar(sc) % q(c) = prof(k,i) - end do - - ! For turbulence models - if(Turb % model .eq. K_EPS) then - i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = prof(k,i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = prof(k,i) - if(Flow % heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i>0) t2 % b(c) = prof(k,i) - end if + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then + i = Key_Ind('KIN', keys, nks); if(i>0) kin % b(c) = prof(k,i) + i = Key_Ind('EPS', keys, nks); if(i>0) eps % b(c) = prof(k,i) + i = Key_Ind('ZETA', keys, nks); if(i>0) zeta % b(c) = prof(k,i) + i = Key_Ind('F22', keys, nks); if(i>0) f22 % b(c) = prof(k,i) + if(Flow % heat_transfer) then + i = Key_Ind('T2', keys, nks); if(i>0) t2 % b(c) = prof(k,i) end if + end if - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - i = Key_Ind('KIN', keys, nks); if(i>0) kin % b(c) = prof(k,i) - i = Key_Ind('EPS', keys, nks); if(i>0) eps % b(c) = prof(k,i) - i = Key_Ind('ZETA', keys, nks); if(i>0) zeta % b(c) = prof(k,i) - i = Key_Ind('F22', keys, nks); if(i>0) f22 % b(c) = prof(k,i) - if(Flow % heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i>0) t2 % b(c) = prof(k,i) - end if - end if + if(Turb % model .eq. SPALART_ALLMARAS .or. & + Turb % model .eq. DES_SPALART) then + i = Key_Ind('VIS', keys, nks); if(i > 0) vis % b(c) = prof(k,i) + end if - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - i = Key_Ind('VIS', keys, nks); if(i > 0) vis % b(c) = prof(k,i) - end if + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + i = Key_Ind('UU', keys, nks); if(i > 0) uu % b(c) = prof(k,i) + i = Key_Ind('VV', keys, nks); if(i > 0) vv % b(c) = prof(k,i) + i = Key_Ind('WW', keys, nks); if(i > 0) ww % b(c) = prof(k,i) + i = Key_Ind('UV', keys, nks); if(i > 0) uv % b(c) = prof(k,i) + i = Key_Ind('UW', keys, nks); if(i > 0) uw % b(c) = prof(k,i) + i = Key_Ind('VW', keys, nks); if(i > 0) vw % b(c) = prof(k,i) + i = Key_Ind('EPS',keys, nks); if(i > 0) eps % b(c) = prof(k,i) - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - i = Key_Ind('UU', keys, nks); if(i > 0) uu % b(c) = prof(k,i) - i = Key_Ind('VV', keys, nks); if(i > 0) vv % b(c) = prof(k,i) - i = Key_Ind('WW', keys, nks); if(i > 0) ww % b(c) = prof(k,i) - i = Key_Ind('UV', keys, nks); if(i > 0) uv % b(c) = prof(k,i) - i = Key_Ind('UW', keys, nks); if(i > 0) uw % b(c) = prof(k,i) - i = Key_Ind('VW', keys, nks); if(i > 0) vw % b(c) = prof(k,i) - i = Key_Ind('EPS',keys, nks); if(i > 0) eps % b(c) = prof(k,i) - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - i = Key_Ind('F22', keys, nks); if(i>0) f22 % b(c) = prof(k,i) - end if + if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then + i = Key_Ind('F22', keys, nks); if(i>0) f22 % b(c) = prof(k,i) end if - end if !end if(Grid % bnd_cond % color(c) .eq. n) - end do !end do c = -1, -Grid % n_bnd_cells, -1 + end if + + end do ! Cells_In_Region !----------------------------! ! A plane is not defined ! !----------------------------! else ! dir .eq. "XPL" ... - do c = -1, -Grid % n_bnd_cells, -1 - - if(Grid % bnd_cond % color(c) .eq. bc) then - - do m = 1, n_points-1 - here = .false. - - i = Key_Ind(keys(1), keys, nks) - prof(m, 0) = 0.0; - prof(m+1, 0) = 0.0; - x = prof(m,i) - xp = prof(m+1,i) - - ! Compute the weight factors - if( keys(1) .eq. 'X' .and. & - Grid % xc(c) >= x .and. Grid % xc(c) <= xp ) then - wi = ( xp - Grid % xc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Y' .and. & - Grid % yc(c) >= x .and. Grid % yc(c) <= xp ) then - wi = ( xp - Grid % yc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Z' .and. & - Grid % zc(c) >= x .and. Grid % zc(c) <= xp ) then - wi = ( xp - Grid % zc(c) ) / (xp - x) - here = .true. - - ! Beware; for cylindrical coordinates you have "inversion" - else if( (keys(1) .eq. 'RX' .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RY' .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RZ' .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) ) / (xp-x) - here = .true. - - ! Wall distance too - else if( (keys(1) .eq. 'WD' .and. & - Grid % wall_dist(c) >= min(x,xp) .and. & - Grid % wall_dist(c) <= max(x,xp)) ) then - wi = ( max(x,xp) - Grid % wall_dist(c) ) & - / ( max(x,xp) - min(x,xp) ) - here = .true. - end if + do c = Cells_In_Region(bc) + + do m = 1, n_points-1 + here = .false. + + i = Key_Ind(keys(1), keys, nks) + prof(m, 0) = 0.0; + prof(m+1, 0) = 0.0; + x = prof(m,i) + xp = prof(m+1,i) + + ! Compute the weight factors + if( keys(1) .eq. 'X' .and. & + Grid % xc(c) >= x .and. Grid % xc(c) <= xp ) then + wi = ( xp - Grid % xc(c) ) / (xp - x) + here = .true. + else if( keys(1) .eq. 'Y' .and. & + Grid % yc(c) >= x .and. Grid % yc(c) <= xp ) then + wi = ( xp - Grid % yc(c) ) / (xp - x) + here = .true. + else if( keys(1) .eq. 'Z' .and. & + Grid % zc(c) >= x .and. Grid % zc(c) <= xp ) then + wi = ( xp - Grid % zc(c) ) / (xp - x) + here = .true. + + ! Beware; for cylindrical coordinates you have "inversion" + else if( (keys(1) .eq. 'RX' .and. & + sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) >= xp .and. & + sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) <= x) ) then + wi = ( xp - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) ) / (xp-x) + here = .true. + else if( (keys(1) .eq. 'RY' .and. & + sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) >= xp .and. & + sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) <= x) ) then + wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) ) / (xp-x) + here = .true. + else if( (keys(1) .eq. 'RZ' .and. & + sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) >= xp .and. & + sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) <= x) ) then + wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) ) / (xp-x) + here = .true. + + ! Wall distance too + else if( (keys(1) .eq. 'WD' .and. & + Grid % wall_dist(c) >= min(x,xp) .and. & + Grid % wall_dist(c) <= max(x,xp)) ) then + wi = ( max(x,xp) - Grid % wall_dist(c) ) & + / ( max(x,xp) - min(x,xp) ) + here = .true. + end if - if(here) then + if(here) then - ! For temperature - if(Flow % heat_transfer) then - i = Key_Ind('T',keys,nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) & - Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q',keys,nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) & - Grid % bnd_cond % type(bc) = WALLFL - end if + ! For temperature + if(Flow % heat_transfer) then + i = Key_Ind('T',keys,nks) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL + if(bc_type_tag .eq. WALLFL) & + Grid % region % type(bc) = WALL + end if + i = Key_Ind('Q',keys,nks) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL + if(bc_type_tag .eq. WALL) & + Grid % region % type(bc) = WALLFL + end if + end if + + ! For scalars + do sc = 1, Flow % n_scalars + i = Key_Ind(scalar(sc) % name, keys, nks) + if(i > 0) then + scalar(sc) % bnd_cond_type(c) = bc_type_tag + end if + i = Key_Ind(scalar(sc) % flux_name, keys, nks) + if(i > 0) then + scalar(sc) % bnd_cond_type(c) = WALLFL end if + end do + + end if ! here + end do ! m, points + + do m = 1, n_points-1 + here = .false. + + i = Key_Ind(keys(1), keys, nks) + prof(m, 0) = 0.0; + prof(m+1, 0) = 0.0; + x = prof(m,i) + xp = prof(m+1,i) + + ! Compute the weight factors + if( keys(1) .eq. 'X' .and. & + Grid % xc(c) >= x .and. Grid % xc(c) <= xp ) then + wi = ( xp - Grid % xc(c) ) / (xp - x) + here = .true. + else if( keys(1) .eq. 'Y' .and. & + Grid % yc(c) >= x .and. Grid % yc(c) <= xp ) then + wi = ( xp - Grid % yc(c) ) / (xp - x) + here = .true. + else if( keys(1) .eq. 'Z' .and. & + Grid % zc(c) >= x .and. Grid % zc(c) <= xp ) then + wi = ( xp - Grid % zc(c) ) / (xp - x) + here = .true. + + ! Beware; for cylindrical coordinates you have "inversion" + else if( (keys(1) .eq. 'RX' .and. & + sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) >= xp .and. & + sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) <= x) ) then + wi = ( xp - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) ) / (xp-x) + here = .true. + else if( (keys(1) .eq. 'RY' .and. & + sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) >= xp .and. & + sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) <= x) ) then + wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) ) / (xp-x) + here = .true. + else if( (keys(1) .eq. 'RZ' .and. & + sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) >= xp .and. & + sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) <= x) ) then + wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) ) / (xp-x) + here = .true. + + ! Wall distance too + else if( (keys(1) .eq. 'WD' .and. & + Grid % wall_dist(c) >= min(x,xp) .and. & + Grid % wall_dist(c) <= max(x,xp)) ) then + wi = ( max(x,xp) - Grid % wall_dist(c) ) & + / ( max(x,xp) - min(x,xp) ) + here = .true. + end if - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = bc_type_tag - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - - end if ! here - end do ! m, points - end if ! bnd_color .eq. bc - - if(Grid % bnd_cond % color(c) .eq. bc) then - - do m = 1, n_points-1 - here = .false. - - i = Key_Ind(keys(1), keys, nks) - prof(m, 0) = 0.0; - prof(m+1, 0) = 0.0; - x = prof(m,i) - xp = prof(m+1,i) - - ! Compute the weight factors - if( keys(1) .eq. 'X' .and. & - Grid % xc(c) >= x .and. Grid % xc(c) <= xp ) then - wi = ( xp - Grid % xc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Y' .and. & - Grid % yc(c) >= x .and. Grid % yc(c) <= xp ) then - wi = ( xp - Grid % yc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Z' .and. & - Grid % zc(c) >= x .and. Grid % zc(c) <= xp ) then - wi = ( xp - Grid % zc(c) ) / (xp - x) - here = .true. - - ! Beware; for cylindrical coordinates you have "inversion" - else if( (keys(1) .eq. 'RX' .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RY' .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RZ' .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) ) / (xp-x) - here = .true. - - ! Wall distance too - else if( (keys(1) .eq. 'WD' .and. & - Grid % wall_dist(c) >= min(x,xp) .and. & - Grid % wall_dist(c) <= max(x,xp)) ) then - wi = ( max(x,xp) - Grid % wall_dist(c) ) & - / ( max(x,xp) - min(x,xp) ) - here = .true. + ! Interpolate the profiles + if(here) then + + ! For velocity, pressure and wall roughness + i = Key_Ind('U',keys,nks) + if(i > 0) u % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('V',keys,nks) + if(i > 0) v % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('W',keys,nks) + if(i > 0) w % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('P',keys,nks) + if(i > 0) p % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('Z_O',keys,nks) + if(i > 0) z_o (c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + + ! For temperature + if(Flow % heat_transfer) then + i = Key_Ind('T',keys,nks) + if(i > 0) t % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL + if(bc_type_tag .eq. WALLFL) & + Grid % region % type(bc) = WALL + end if + i = Key_Ind('Q',keys,nks) + if(i > 0) t % q(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + if(i > 0) then + t % bnd_cond_type(c) = bc_type_tag + if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL + if(bc_type_tag .eq. WALL) & + Grid % region % type(bc) = WALLFL + end if end if - ! Interpolate the profiles - if(here) then - - ! For velocity, pressure and wall roughness - i = Key_Ind('U',keys,nks) - if(i > 0) u % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('V',keys,nks) - if(i > 0) v % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('W',keys,nks) - if(i > 0) w % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('P',keys,nks) - if(i > 0) p % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('Z_O',keys,nks) - if(i > 0) z_o (c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - ! For temperature - if(Flow % heat_transfer) then - i = Key_Ind('T',keys,nks) - if(i > 0) t % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) & - Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q',keys,nks) - if(i > 0) t % q(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) & - Grid % bnd_cond % type(bc) = WALLFL - end if + ! For scalars + do sc = 1, Flow % n_scalars + i = Key_Ind(scalar(sc) % name, keys, nks) + if(i > 0) then + scalar(sc) % b(c)=wi*prof(m,i)+(1.-wi)*prof(m+1,i) + scalar(sc) % bnd_cond_type(c) = bc_type_tag + end if + i = Key_Ind(scalar(sc) % flux_name, keys, nks) + if(i > 0) then + scalar(sc) % q(c)=wi*prof(m,i)+(1.-wi)*prof(m+1,i) + scalar(sc) % bnd_cond_type(c) = WALLFL end if + end do + + ! For turbulence models + if(Turb % model .eq. K_EPS) then - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % b(c)=wi*prof(m,i)+(1.-wi)*prof(m+1,i) - scalar(sc) % bnd_cond_type(c) = bc_type_tag - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % q(c)=wi*prof(m,i)+(1.-wi)*prof(m+1,i) - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - - ! For turbulence models - if(Turb % model .eq. K_EPS) then - - i = Key_Ind('KIN',keys,nks) - if(i > 0) kin % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('EPS',keys,nks) - if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - if(Flow % heat_transfer) then - i = Key_Ind('T2',keys,nks) - if(i > 0) t2 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if + i = Key_Ind('KIN',keys,nks) + if(i > 0) kin % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('EPS',keys,nks) + if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + + if(Flow % heat_transfer) then + i = Key_Ind('T2',keys,nks) + if(i > 0) t2 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) end if - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then + end if - i = Key_Ind('KIN',keys,nks) - if(i > 0) kin % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then - i = Key_Ind('EPS',keys,nks) - if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('KIN',keys,nks) + if(i > 0) kin % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('ZETA',keys,nks) - if(i > 0) zeta % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('EPS',keys,nks) + if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('F22',keys,nks) - if(i > 0) f22 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('ZETA',keys,nks) + if(i > 0) zeta % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(Flow % heat_transfer) then - i = Key_Ind('T2',keys,nks) - if(i > 0) t2 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if + i = Key_Ind('F22',keys,nks) + if(i > 0) f22 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + if(Flow % heat_transfer) then + i = Key_Ind('T2',keys,nks) + if(i > 0) t2 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) end if - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + end if - i = Key_Ind('UU', keys, nks) - if(i > 0) uu % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - i = Key_Ind('VV', keys, nks) - if(i > 0) vv % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('UU', keys, nks) + if(i > 0) uu % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('WW', keys, nks) - if(i > 0) ww % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('VV', keys, nks) + if(i > 0) vv % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('UV', keys, nks) - if(i > 0) uv % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('WW', keys, nks) + if(i > 0) ww % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('UW', keys, nks) - if(i > 0) uw % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('UV', keys, nks) + if(i > 0) uv % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('VW', keys, nks) - if(i > 0) vw % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('UW', keys, nks) + if(i > 0) uw % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('EPS', keys, nks) - if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + i = Key_Ind('VW', keys, nks) + if(i > 0) vw % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - i = Key_Ind('F22', keys, nks) - if(i > 0)f22 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if - end if + i = Key_Ind('EPS', keys, nks) + if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - i = Key_Ind('VIS',keys,nks) - if(i > 0) vis % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then + i = Key_Ind('F22', keys, nks) + if(i > 0)f22 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) end if + end if - end if ! (here) - end do ! m = 1, n_points-1 - end if - end do ! c = -1, -Grid % n_bnd_cells, -1 - end if ! plane is defined? + if(Turb % model .eq. SPALART_ALLMARAS .or. & + Turb % model .eq. DES_SPALART) then + i = Key_Ind('VIS',keys,nks) + if(i > 0) vis % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) + end if + + end if ! (here) + end do ! m = 1, n_points-1 + + end do ! Cells_In_Region + end if ! plane is defined? close(fu) !-----------------------------! @@ -778,25 +757,25 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) ! ! !-----------------------------------! turb_planes % n_planes = 0 - do bc = 1, Grid % n_bnd_cond ! imagine there are as many eddies as bcs - call Control_Mod_Position_At_Two_Keys('SYNTHETIC_EDDIES', & - Grid % bnd_cond % name(bc), & - found, & - .false.) + do bc = Boundary_Regions() ! imagine there are as many eddies as bcs + call Control % Position_At_Two_Keys('SYNTHETIC_EDDIES', & + Grid % region % name(bc), & + found, & + .false.) if(found) then turb_planes % n_planes = turb_planes % n_planes + 1 - call Control_Mod_Read_Int_Item_On ('NUMBER_OF_EDDIES', 24, edd_n, .false.) - call Control_Mod_Read_Real_Item_On('MAX_EDDY_RADIUS', .2, edd_r, .false.) - call Control_Mod_Read_Real_Item_On('EDDY_INTENSITY', .1, edd_i, .false.) + call Control % Read_Int_Item_On ('NUMBER_OF_EDDIES', 24, edd_n, .false.) + call Control % Read_Real_Item_On('MAX_EDDY_RADIUS', .2, edd_r, .false.) + call Control % Read_Real_Item_On('EDDY_INTENSITY', .1, edd_i, .false.) call Eddies_Mod_Allocate(turb_planes % plane(turb_planes % n_planes), & edd_n, & edd_r, & edd_i, & Flow, & - Grid % bnd_cond % name(bc)) + Grid % region % name(bc)) end if end do - if(turb_planes % n_planes > 0 .and. this_proc < 2) then + if(turb_planes % n_planes > 0 .and. First_Proc()) then print *, '# Found ', turb_planes % n_planes, ' turbulent planes' end if @@ -807,83 +786,85 @@ subroutine Boundary_Conditions(Rc, Flow, Turb, Vof, turb_planes) ! ! ! ! !---------------------------------------! - do c = -1, -Grid % n_bnd_cells, -1 + do bc = Boundary_Regions() + do c = Cells_In_Region(bc) - u % n(c) = u % b(c) - v % n(c) = v % b(c) - w % n(c) = w % b(c) - p % n(c) = p % b(c) + u % n(c) = u % b(c) + v % n(c) = v % b(c) + w % n(c) = w % b(c) + p % n(c) = p % b(c) - if(Flow % heat_transfer) then - t % n(c) = t % b(c) - end if + if(Flow % heat_transfer) then + t % n(c) = t % b(c) + end if - if (Flow % with_interface) then - fun % n(c) = fun % b(c) - end if + if (Flow % with_interface) then + fun % n(c) = fun % b(c) + end if - do sc = 1, Flow % n_scalars - scalar(sc) % n(c) = scalar(sc) % b(c) - end do + do sc = 1, Flow % n_scalars + scalar(sc) % n(c) = scalar(sc) % b(c) + end do - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - uu % n(c) = uu % b(c) - vv % n(c) = vv % b(c) - ww % n(c) = ww % b(c) - uv % n(c) = uv % b(c) - uw % n(c) = uw % b(c) - vw % n(c) = vw % b(c) - eps % n(c) = eps % b(c) - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - f22 % n(c) = f22 % b(c) + if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & + Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then + uu % n(c) = uu % b(c) + vv % n(c) = vv % b(c) + ww % n(c) = ww % b(c) + uv % n(c) = uv % b(c) + uw % n(c) = uw % b(c) + vw % n(c) = vw % b(c) + eps % n(c) = eps % b(c) + + if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then + f22 % n(c) = f22 % b(c) + end if end if - end if - if(Turb % model .eq. K_EPS) then - kin % n(c) = kin % b(c) - eps % n(c) = eps % b(c) - if(Flow % heat_transfer) then - t2 % n(c) = t2 % b(c) + if(Turb % model .eq. K_EPS) then + kin % n(c) = kin % b(c) + eps % n(c) = eps % b(c) + if(Flow % heat_transfer) then + t2 % n(c) = t2 % b(c) + end if end if - end if - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - kin % n(c) = kin % b(c) - eps % n(c) = eps % b(c) - zeta % n(c) = zeta % b(c) - f22 % n(c) = f22 % b(c) - if(Flow % heat_transfer) then - t2 % n(c) = t2 % b(c) + if(Turb % model .eq. K_EPS_ZETA_F .or. & + Turb % model .eq. HYBRID_LES_RANS) then + kin % n(c) = kin % b(c) + eps % n(c) = eps % b(c) + zeta % n(c) = zeta % b(c) + f22 % n(c) = f22 % b(c) + if(Flow % heat_transfer) then + t2 % n(c) = t2 % b(c) + end if end if - end if - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - vis % n(c) = vis % b(c) - end if + if(Turb % model .eq. SPALART_ALLMARAS .or. & + Turb % model .eq. DES_SPALART) then + vis % n(c) = vis % b(c) + end if - end do ! through boundary cells + end do ! boundary cells + end do ! boundary regions !------------------------------! ! Find the near-wall cells ! !------------------------------! Grid % cell_near_wall = .false. - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do bc = Boundary_Regions() + if(Grid % region % type(bc) .eq. WALL .or. & + Grid % region % type(bc) .eq. WALLFL) then + do s = Faces_In_Region(bc) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then Grid % cell_near_wall(c1) = .true. - end if + end do end if - end do ! faces + end do ! boundary regions call Grid % Exchange_Cells_Log(Grid % cell_near_wall) diff --git a/Sources/Process/Read_Controls_Mod/Iterations.f90 b/Sources/Process/Read_Controls_Mod/Iterations.f90 new file mode 100644 index 000000000..f1cb04aa1 --- /dev/null +++ b/Sources/Process/Read_Controls_Mod/Iterations.f90 @@ -0,0 +1,24 @@ +!==============================================================================! + subroutine Iterations(Rc) +!------------------------------------------------------------------------------! +! Reads control file for variables which control outer iteration loop ! +!---------------------------------[Arguments]----------------------------------! + class(Read_Controls_Type), intent(in) :: Rc +!-----------------------------------[Locals]-----------------------------------! + integer :: max_out ! max number of inner iterations + integer :: min_out ! min number of inner iterations + real :: simple_tol ! tolerance for SIMPLE algorithm +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) +!==============================================================================! + + call Control % Max_Simple_Iterations(max_out) + call Control % Min_Simple_Iterations(min_out) + call Control % Tolerance_For_Simple_Algorithm(simple_tol) + + call Iter % Set_Max(max_out) + call Iter % Set_Min(min_out) + call Iter % Set_Tol(simple_tol) + + end subroutine + diff --git a/Sources/Process/Read_Controls_Mod/Native_Solvers.f90 b/Sources/Process/Read_Controls_Mod/Native_Solvers.f90 index 752631643..7992718b1 100644 --- a/Sources/Process/Read_Controls_Mod/Native_Solvers.f90 +++ b/Sources/Process/Read_Controls_Mod/Native_Solvers.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Native_Solvers(Rc, Flow, Turb, Vof, Sol) + subroutine Native_Solvers(Rc, Flow, Turb, Vof) !------------------------------------------------------------------------------! ! Reads details about native solvers from control file. ! ! ! @@ -10,30 +10,21 @@ subroutine Native_Solvers(Rc, Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: tq, ui, phi integer :: i, sc +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) !==============================================================================! ! Take alias Grid => Flow % pnt_grid - !----------------------------------! - ! Gradient computation methods ! - !----------------------------------! - - ! Tolerance and max iterations for computation of gradients with Gauss method - call Control_Mod_Tolerance_For_Gauss_Gradients(Flow % gauss_tol, .false.) - call Control_Mod_Max_Gauss_Gradients_Iterations(Flow % gauss_miter, .false.) - call Control_Mod_Max_Least_Squares_Gradients_Iterations(Flow % least_miter, & - .false.) - !-------------------------! ! Related to momentum ! !-------------------------! @@ -41,58 +32,55 @@ subroutine Native_Solvers(Rc, Flow, Turb, Vof, Sol) if(i .eq. 1) ui => Flow % u if(i .eq. 2) ui => Flow % v if(i .eq. 3) ui => Flow % w - call Control_Mod_Solver_For_Momentum (ui % solver) - call Control_Mod_Preconditioner_For_System_Matrix (ui % prec) - call Control_Mod_Tolerance_For_Momentum_Solver (ui % tol) - call Control_Mod_Max_Iterations_For_Momentum_Solver(ui % mniter) + call Control % Solver_For_Momentum (ui % solver) + call Control % Preconditioner_For_System_Matrix (ui % prec) + call Control % Tolerance_For_Momentum_Solver (ui % tol) + call Control % Max_Iterations_For_Momentum_Solver(ui % mniter) end do !-------------------------! ! Related to pressure ! !-------------------------! - call Control_Mod_Solver_For_Pressure (Flow % pp % solver) - call Control_Mod_Preconditioner_For_System_Matrix (Flow % pp % prec) - call Control_Mod_Tolerance_For_Pressure_Solver (Flow % pp % tol) - call Control_Mod_Max_Iterations_For_Pressure_Solver(Flow % pp % mniter) + call Control % Solver_For_Pressure (Flow % pp % solver) + call Control % Preconditioner_For_System_Matrix (Flow % pp % prec) + call Control % Tolerance_For_Pressure_Solver (Flow % pp % tol) + call Control % Max_Iterations_For_Pressure_Solver(Flow % pp % mniter) !------------------------------! ! Related to wall distance ! !------------------------------! - call Control_Mod_Solver_For_Wall_Distance & - (Flow % wall_dist % solver) - call Control_Mod_Preconditioner_For_System_Matrix & - (Flow % wall_dist % prec) - call Control_Mod_Tolerance_For_Wall_Distance_Solver & - (Flow % wall_dist % tol) - call Control_Mod_Max_Iterations_For_Wall_Distance_Solver & + call Control % Solver_For_Wall_Distance (Flow % wall_dist % solver) + call Control % Preconditioner_For_System_Matrix (Flow % wall_dist % prec) + call Control % Tolerance_For_Wall_Distance_Solver (Flow % wall_dist % tol) + call Control % Max_Iterations_For_Wall_Distance_Solver & (Flow % wall_dist % mniter) !--------------------------! ! Related to potential ! (for flow field initialization) !--------------------------! - call Control_Mod_Solver_For_Potential (Flow % pot % solver) - call Control_Mod_Preconditioner_For_System_Matrix (Flow % pot % prec) - call Control_Mod_Tolerance_For_Potential_Solver (Flow % pot % tol) - call Control_Mod_Max_Iterations_For_Potential_Solver(Flow % pot % mniter) + call Control % Solver_For_Potential (Flow % pot % solver) + call Control % Preconditioner_For_System_Matrix (Flow % pot % prec) + call Control % Tolerance_For_Potential_Solver (Flow % pot % tol) + call Control % Max_Iterations_For_Potential_Solver(Flow % pot % mniter) !------------------------------! ! Related to heat transfer ! !------------------------------! if(Flow % heat_transfer) then - call Control_Mod_Solver_For_Energy (Flow % t % solver) - call Control_Mod_Preconditioner_For_System_Matrix (Flow % t % prec) - call Control_Mod_Tolerance_For_Energy_Solver (Flow % t % tol) - call Control_Mod_Max_Iterations_For_Energy_Solver (Flow % t % mniter) + call Control % Solver_For_Energy (Flow % t % solver) + call Control % Preconditioner_For_System_Matrix (Flow % t % prec) + call Control % Tolerance_For_Energy_Solver (Flow % t % tol) + call Control % Max_Iterations_For_Energy_Solver (Flow % t % mniter) end if !--------------------------------! ! Related to multiphase Flow ! !--------------------------------! if(Flow % with_interface) then - call Control_Mod_Solver_For_Vof (Vof % fun % solver) - call Control_Mod_Preconditioner_For_System_Matrix(Vof % fun % prec) - call Control_Mod_Tolerance_For_Vof_Solver (Vof % fun % tol) - call Control_Mod_Max_Iterations_For_Vof_Solver (Vof % fun % mniter) + call Control % Solver_For_Vof (Vof % fun % solver) + call Control % Preconditioner_For_System_Matrix(Vof % fun % prec) + call Control % Tolerance_For_Vof_Solver (Vof % fun % tol) + call Control % Max_Iterations_For_Vof_Solver (Vof % fun % mniter) end if !--------------------------------! @@ -100,10 +88,10 @@ subroutine Native_Solvers(Rc, Flow, Turb, Vof, Sol) !--------------------------------! do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) - call Control_Mod_Solver_For_Scalars (phi % solver) - call Control_Mod_Preconditioner_For_System_Matrix (phi % prec) - call Control_Mod_Tolerance_For_Scalars_Solver (phi % tol) - call Control_Mod_Max_Iterations_For_Scalars_Solver(phi % mniter) + call Control % Solver_For_Scalars (phi % solver) + call Control % Preconditioner_For_System_Matrix (phi % prec) + call Control % Tolerance_For_Scalars_Solver (phi % tol) + call Control % Max_Iterations_For_Scalars_Solver(phi % mniter) end do !------------------------------! @@ -122,10 +110,10 @@ subroutine Native_Solvers(Rc, Flow, Turb, Vof, Sol) if(i .eq. 10) tq => Turb % uv if(i .eq. 11) tq => Turb % uw if(i .eq. 12) tq => Turb % vw - call Control_Mod_Solver_For_Turbulence (tq % solver) - call Control_Mod_Preconditioner_For_System_Matrix (tq % prec) - call Control_Mod_Tolerance_For_Turbulence_Solver (tq % tol) - call Control_Mod_Max_Iterations_For_Turbulence_Solver(tq % mniter) + call Control % Solver_For_Turbulence (tq % solver) + call Control % Preconditioner_For_System_Matrix (tq % prec) + call Control % Tolerance_For_Turbulence_Solver (tq % tol) + call Control % Max_Iterations_For_Turbulence_Solver(tq % mniter) end do end subroutine diff --git a/Sources/Process/Read_Controls_Mod/Numerical_Schemes.f90 b/Sources/Process/Read_Controls_Mod/Numerical_Schemes.f90 index 6abf9e845..c0bde001d 100644 --- a/Sources/Process/Read_Controls_Mod/Numerical_Schemes.f90 +++ b/Sources/Process/Read_Controls_Mod/Numerical_Schemes.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) + subroutine Numerical_Schemes(Rc, Flow, Turb, Vof) !------------------------------------------------------------------------------! ! Reads details about numerical schemes from control file. ! ! ! @@ -9,16 +9,17 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: tq, ui, phi character(SL) :: name integer :: i, sc +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) !==============================================================================! ! Take alias @@ -29,29 +30,29 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) !------------------------------------------! ! Basic algorithm for pressure-velocity coupling (SIMPLE, PISO) - call Control_Mod_Pressure_Momentum_Coupling(name, .true.) + call Control % Pressure_Momentum_Coupling(name, .true.) Flow % p_m_coupling = Numerics_Mod_Pressure_Momentum_Coupling_Code(name) if( Flow % p_m_coupling .eq. PISO) then - call Control_Mod_Number_Of_Piso_Corrections(Flow % n_piso_corrections) + call Control % Number_Of_Piso_Corrections(Flow % n_piso_corrections) Flow % inside_piso_loop = .false. end if ! Improvements to Rhie and Chow method (Choi, Gu) - call Control_Mod_Choi_Correction(Flow % choi_correction, .false.) - call Control_Mod_Gu_Correction (Flow % gu_correction, .false.) + call Control % Choi_Correction(Flow % choi_correction, .false.) + call Control % Gu_Correction (Flow % gu_correction, .false.) ! Report volume balance (in a separate file) - call Control_Mod_Report_Volume_Balance(Flow % report_vol_balance, .false.) + call Control % Report_Volume_Balance(Flow % rep_vol_balance, .false.) !----------------------------------! ! Gradient computation methods ! !----------------------------------! ! Tolerance and max iterations for computation of gradients with Gauss method - call Control_Mod_Tolerance_For_Gauss_Gradients (Flow % gauss_tol, .false.) - call Control_Mod_Max_Gauss_Gradients_Iterations(Flow % gauss_miter, .false.) - call Control_Mod_Max_Least_Squares_Gradients_Iterations(Flow % least_miter, & + call Control % Tolerance_For_Gauss_Gradients (Flow % gauss_tol, .false.) + call Control % Max_Gauss_Gradients_Iterations(Flow % gauss_miter, .false.) + call Control % Max_Least_Squares_Gradients_Iterations(Flow % least_miter, & .false.) !-------------------------! ! Related to momentum ! @@ -60,28 +61,28 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) if(i .eq. 1) ui => Flow % u if(i .eq. 2) ui => Flow % v if(i .eq. 3) ui => Flow % w - call Control_Mod_Advection_Scheme_For_Momentum (name) + call Control % Advection_Scheme_For_Momentum (name) ui % adv_scheme = Numerics_Mod_Advection_Scheme_Code (name) - call Control_Mod_Time_Integration_Scheme (name) + call Control % Time_Integration_Scheme (name) ui % td_scheme = Numerics_Mod_Time_Integration_Scheme_Code(name) - call Control_Mod_Blending_Coefficient_For_Momentum (ui % blend) - call Control_Mod_Simple_Underrelaxation_For_Momentum(ui % urf) - call Control_Mod_Gradient_Method_For_Momentum (name) + call Control % Blending_Coefficient_For_Momentum (ui % blend) + call Control % Simple_Underrelaxation_For_Momentum (ui % urf) + call Control % Gradient_Method_For_Momentum (name) ui % grad_method = Numerics_Mod_Gradient_Method_Code(name) end do !-------------------------! ! Related to pressure ! !-------------------------! - call Control_Mod_Simple_Underrelaxation_For_Pressure(Flow % pp % urf) - call Control_Mod_Gradient_Method_For_Pressure (name) + call Control % Simple_Underrelaxation_For_Pressure(Flow % pp % urf) + call Control % Gradient_Method_For_Pressure (name) Flow % p % grad_method = Numerics_Mod_Gradient_Method_Code(name) Flow % pp % grad_method = Numerics_Mod_Gradient_Method_Code(name) !------------------------------! ! Related to wall distance ! !------------------------------! - call Control_Mod_Gradient_Method_For_Wall_Distance (name) + call Control % Gradient_Method_For_Wall_Distance (name) Flow % wall_dist % grad_method = Numerics_Mod_Gradient_Method_Code(name) !--------------------------! @@ -93,13 +94,13 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) ! Related to heat transfer ! !------------------------------! if(Flow % heat_transfer) then - call Control_Mod_Advection_Scheme_For_Energy (name) + call Control % Advection_Scheme_For_Energy (name) Flow % t % adv_scheme = Numerics_Mod_Advection_Scheme_Code (name) - call Control_Mod_Time_Integration_Scheme (name) + call Control % Time_Integration_Scheme (name) Flow % t % td_scheme = Numerics_Mod_Time_Integration_Scheme_Code(name) - call Control_Mod_Blending_Coefficient_For_Energy (Flow % t % blend) - call Control_Mod_Simple_Underrelaxation_For_Energy(Flow % t % urf) - call Control_Mod_Gradient_Method_For_Energy (name) + call Control % Blending_Coefficient_For_Energy (Flow % t % blend) + call Control % Simple_Underrelaxation_For_Energy(Flow % t % urf) + call Control % Gradient_Method_For_Energy (name) Flow % t % grad_method = Numerics_Mod_Gradient_Method_Code(name) end if @@ -107,20 +108,20 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) ! Related to multiphase Flow ! !--------------------------------! if(Flow % with_interface) then - call Control_Mod_Advection_Scheme_For_Vof (name) + call Control % Advection_Scheme_For_Vof (name) Vof % fun % adv_scheme = Numerics_Mod_Advection_Scheme_Code (name) - call Control_Mod_Time_Integration_Scheme (name) + call Control % Time_Integration_Scheme (name) Vof % fun % td_scheme = Numerics_Mod_Time_Integration_Scheme_Code(name) - call Control_Mod_Blending_Coefficient_For_Vof (Vof % fun % blend) - call Control_Mod_Simple_Underrelaxation_For_Vof (Vof % fun % urf) + call Control % Blending_Coefficient_For_Vof (Vof % fun % blend) + call Control % Simple_Underrelaxation_For_Vof(Vof % fun % urf) ! Max Courant number and Max substep cycles - call Control_Mod_Max_Courant_Vof (Vof % courant_max_param) - call Control_Mod_Max_Substep_Cycles_Vof(Vof % n_sub_param) - call Control_Mod_Max_Correction_Cycles_Beta_Vof (Vof % corr_num_max) - call Control_Mod_Max_Smoothing_Cycles_Curvature_Vof(Vof % n_conv_curv) - call Control_Mod_Max_Smoothing_Cycles_Normal_Vof (Vof % n_conv_norm) - call Control_Mod_Skewness_Correction_Vof (Vof % skew_corr) - call Control_Mod_Gradient_Method_For_Vof (name) + call Control % Max_Courant_Vof (Vof % courant_max_param) + call Control % Max_Substep_Cycles_Vof (Vof % n_sub_param) + call Control % Max_Correction_Cycles_Beta_Vof (Vof % corr_num_max) + call Control % Max_Smoothing_Cycles_Curvature_Vof(Vof % n_conv_curv) + call Control % Max_Smoothing_Cycles_Normal_Vof (Vof % n_conv_norm) + call Control % Skewness_Correction_Vof (Vof % skew_corr) + call Control % Gradient_Method_For_Vof (name) Vof % fun % grad_method = Numerics_Mod_Gradient_Method_Code(name) end if @@ -129,14 +130,14 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) !--------------------------------! do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) - call Control_Mod_Advection_Scheme_For_Scalars (name) + call Control % Advection_Scheme_For_Scalars (name) phi % adv_scheme = Numerics_Mod_Advection_Scheme_Code (name) - call Control_Mod_Time_Integration_Scheme (name) + call Control % Time_Integration_Scheme (name) phi % td_scheme = Numerics_Mod_Time_Integration_Scheme_Code(name) - call Control_Mod_Blending_Coefficient_For_Scalars (phi % blend) - call Control_Mod_Simple_Underrelaxation_For_Scalars(phi % urf) - call Control_Mod_Gradient_Method_For_Scalars (name) - phi % grad_method = Numerics_Mod_Gradient_Method_Code(name) + call Control % Blending_Coefficient_For_Scalars (phi % blend) + call Control % Simple_Underrelaxation_For_Scalars (phi % urf) + call Control % Gradient_Method_For_Scalars (name) + phi % grad_method = Numerics_Mod_Gradient_Method_Code (name) end do !------------------------------! @@ -155,14 +156,14 @@ subroutine Numerical_Schemes(Rc, Flow, Turb, Vof, Sol) if(i .eq. 10) tq => Turb % uv if(i .eq. 11) tq => Turb % uw if(i .eq. 12) tq => Turb % vw - call Control_Mod_Advection_Scheme_For_Turbulence (name) + call Control % Advection_Scheme_For_Turbulence (name) tq % adv_scheme = Numerics_Mod_Advection_Scheme_Code (name) - call Control_Mod_Time_Integration_Scheme (name) + call Control % Time_Integration_Scheme (name) tq % td_scheme = Numerics_Mod_Time_Integration_Scheme_Code(name) - call Control_Mod_Blending_Coefficient_For_Turbulence (tq % blend) - call Control_Mod_Simple_Underrelaxation_For_Turbulence(tq % urf) - call Control_Mod_Gradient_Method_For_Turbulence (name) - tq % grad_method = Numerics_Mod_Gradient_Method_Code(name) + call Control % Blending_Coefficient_For_Turbulence (tq % blend) + call Control % Simple_Underrelaxation_For_Turbulence (tq % urf) + call Control % Gradient_Method_For_Turbulence (name) + tq % grad_method = Numerics_Mod_Gradient_Method_Code (name) end do end subroutine diff --git a/Sources/Process/Read_Controls_Mod/Petsc_Solvers.f90 b/Sources/Process/Read_Controls_Mod/Petsc_Solvers.f90 index 1fd118e73..0d8b51dba 100644 --- a/Sources/Process/Read_Controls_Mod/Petsc_Solvers.f90 +++ b/Sources/Process/Read_Controls_Mod/Petsc_Solvers.f90 @@ -7,11 +7,11 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, p, fun @@ -24,6 +24,8 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) character(SL) :: opts(MSI) integer :: i, n_opts, sc real :: tol +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) !==============================================================================! ! If it wasn't compiled with PETSc, don't confuse a user with this @@ -48,14 +50,14 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) !----------------------------! ! For momentum equations ! !----------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_MOMENTUM', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_MOMENTUM', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'asm', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) u % solver = sstring v % solver = sstring @@ -73,29 +75,33 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) v % tol = tol w % tol = tol else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for momentum are not specified.' // & - ' Using the default values' - end if - u % prec = 'asm' - v % prec = 'asm' - w % prec = 'asm' + u % solver = 'bicg' + v % solver = 'bicg' + w % solver = 'bicg' + u % prec = 'asm' + v % prec = 'asm' + w % prec = 'asm' u % prec_opts(1:MSI) = '' v % prec_opts(1:MSI) = '' w % prec_opts(1:MSI) = '' + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for momentum are not' // & + ' specified. Using the default: ' // & + trim(u % solver) // '/' // trim(u % prec) + end if end if !---------------------------! ! For pressure equation ! !---------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_PRESSURE', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_PRESSURE', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'cg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'cg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'gamg', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) Flow % pp % solver = sstring Flow % pp % prec = pstring @@ -103,25 +109,27 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) Flow % pp % prec_opts(1:n_opts) = opts(1:n_opts) Flow % pp % tol = tol else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for pressure are not specified.' // & - ' Using the default values' - end if - Flow % pp % prec = 'asm' + Flow % pp % solver = 'cg' + Flow % pp % prec = 'gamg' Flow % pp % prec_opts(1:MSI) = '' + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for pressure are not' // & + ' specified. Using the default: ' // & + trim(Flow % pp % solver) // '/' // trim(Flow % pp % prec) + end if end if !-----------------------------------! ! For wall distance computation ! !-----------------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_WALL_DISTANCE', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_WALL_DISTANCE', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'cg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'gamg', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) Flow % wall_dist % solver = sstring Flow % wall_dist % prec = pstring @@ -129,25 +137,28 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) Flow % wall_dist % prec_opts(1:n_opts) = opts(1:n_opts) Flow % wall_dist % tol = tol else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for potential are not specified.' // & - ' Using the default values' - end if - Flow % wall_dist % prec = 'asm' + Flow % wall_dist % solver = 'cg' + Flow % wall_dist % prec = 'gamg' Flow % wall_dist % prec_opts(1:MSI) = '' + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for wall distance are not' // & + ' specified. Using the default: ' // & + trim(Flow % wall_dist % solver) // '/' // & + trim(Flow % wall_dist % prec) + end if end if !----------------------------! ! For potential equation ! !----------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_POTENTIAL', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_POTENTIAL', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'cg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'gamg', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) Flow % pot % solver = sstring Flow % pot % prec = pstring @@ -155,25 +166,27 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) Flow % pot % prec_opts(1:n_opts) = opts(1:n_opts) Flow % pot % tol = tol else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for potential are not specified.' // & - ' Using the default values' - end if - Flow % pot % prec = 'asm' + Flow % pot % solver = 'cg' + Flow % pot % prec = 'gamg' Flow % pot % prec_opts(1:MSI) = '' + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for potential are not' // & + ' specified. Using the default: ' // & + trim(Flow % pot % solver) // '/' // trim(Flow % pot % prec) + end if end if !----------------------! ! For VOF function ! !----------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_VOF', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_VOF', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'asm', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-5, tol, .true.) Vof % fun % solver = sstring Vof % fun % prec = pstring @@ -181,25 +194,27 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) Vof % fun % prec_opts(1:n_opts) = opts(1:n_opts) Vof % fun % tol = tol else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for VOF are not specified.' // & - ' Using the default values' - end if - Vof % fun % prec = 'asm' + Vof % fun % solver = 'bicg' + Vof % fun % prec = 'asm' Vof % fun % prec_opts(1:MSI) = '' + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for VOF are not' // & + ' specified. Using the default: ' // & + trim(Vof % fun % solver) // '/' // trim(Vof % fun % prec) + end if end if !-------------------------! ! For energy equation ! !-------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_ENERGY', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_ENERGY', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'asm', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) t % solver = sstring t % prec = pstring @@ -207,26 +222,28 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) t % prec_opts(1:n_opts) = opts(1:n_opts) t % tol = tol else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for energy are not specified.' // & - ' Using the default values' - end if - t % prec = 'asm' + t % solver = 'bicg' + t % prec = 'asm' t % prec_opts(1:MSI) = '' + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for energy are not' // & + ' specified. Using the default: ' // & + trim(t % solver) // '/' // trim(t % prec) + end if end if !--------------------------------! ! Related to passive scalars ! !--------------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_SCALARS', & + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_SCALARS', & found, & .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'asm', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) @@ -237,28 +254,33 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) phi % tol = tol end do else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for scalars are not specified.' // & - ' Using the default values' - end if do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) - phi % prec = 'asm' + phi % solver = 'bicg' + phi % prec = 'asm' phi % prec_opts(1:MSI) = '' end do + if(Flow % n_scalars > 0) then + phi => Flow % scalar(1) ! probably not needed, but doesn't harm + if(First_Proc() .and. associated(phi)) then + print '(a)', ' # NOTE! PETSc options for scalars are not' // & + ' specified. Using the default: ' // & + trim(phi % solver) // '/' // trim(phi % prec) + end if + end if end if !------------------------------! ! All turbuelnt quantities ! !------------------------------! - call Control_Mod_Position_At_One_Key('PETSC_OPTIONS_FOR_TURBULENCE', & - found, & - .false.) + call Control % Position_At_One_Key('PETSC_OPTIONS_FOR_TURBULENCE', & + found, & + .false.) if(found) then - call Control_Mod_Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) - call Control_Mod_Read_Char_Item_On('PREC', 'asm', pstring, .true.) - call Control_Mod_Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) - call Control_Mod_Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) + call Control % Read_Char_Item_On('SOLVER', 'bicg', sstring, .true.) + call Control % Read_Char_Item_On('PREC', 'asm', pstring, .true.) + call Control % Read_Strings_On ('PREC_OPTS', opts, n_opts, .false.) + call Control % Read_Real_Item_On('TOLERANCE', 1.0e-3, tol, .true.) do i = 1, 12 if(i .eq. 1) tq => Turb % kin @@ -280,10 +302,6 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) tq % tol = tol end do else - if(this_proc < 2) then - print *, '# NOTE! PETSc options for turbulence are not specified.' // & - ' Using the default values' - end if do i = 1, 12 if(i .eq. 1) tq => Turb % kin if(i .eq. 2) tq => Turb % eps @@ -297,9 +315,15 @@ subroutine Petsc_Solvers(Rc, Flow, Turb, Vof, Sol) if(i .eq. 10) tq => Turb % uv if(i .eq. 11) tq => Turb % uw if(i .eq. 12) tq => Turb % vw - tq % prec = 'asm' + tq % solver = 'bicg' + tq % prec = 'asm' tq % prec_opts(1:MSI) = '' end do + if(First_Proc()) then + print '(a)', ' # NOTE! PETSc options for turbulence are not' // & + ' specified. Using the default: ' // & + trim(tq % solver) // '/' // trim(tq % prec) + end if end if end subroutine diff --git a/Sources/Process/Read_Controls_Mod/Physical_Models.f90 b/Sources/Process/Read_Controls_Mod/Physical_Models.f90 index bd828d3fc..a16c127d2 100644 --- a/Sources/Process/Read_Controls_Mod/Physical_Models.f90 +++ b/Sources/Process/Read_Controls_Mod/Physical_Models.f90 @@ -9,15 +9,17 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !----------------------------------[Locals]------------------------------------! type(Bulk_Type), pointer :: bulk character(SL) :: name integer :: n_times, n_stat, n_stat_p +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) !==============================================================================! ! Take aliases @@ -28,18 +30,18 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) ! Number of time steps ! ! ! !--------------------------! - call Control_Mod_Read_Int_Item('NUMBER_OF_TIME_STEPS', 0, n_times, .false.) + call Control % Read_Int_Item('NUMBER_OF_TIME_STEPS', 0, n_times, .false.) !-------------------------------------------! ! ! ! Related to heat transfer and bouyancy ! ! ! !-------------------------------------------! - call Control_Mod_Heat_Transfer(Flow % heat_transfer, verbose = .true.) - call Control_Mod_Gravitational_Vector(Flow % grav_x, & - Flow % grav_y, & - Flow % grav_z, .true.) - call Control_Mod_Buoyancy(name, .true.) + call Control % Heat_Transfer(Flow % heat_transfer, verbose = .true.) + call Control % Gravitational_Vector(Flow % grav_x, & + Flow % grav_y, & + Flow % grav_z, .true.) + call Control % Buoyancy(name, .true.) select case(name) case('NONE') Flow % buoyancy = NO_BUOYANCY @@ -48,26 +50,24 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) case('THERMAL') Flow % buoyancy = THERMALLY_DRIVEN case default - if(this_proc < 2) then - print *, '# ERROR! Unknown buoyancy model :', trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop + call Message % Error(60, & + 'Unknown buoyancy model: '//trim(name)// & + '. \n Exiting!') end select - call Control_Mod_Reference_Density (Flow % dens_ref, .true.) - call Control_Mod_Reference_Temperature (Flow % t_ref, .true.) - call Control_Mod_Volume_Expansion_Coefficient(Flow % beta, .true.) - call Control_Mod_Turbulent_Prandtl_Number (pr_t) ! default is (0.9) - call Control_Mod_Extrapolate_Temperature_Exp (Flow % exp_temp_wall, .true.) + call Control % Reference_Density (Flow % dens_ref, .true.) + call Control % Reference_Temperature (Flow % t_ref, .true.) + call Control % Volume_Expansion_Coefficient(Flow % beta, .true.) + call Control % Turbulent_Prandtl_Number (pr_t) ! default is (0.9) + call Control % Turbulent_Schmidt_Number (sc_t) ! default is (0.9) + call Control % Extrapolate_Temperature_Exp (Flow % exp_temp_wall, .true.) !---------------------------! ! ! ! Related to turbulence ! ! ! !---------------------------! - call Control_Mod_Turbulence_Model(name, .true.) + call Control % Turbulence_Model(name, .true.) select case(name) case('NONE') @@ -100,13 +100,9 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) Turb % model = LES_TVM case default - if(this_proc < 2) then - print *, '# ERROR! Unknown turbulence model :', trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(60, & + 'Unknown turbulence model: '//trim(name)// & + '. \n Exiting!') end select !---------------------------------------------------------! @@ -114,28 +110,26 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) !---------------------------------------------------------! if(Turb % model .eq. RSM_HANJALIC_JAKIRLIC .or. & Turb % model .eq. RSM_MANCEAU_HANJALIC) then - call Control_Mod_Turbulence_Model_Variant(name, .true.) + call Control % Turbulence_Model_Variant(name, .true.) if (name .eq. 'NONE') then Turb % model_variant = NO_TURBULENCE_MODEL else if(name .eq. 'STABILIZED') then Turb % model_variant = STABILIZED else - if(this_proc < 2) then - print *, '# ERROR! Unknown turbulence model variant: ', trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End + call Message % Error(72, & + 'Unknown turbulence model variant: '//trim(name)// & + '. \n Exiting!') end if end if !----------------------------! ! Rough or smooth walls? ! !----------------------------! - call Control_Mod_Rough_Walls(Turb % rough_walls, .true.) + call Control % Rough_Walls(Turb % rough_walls, .true.) ! Does the user want to gather statistics? - call Control_Mod_Read_Int_Item('STARTING_TIME_STEP_FOR_TURB_STATISTICS', & - HUGE_INT, n_stat, .false.) + call Control % Read_Int_Item('STARTING_TIME_STEP_FOR_TURB_STATISTICS', & + HUGE_INT, n_stat, .false.) !-------------------------------------------------------------------! ! For scale-resolving simulations, engage turbulence statistics ! @@ -148,10 +142,11 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) Turb % model .eq. DES_SPALART .or. & Turb % model .eq. HYBRID_LES_PRANDTL .or. & Turb % model .eq. HYBRID_LES_RANS .or. & + Turb % model .eq. K_EPS .or. & Turb % model .eq. K_EPS_ZETA_F) .and. & n_times > n_stat) then ! last line covers unsteady RANS models - if(this_proc < 2) then + if(First_Proc()) then print *, '# NOTE! Scale resolving simulation used; ' // & 'turbulence statistics engaged!' end if @@ -162,7 +157,7 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) !-------------------------------! ! Turbulent heat flux model ! !-------------------------------! - call Control_Mod_Turbulent_Heat_Flux_Model(name, .true.) + call Control % Turbulent_Heat_Flux_Model(name, .true.) select case(name) case('SGDH') Turb % heat_flux_model = SGDH @@ -171,30 +166,25 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) case('AFM') Turb % heat_flux_model = AFM case default - if(this_proc < 2) then - print *, '# ERROR! Unknown turbulent heat flux model :', trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End + call Message % Error(64, & + 'Unknown turbulent heat flux model: '//trim(name)// & + '. \n Exiting!') end select !-------------------------------------------! ! Type of switching for hybrid LES/RANS ! !-------------------------------------------! if(Turb % model .eq. HYBRID_LES_RANS) then - call Control_Mod_Hybrid_Les_Rans_Switch(name, .true.) + call Control % Hybrid_Les_Rans_Switch(name, .true.) select case(name) case('SWITCH_DISTANCE') Turb % hybrid_les_rans_switch = SWITCH_DISTANCE case('SWITCH_VELOCITY') Turb % hybrid_les_rans_switch = SWITCH_VELOCITY case default - if(this_proc < 2) then - print *, '# ERROR! Unknown type of hybrid LES/RANS switch:', & - trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End + call Message % Error(72, & + 'Unknown type of hybrid LES/RANS switch: '//trim(name)// & + '. \n Exiting!') end select end if @@ -203,7 +193,7 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) !-------------------------------------------------------------------------! if(Turb % model .eq. LES_SMAGORINSKY .or. & Turb % model .eq. HYBRID_LES_PRANDTL) then - call Control_Mod_Smagorinsky_Constant(c_smag, .true.) + call Control % Smagorinsky_Constant(c_smag, .true.) end if if(Turb % model .eq. K_EPS) then @@ -233,37 +223,36 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) call Turb % Const_Les() end if - !------------------------------------! !------------------------------------! ! ! ! Pressure drops and mass fluxes ! ! ! !------------------------------------! - call Control_Mod_Pressure_Drops(bulk % p_drop_x, & - bulk % p_drop_y, & - bulk % p_drop_z) - call Control_Mod_Mass_Flow_Rates(bulk % flux_x_o, & - bulk % flux_y_o, & - bulk % flux_z_o) + call Control % Pressure_Drops(bulk % p_drop_x, & + bulk % p_drop_y, & + bulk % p_drop_z) + call Control % Mass_Flow_Rates(bulk % flux_x_o, & + bulk % flux_y_o, & + bulk % flux_z_o) !-----------------------! ! ! ! Number of scalars ! ! ! !-----------------------! - call Control_Mod_Number_Of_Scalars(Flow % n_scalars, verbose = .true.) + call Control % Number_Of_Scalars(Flow % n_scalars, verbose = .true.) !-----------------------------------! ! ! ! Related to interface tracking ! ! ! !-----------------------------------! - call Control_Mod_Interface_Tracking(Flow % with_interface, .true.) + call Control % Interface_Tracking(Flow % with_interface, .true.) if(Flow % with_interface) then - call Control_Mod_Track_Front (Vof % track_front, .true.) - call Control_Mod_Track_Surface(Vof % track_surface, .true.) - call Control_Mod_Mass_Transfer(Flow % mass_transfer) + call Control % Track_Front (Vof % track_front, .true.) + call Control % Track_Surface(Vof % track_surface, .true.) + call Control % Mass_Transfer(Flow % mass_transfer) end if !-----------------------! @@ -271,24 +260,24 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) ! Particle tracking ! ! ! !-----------------------! - call Control_Mod_Particle_Tracking(Flow % with_particles, .true.) + call Control % Particle_Tracking(Flow % with_particles, .true.) if(Flow % with_particles) then - call Control_Mod_Max_Particles (Swarm % max_particles, verbose = .true.) - call Control_Mod_Swarm_Density (Swarm % density, verbose = .true.) - call Control_Mod_Swarm_Diameter(Swarm % diameter, verbose = .true.) + call Control % Max_Particles (Swarm % max_particles, verbose = .true.) + call Control % Swarm_Density (Swarm % density, verbose = .true.) + call Control % Swarm_Diameter(Swarm % diameter, verbose = .true.) - call Control_Mod_Swarm_Coefficient_Of_Restitution(Swarm % rst, & - verbose = .true.) - call Control_Mod_Number_Of_Swarm_Sub_Steps (Swarm % n_sub_steps, & - verbose = .true.) + call Control % Swarm_Coefficient_Of_Restitution(Swarm % rst, & + verbose = .true.) + call Control % Number_Of_Swarm_Sub_Steps (Swarm % n_sub_steps, & + verbose = .true.) - call Control_Mod_Read_Int_Item('STARTING_TIME_STEP_FOR_SWARM_STATISTICS', & - HUGE_INT, n_stat_p, .false.) + call Control % Read_Int_Item('STARTING_TIME_STEP_FOR_SWARM_STATISTICS', & + HUGE_INT, n_stat_p, .false.) ! SGS models for particle - call Control_Mod_Swarm_Subgrid_Scale_Model(name, verbose = .true.) + call Control % Swarm_Subgrid_Scale_Model(name, verbose = .true.) select case(name) case('BROWNIAN_FUKAGATA') Swarm % subgrid_scale_model = BROWNIAN_FUKAGATA @@ -297,7 +286,7 @@ subroutine Physical_Models(Rc, Flow, Turb, Vof, Swarm) end select if(n_times > n_stat_p) then ! last line covers unsteady RANS models - if(this_proc < 2) then + if(First_Proc()) then print *, '# NOTE! Lagrangian particle tracking used; ' // & 'swarm statistics engaged!' // & 'and particle statistics begins at:', n_stat_p diff --git a/Sources/Process/Read_Controls_Mod/Physical_Properties.f90 b/Sources/Process/Read_Controls_Mod/Physical_Properties.f90 index 9bd53e2bf..2f2d1577b 100644 --- a/Sources/Process/Read_Controls_Mod/Physical_Properties.f90 +++ b/Sources/Process/Read_Controls_Mod/Physical_Properties.f90 @@ -5,34 +5,37 @@ subroutine Physical_Properties(Rc, Flow, Vof, Swarm) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type) :: Flow - type(Vof_Type) :: Vof - type(Swarm_Type) :: Swarm + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type) :: Flow + type(Vof_Type) :: Vof + type(Swarm_Type) :: Swarm !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid real :: dens_const, visc_const real :: capa_const, cond_const +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Rc) + Unused(Swarm) !==============================================================================! ! Take alias Grid => Flow % pnt_grid ! Read constant (defualt) values - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) - call Control_Mod_Scalars_Diffusivity (Flow % diffusivity) + call Control % Dynamic_Viscosity (visc_const) + call Control % Mass_Density (dens_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) + call Control % Scalars_Diffusivity (Flow % diffusivity) if(Flow % with_interface) then - call Control_Mod_Phase_Densities (Vof % phase_dens) - call Control_Mod_Phase_Viscosities (Vof % phase_visc) - call Control_Mod_Phase_Capacities (Vof % phase_capa) - call Control_Mod_Phase_Conductivities (Vof % phase_cond) - call Control_Mod_Surface_Tension (Vof % surface_tension) - call Control_Mod_Latent_Heat (Vof % latent_heat) - call Control_Mod_Saturation_Temperature(Vof % t_sat) + call Control % Phase_Densities (Vof % phase_dens) + call Control % Phase_Viscosities (Vof % phase_visc) + call Control % Phase_Capacities (Vof % phase_capa) + call Control % Phase_Conductivities (Vof % phase_cond) + call Control % Surface_Tension (Vof % surface_tension) + call Control % Latent_Heat (Vof % latent_heat) + call Control % Saturation_Temperature(Vof % t_sat) else Flow % density (:) = dens_const Flow % viscosity (:) = visc_const diff --git a/Sources/Process/Read_Controls_Mod/Linear_Solvers.f90 b/Sources/Process/Read_Controls_Mod/Solvers.f90 similarity index 70% rename from Sources/Process/Read_Controls_Mod/Linear_Solvers.f90 rename to Sources/Process/Read_Controls_Mod/Solvers.f90 index 8a3eb0f61..fa1e32c91 100644 --- a/Sources/Process/Read_Controls_Mod/Linear_Solvers.f90 +++ b/Sources/Process/Read_Controls_Mod/Solvers.f90 @@ -1,25 +1,25 @@ !==============================================================================! - subroutine Linear_Solvers(Rc, Flow, Turb, Vof, Sol) + subroutine Solvers(Rc, Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! Reads which linear solvers to use, and calls appropriate branches. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Read_Controls_Type) :: Rc - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol + class(Read_Controls_Type), intent(in) :: Rc + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !----------------------------------[Locals]------------------------------------! character(SL) :: name !==============================================================================! ! Linear solvers you want to use; native or PETSc - call Control_Mod_Linear_Solvers(name, .true.) + call Control % Linear_Solvers(name, .true.) Sol % solvers = Solver_Mod_Linear_Solvers_Code(name) ! Read options for native solvers first ... - call Rc % Native_Solvers(Flow, Turb, Vof, Sol) + call Rc % Native_Solvers(Flow, Turb, Vof) ! ... and follow with options for PETSc call Rc % Petsc_Solvers(Flow, Turb, Vof, Sol) diff --git a/Sources/Process/Results_Mod.f90 b/Sources/Process/Results_Mod.f90 index e846a7030..3543b9fe6 100644 --- a/Sources/Process/Results_Mod.f90 +++ b/Sources/Process/Results_Mod.f90 @@ -1,3 +1,7 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Results_Mod !------------------------------------------------------------------------------! @@ -18,6 +22,7 @@ module Results_Mod type Results_Type logical :: boundary ! save results at boundaries or not + logical :: units ! save variable name with unit logical :: initial ! save intial condition or not integer :: interval ! result save interval integer :: interval_swarm ! result save interval for particles @@ -25,16 +30,16 @@ module Results_Mod contains procedure :: Main_Results - procedure, private :: Save_Results - procedure, private :: Save_Scalar_Int - procedure, private :: Save_Scalar_Real - procedure, private :: Save_Front - procedure, private :: Save_Surf - procedure, private :: Save_Swarm - procedure, private :: Save_Tensor_6_Real - procedure, private :: Save_Tensor_9_Real - procedure, private :: Save_Vector_Real - procedure, private :: Time_To_Save + procedure, private :: Save_Vtu_Results + procedure, private :: Save_Vtu_Scalar_Int + procedure, private :: Save_Vtu_Scalar_Real + procedure, private :: Save_Vtu_Front + procedure, private :: Save_Vtu_Surf + procedure, private :: Save_Vtu_Swarm + procedure, private :: Save_Vtu_Tensor_6_Real + procedure, private :: Save_Vtu_Tensor_9_Real + procedure, private :: Save_Vtu_Vector_Real + procedure, private :: Time_To_Save_Results procedure, private :: Time_To_Save_Swarm end type @@ -44,16 +49,16 @@ module Results_Mod contains # include "Results_Mod/Main_Results.f90" -# include "Results_Mod/Save_Results.f90" -# include "Results_Mod/Save_Front.f90" -# include "Results_Mod/Save_Scalar_Int.f90" -# include "Results_Mod/Save_Scalar_Real.f90" -# include "Results_Mod/Save_Swarm.f90" -# include "Results_Mod/Save_Tensor_6_Real.f90" -# include "Results_Mod/Save_Tensor_9_Real.f90" -# include "Results_Mod/Save_Vector_Real.f90" -# include "Results_Mod/Save_Surf.f90" -# include "Results_Mod/Time_To_Save.f90" +# include "Results_Mod/Save_Vtu_Results.f90" +# include "Results_Mod/Save_Vtu_Front.f90" +# include "Results_Mod/Save_Vtu_Scalar_Int.f90" +# include "Results_Mod/Save_Vtu_Scalar_Real.f90" +# include "Results_Mod/Save_Vtu_Swarm.f90" +# include "Results_Mod/Save_Vtu_Tensor_6_Real.f90" +# include "Results_Mod/Save_Vtu_Tensor_9_Real.f90" +# include "Results_Mod/Save_Vtu_Vector_Real.f90" +# include "Results_Mod/Save_Vtu_Surf.f90" +# include "Results_Mod/Time_To_Save_Results.f90" # include "Results_Mod/Time_To_Save_Swarm.f90" end module diff --git a/Sources/Process/Results_Mod/Main_Results.f90 b/Sources/Process/Results_Mod/Main_Results.f90 index 6871ee3ae..6e6ec120c 100644 --- a/Sources/Process/Results_Mod/Main_Results.f90 +++ b/Sources/Process/Results_Mod/Main_Results.f90 @@ -1,7 +1,5 @@ !==============================================================================! - subroutine Main_Results(Results, & - curr_dt, last_dt, time, n_dom, & - Flow, Turb, Vof, Swarm, exit_now) + subroutine Main_Results(Results, n_dom, Flow, Turb, Vof, Swarm, exit_now) !------------------------------------------------------------------------------! ! Main function for saving results (postprocessing and backup) ! !------------------------------------------------------------------------------! @@ -9,8 +7,6 @@ subroutine Main_Results(Results, & implicit none !---------------------------------[Arguments]----------------------------------! class(Results_Type) :: Results - integer :: curr_dt, last_dt - real :: time ! physical time of the simulation integer :: n_dom type(Field_Type) :: Flow(MD) ! Flow field type(Turb_Type) :: Turb(MD) ! turbulence modelling @@ -26,80 +22,76 @@ subroutine Main_Results(Results, & inquire(file='save_now', exist=save_now) ! Is it time to save the backup file? - if(curr_dt .eq. last_dt .or. & - save_now .or. & - exit_now .or. & - Backup_Mod_Time_To_Save(curr_dt) .or. & - Info_Mod_Time_To_Exit()) then + if(Time % Curr_Dt() .eq. Time % Last_Dt() .or. & + save_now .or. & + exit_now .or. & + Backup % Time_To_Save_Backup() .or. & + Info % Time_To_Exit()) then do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) - call Backup_Mod_Save(Flow(d), Turb(d), Vof(d), Swarm(d), & - time, curr_dt, domain=d) + call Control % Switch_To_Domain(d) + call Backup % Save(Flow(d), Turb(d), Vof(d), Swarm(d), dom=d) end do end if ! Is it time to save results for post-processing? - if(curr_dt .eq. last_dt .or. & - save_now .or. & - exit_now .or. & - Results % Time_To_Save(curr_dt) .or. & - Info_Mod_Time_To_Exit()) then + if(Time % Curr_Dt() .eq. Time % Last_Dt() .or. & + save_now .or. & + exit_now .or. & + Results % Time_To_Save_Results() .or. & + Info % Time_To_Exit()) then do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) - call Results % Save_Results(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, plot_inside=.true., domain=d) - call Results % Save_Results(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, plot_inside=.false., domain=d) + call Control % Switch_To_Domain(d) + call Results % Save_Vtu_Results(Flow(d), Turb(d), Vof(d), Swarm(d), & + plot_inside=.true., domain=d) + call Results % Save_Vtu_Results(Flow(d), Turb(d), Vof(d), Swarm(d), & + plot_inside=.false., domain=d) if(Flow(d) % with_interface) then if(Vof(d) % track_front) then - call Results % Save_Front(Vof(d) % Front, curr_dt) + call Results % Save_Vtu_Front(Vof(d) % Front) end if if(Vof(d) % track_surface) then - call Results % Save_Surf(Vof(d) % surf, curr_dt) + call Results % Save_Vtu_Surf(Vof(d) % surf) end if end if ! Write results in user-customized format - call User_Mod_Save_Results(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, domain=d) + call User_Mod_Save_Results(Flow(d), Turb(d), Vof(d), Swarm(d), domain=d) if(Flow(d) % with_particles) then - call User_Mod_Save_Swarm(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, domain=d) + call User_Mod_Save_Swarm(Flow(d), Turb(d), Vof(d), Swarm(d), domain=d) end if end do ! through domains end if ! Is it time to save particles for post-processing? - if(curr_dt .eq. last_dt .or. & - save_now .or. & - exit_now .or. & - Results % Time_To_Save_Swarm(curr_dt) .or. & - Info_Mod_Time_To_Exit()) then + if(Time % Curr_Dt() .eq. Time % Last_Dt() .or. & + save_now .or. & + exit_now .or. & + Results % Time_To_Save_Swarm() .or. & + Info % Time_To_Exit()) then do d = 1, n_dom - call Control_Mod_Switch_To_Domain(d) + call Control % Switch_To_Domain(d) if(Flow(d) % with_particles) then - call Results % Save_Swarm(Swarm(d), curr_dt, domain=d) + call Results % Save_Vtu_Swarm(Swarm(d), domain=d) - call User_Mod_Save_Swarm(Flow(d), Turb(d), Vof(d), Swarm(d), & - curr_dt, domain=d) + call User_Mod_Save_Swarm(Flow(d), Turb(d), Vof(d), Swarm(d), domain=d) end if end do ! through domains end if if(save_now) then - if(this_proc < 2) then + if(First_Proc()) then open (9, file='save_now', status='old') close(9, status='delete') end if end if if(exit_now) then - if(this_proc < 2) then + if(First_Proc()) then open (9, file='exit_now', status='old') close(9, status='delete') end if diff --git a/Sources/Process/Results_Mod/Save_Front.f90 b/Sources/Process/Results_Mod/Save_Vtu_Front.f90 similarity index 80% rename from Sources/Process/Results_Mod/Save_Front.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Front.f90 index be3f1a8c5..dfb7d540a 100644 --- a/Sources/Process/Results_Mod/Save_Front.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Front.f90 @@ -1,26 +1,20 @@ !==============================================================================! - subroutine Save_Front(Results, Front, time_step, domain) + subroutine Save_Vtu_Front(Results, Front, domain) !------------------------------------------------------------------------------! ! Writes surface vertices in VTU file format (for VisIt and Paraview) ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! - class(Results_Type) :: Results - type(Front_Type), target :: Front - integer :: time_step - integer, optional :: domain + class(Results_Type), intent(in) :: Results + type(Front_Type), target :: Front + integer, optional :: domain !----------------------------------[Locals]------------------------------------! type(Vert_Type), pointer :: Vert integer :: v, e ! vertex and element counters integer :: offset, n, f8, f9 character(SL) :: name_out_8, name_out_9 -!-----------------------------[Local parameters]-------------------------------! - character(len= 0) :: IN_0 = '' ! indentation levels - character(len= 2) :: IN_1 = ' ' - character(len= 4) :: IN_2 = ' ' - character(len= 6) :: IN_3 = ' ' - character(len= 8) :: IN_4 = ' ' - character(len=10) :: IN_5 = ' ' +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Results) !==============================================================================! ! Set precision for plotting (intp and floatp variables) @@ -32,19 +26,19 @@ subroutine Save_Front(Results, Front, time_step, domain) ! ! !----------------------------! - call File % Set_Name(name_out_8, & - time_step = time_step, & - appendix = '-front', & - extension = '.pvtu', & + call File % Set_Name(name_out_8, & + time_step = Time % Curr_Dt(), & + appendix = '-front', & + extension = '.pvtu', & domain = domain) - call File % Set_Name(name_out_9, & - processor = this_proc, & - time_step = time_step, & - appendix = '-front', & - extension = '.vtu', & + call File % Set_Name(name_out_9, & + processor = This_Proc(), & + time_step = Time % Curr_Dt(), & + appendix = '-front', & + extension = '.vtu', & domain = domain) - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then call File % Open_For_Writing_Binary(name_out_8, f8) end if call File % Open_For_Writing_Ascii(name_out_9, f9) @@ -54,7 +48,7 @@ subroutine Save_Front(Results, Front, time_step, domain) ! Header ! ! ! !------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_0 // '' // LF write(f8) IN_0 // '' // LF write(f8) IN_1 // '' // LF @@ -74,7 +68,7 @@ subroutine Save_Front(Results, Front, time_step, domain) ! Vertex coordinates ! ! ! !------------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF write(f8) IN_4 // '' // LF @@ -98,7 +92,7 @@ subroutine Save_Front(Results, Front, time_step, domain) ! Point data ! ! ! !----------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF end if write(f9,'(a,a)') IN_3, '' @@ -106,7 +100,7 @@ subroutine Save_Front(Results, Front, time_step, domain) !--------------------! ! Particle i.d.s ! !--------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF end if @@ -120,7 +114,7 @@ subroutine Save_Front(Results, Front, time_step, domain) !--------------------------! ! Number of neighbours ! !--------------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF end if @@ -134,7 +128,7 @@ subroutine Save_Front(Results, Front, time_step, domain) !-----------------------------! ! Curvatures at the nodes ! !-----------------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF end if @@ -146,7 +140,7 @@ subroutine Save_Front(Results, Front, time_step, domain) end do write(f9,'(a,a)') IN_4, '' - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF end if write(f9,'(a,a)') IN_3, '' @@ -156,7 +150,7 @@ subroutine Save_Front(Results, Front, time_step, domain) ! Cells ! ! ! !-----------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF write(f8) IN_4 // '' // LF @@ -167,12 +161,12 @@ subroutine Save_Front(Results, Front, time_step, domain) ' format="ascii">' ! Cell topology do e = 1, Front % n_elems - write(f9,'(a,99i9)') IN_5, Front % elem(e) % v(1:Front % elem(e) % nv)-1 + write(f9,'(a,99i9)') IN_5, Front % Elem(e) % v(1:Front % Elem(e) % nv)-1 end do write(f9,'(a,a)') IN_4, '' ! Cell offsets - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF end if @@ -180,13 +174,13 @@ subroutine Save_Front(Results, Front, time_step, domain) ' format="ascii">' offset = 0 do e = 1, Front % n_elems - offset = offset + Front % elem(e) % nv + offset = offset + Front % Elem(e) % nv write(f9,'(a,i9)') IN_5, offset end do write(f9,'(a,a)') IN_4, '' ! Cell types - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF end if @@ -197,7 +191,7 @@ subroutine Save_Front(Results, Front, time_step, domain) end do write(f9,'(a,a)') IN_4, '' - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF end if write(f9,'(a,a)') IN_3, '' @@ -209,7 +203,7 @@ subroutine Save_Front(Results, Front, time_step, domain) !---------------! ! Beginning of cell data - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF end if write(f9,'(a,a)') IN_3, '' @@ -217,21 +211,21 @@ subroutine Save_Front(Results, Front, time_step, domain) !-------------------------------------! ! Number of neighbouring elements ! !-------------------------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF end if write(f9,'(a,a)') IN_4, '' do e = 1, Front % n_elems - write(f9,'(a,i9)') IN_5, Front % elem(e) % nne + write(f9,'(a,i9)') IN_5, Front % Elem(e) % nne end do write(f9,'(a,a)') IN_4, '' !---------------------! ! Surface normals ! !---------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF @@ -241,16 +235,16 @@ subroutine Save_Front(Results, Front, time_step, domain) ' NumberOfComponents="3" format="ascii">' do e = 1, Front % n_elems write(f9, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, Front % elem(e) % nx, & - Front % elem(e) % ny, & - Front % elem(e) % nz + IN_5, Front % Elem(e) % nx, & + Front % Elem(e) % ny, & + Front % Elem(e) % nz end do write(f9,'(a,a)') IN_4, '' !-------------------! ! Element areas ! !-------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF @@ -259,14 +253,14 @@ subroutine Save_Front(Results, Front, time_step, domain) '' do e = 1, Front % n_elems - write(f9,'(a,1pe16.6e4)') IN_5, Front % elem(e) % area + write(f9,'(a,1pe16.6e4)') IN_5, Front % Elem(e) % area end do write(f9,'(a,a)') IN_4, '' !-------------------------! ! Element coordinates ! !-------------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF @@ -277,16 +271,16 @@ subroutine Save_Front(Results, Front, time_step, domain) ' NumberOfComponents="3" format="ascii">' do e = 1, Front % n_elems write(f9, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, Front % elem(e) % xe, & - Front % elem(e) % ye, & - Front % elem(e) % ze + IN_5, Front % Elem(e) % xe, & + Front % Elem(e) % ye, & + Front % Elem(e) % ze end do write(f9,'(a,a)') IN_4, '' !------------------------! ! Surface curvatures ! !------------------------! - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_4 // '' // LF @@ -295,12 +289,12 @@ subroutine Save_Front(Results, Front, time_step, domain) '' do e = 1, Front % n_elems - write(f9,'(a,1pe16.6e4)') IN_5, Front % elem(e) % curv + write(f9,'(a,1pe16.6e4)') IN_5, Front % Elem(e) % curv end do write(f9,'(a,a)') IN_4, '' ! End of cell data - if(this_proc .eq. 1) then + if(This_Proc() .eq. 1) then write(f8) IN_3 // '' // LF end if write(f9,'(a,a)') IN_3, '' @@ -310,13 +304,13 @@ subroutine Save_Front(Results, Front, time_step, domain) ! Footer ! ! ! !------------! - if(this_proc .eq. 1) then - do n = 1, n_proc - call File % Set_Name(name_out_9, & - processor = n, & - time_step = time_step, & - appendix = '-front', & - extension = '.vtu', & + if(This_Proc() .eq. 1) then + do n = 1, N_Procs() + call File % Set_Name(name_out_9, & + processor = n, & + time_step = Time % Curr_Dt(), & + appendix = '-front', & + extension = '.vtu', & domain = domain) write(f8) IN_2 // '' // LF end do diff --git a/Sources/Process/Results_Mod/Save_Results.f90 b/Sources/Process/Results_Mod/Save_Vtu_Results.f90 similarity index 51% rename from Sources/Process/Results_Mod/Save_Results.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Results.f90 index d69b6c5c0..6c7f255b0 100644 --- a/Sources/Process/Results_Mod/Save_Results.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Results.f90 @@ -1,30 +1,29 @@ !==============================================================================! - subroutine Save_Results(Results, & - Flow, Turb, Vof, Swarm, ts, plot_inside, domain) + subroutine Save_Vtu_Results(Results, Flow, Turb, Vof, Swarm, & + plot_inside, domain) !------------------------------------------------------------------------------! ! Writes results in VTU file format (for VisIt and Paraview) ! !------------------------------------------------------------------------------! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! - class(Results_Type) :: Results - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer :: ts ! time step - logical :: plot_inside ! plot results inside? - integer, optional :: domain + class(Results_Type) :: Results + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm + logical :: plot_inside ! plot results inside? + integer, optional :: domain !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: phi integer(SP) :: data_size - integer :: data_offset, cell_offset, i_fac - integer :: s, n, n_conns, n_polyg, sc, f8, f9, ua, run + integer :: data_offset, cell_offset, i_fac, reg + integer :: s, n, n_conns, n_polyg, sc, f8, f9, run integer :: s1, s2, c1, c2, c_f, c_l real :: dist1, dist2 - character(SL) :: name_out_8, name_out_9, name_mean, a_name - character(SL) :: str1, str2 + character(SL) :: name_out_8, name_out_9, name_mean + character(SL) :: str1, str2, str_time, str_var integer, pointer, contiguous :: int_save(:), type_save(:), offs_save(:) real, pointer, contiguous :: save_01(:), save_02(:), save_03(:) real, pointer, contiguous :: save_04(:), save_05(:), save_06(:) @@ -65,10 +64,10 @@ subroutine Save_Results(Results, & c_l = -1 if(.not. PLOT_BUFFERS) then do c_f = -Grid % n_bnd_cells, -1 - if( Grid % Comm % cell_proc(c_f) .eq. this_proc) exit + if( Grid % Comm % cell_proc(c_f) .eq. This_Proc()) exit end do do c_l = -1, -Grid % n_bnd_cells, -1 - if( Grid % Comm % cell_proc(c_l) .eq. this_proc) exit + if( Grid % Comm % cell_proc(c_l) .eq. This_Proc()) exit end do end if end if @@ -100,7 +99,7 @@ subroutine Save_Results(Results, & end do end if - call Comm_Mod_Wait + call Global % Wait !--------------------------------------! ! ! @@ -108,49 +107,62 @@ subroutine Save_Results(Results, & ! ! !--------------------------------------! if(plot_inside) then - call File % Set_Name(name_out_8, & - time_step=ts, & - extension='.pvtu', & - domain=domain) - call File % Set_Name(name_out_9, & - processor=this_proc, & - time_step=ts, & - extension='.vtu', & - domain=domain) + call File % Set_Name(name_out_8, & + time_step = Time % Curr_Dt(), & + extension = '.pvtu', & + domain = domain) + call File % Set_Name(name_out_9, & + processor = This_Proc(), & + time_step = Time % Curr_Dt(), & + extension = '.vtu', & + domain = domain) else - call File % Set_Name(name_out_8, & - time_step=ts, & - appendix ='-bnd', & - extension='.pvtu', & - domain=domain) - call File % Set_Name(name_out_9, & - processor=this_proc, & - time_step=ts, & - appendix ='-bnd', & - extension='.vtu', & + call File % Set_Name(name_out_8, & + time_step = Time % Curr_Dt(), & + appendix = '-bnd', & + extension = '.pvtu', & domain=domain) + call File % Set_Name(name_out_9, & + processor = This_Proc(), & + time_step = Time % Curr_Dt(), & + appendix = '-bnd', & + extension = '.vtu', & + domain = domain) end if - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then call File % Open_For_Writing_Binary(name_out_8, f8) end if call File % Open_For_Writing_Binary(name_out_9, f9) + write(str_time,'(E16.9)')Time % Get_Time() !------------! ! ! ! Header ! ! ! !------------! - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(f8) IN_0 // '' // LF write(f8) IN_0 // '' // LF write(f8) IN_1 // '' // LF + write(f8) IN_2 // '' // LF + ! TIME must be capitalized for visit + write(f8) IN_3 // ' ' // trim(str_time) // LF + write(f8) IN_3 // '' // LF + write(f8) IN_2 // '' // LF end if write(f9) IN_0 // '' // LF write(f9) IN_0 // '' // LF write(f9) IN_1 // '' // LF + write(f9) IN_2 // '' // LF + ! TIME must be capitalized for visit + write(f9) IN_3 // '' // trim(str_time) // LF + write(f9) IN_3 // '' // LF + write(f9) IN_2 // '' // LF write(str1,'(i0.0)') Grid % n_nodes if(plot_inside) then @@ -176,7 +188,7 @@ subroutine Save_Results(Results, & !-----------! ! Nodes ! !-----------! - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(f8) IN_3 // '' // LF write(f8) IN_4 // '' // LF @@ -220,9 +232,9 @@ subroutine Save_Results(Results, & offs_save(c2) = cell_offset end do end if - call Results % Save_Scalar_Int("offsets", plot_inside, & - offs_save(c_f:c_l), & - f8, f9, data_offset, 1) ! 1 => header only + call Results % Save_Vtu_Scalar_Int("offsets", plot_inside, & + offs_save(c_f:c_l), & + f8, f9, data_offset, 1) ! 1 => header only ! Fill up an array with cell types and save the header only if(plot_inside) then @@ -244,9 +256,9 @@ subroutine Save_Results(Results, & end if end do end if - call Results % Save_Scalar_Int("types", plot_inside, & - type_save(c_f:c_l), & - f8, f9, data_offset, 1) ! 1 => header only + call Results % Save_Vtu_Scalar_Int("types", plot_inside, & + type_save(c_f:c_l), & + f8, f9, data_offset, 1) ! 1 => header only ! Write parts of header for polyhedral cells if(n_polyg > 0) then @@ -279,7 +291,7 @@ subroutine Save_Results(Results, & ! Results and other cell data ! ! ! !---------------------------------! - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(f8) IN_3 // '' // LF end if write(f9) IN_3 // '' // LF @@ -329,13 +341,13 @@ subroutine Save_Results(Results, & end if ! Save cell offsets - call Results % Save_Scalar_Int("offsets", plot_inside, & - offs_save(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Int("offsets", plot_inside, & + offs_save(c_f:c_l), & + f8, f9, data_offset, run) ! Save cell types - call Results % Save_Scalar_Int("types", plot_inside, & - type_save(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Int("types", plot_inside, & + type_save(c_f:c_l), & + f8, f9, data_offset, run) if(n_polyg > 0) then @@ -393,7 +405,7 @@ subroutine Save_Results(Results, & end if !--------------------! - ! Processor i.d. ! + ! Cell processor ! !--------------------! do c1 = c_f, c_l int_save(c1) = Grid % Comm % cell_proc(c1) @@ -401,52 +413,68 @@ subroutine Save_Results(Results, & do c2 = c_f, c_l int_save(c2) = Grid % Comm % cell_proc(c2) end do - call Results % Save_Scalar_Int("Grid Processor [1]", plot_inside, & - int_save(c_f:c_l), & + + str_var = Var_Name("Grid Processor","[1]",Results % units) + call Results % Save_Vtu_Scalar_Int(trim(str_var), plot_inside, & + int_save(c_f:c_l), & f8, f9, data_offset, run) + !-----------------! + ! Cell thread ! + !-----------------! + int_save(c_f:c_l) = Grid % Vect % cell_thread(c_f:c_l) + str_var = Var_Name("Grid Thread","[1]",Results % units) + call Results % Save_Vtu_Scalar_Int(trim(str_var), plot_inside, & + int_save(c_f:c_l), & + f8, f9, data_offset, run) + !-------------------! ! Domain number ! !-------------------! if(present(domain)) then int_save(c_f:c_l) = domain - call Results % Save_Scalar_Int("Grid Domain [1]", plot_inside, & - int_save(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Grid Domain","[1]",Results % units) + call Results % Save_Vtu_Scalar_Int(trim(str_var), plot_inside, & + int_save(c_f:c_l), & + f8, f9, data_offset, run) end if !--------------! ! Velocity ! !--------------! - call Results % Save_Vector_Real("Velocity [m/s]", plot_inside, & - Flow % u % n(c_f:c_l), & - Flow % v % n(c_f:c_l), & - Flow % w % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Velocity","[m/s]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), plot_inside, & + Flow % u % n(c_f:c_l), & + Flow % v % n(c_f:c_l), & + Flow % w % n(c_f:c_l), & + f8, f9, data_offset, run) !--------------------! ! Courant number ! !--------------------! if(plot_inside) then call Flow % Calculate_Courant_In_Cells(save_01) - call Results % Save_Scalar_Real("Courant Number [1]", plot_inside, & - save_01(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Courant Number","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + save_01(c_f:c_l), & + f8, f9, data_offset, run) end if !---------------! ! Potential ! !---------------! - call Results % Save_Scalar_Real("Potential [m^2/s]", plot_inside, & - Flow % pot % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Potential","[m^2/s]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Flow % pot % n(c_f:c_l), & + f8, f9, data_offset, run) !--------------------------------------! ! Pressure correction and pressure ! !--------------------------------------! - call Results % Save_Scalar_Real("Pressure Correction [Pa]", & - plot_inside, & - Flow % pp % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Pressure Correction","[Pa]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Flow % pp % n(c_f:c_l), & + f8, f9, data_offset, run) save_01(:) = 0.0 save_02(:) = 0.0 save_03(:) = 0.0 @@ -455,16 +483,18 @@ subroutine Save_Results(Results, & save_02(c1) = Flow % pp % y(c1) * Grid % vol(c1) save_03(c1) = Flow % pp % z(c1) * Grid % vol(c1) end do - call Results % Save_Vector_Real("Pressure Correction Force [N]", & - plot_inside, & - save_01(c_f:c_l), & - save_02(c_f:c_l), & - save_03(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Pressure Correction Force","[N]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), & + plot_inside, & + save_01(c_f:c_l), & + save_02(c_f:c_l), & + save_03(c_f:c_l), & + f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Pressure [Pa]", plot_inside, & - Flow % p % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Pressure","[Pa]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Flow % p % n(c_f:c_l), & + f8, f9, data_offset, run) save_01(:) = 0.0 save_02(:) = 0.0 save_03(:) = 0.0 @@ -473,19 +503,22 @@ subroutine Save_Results(Results, & save_02(c1) = Flow % p % y(c1) * Grid % vol(c1) save_03(c1) = Flow % p % z(c1) * Grid % vol(c1) end do - call Results % Save_Vector_Real("PressureForce [N]", plot_inside, & - save_01(c_f:c_l), & - save_02(c_f:c_l), & - save_03(c_f:c_l), & - f8, f9, data_offset, run) + + str_var = Var_Name("PressureForce","[N]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), plot_inside, & + save_01(c_f:c_l), & + save_02(c_f:c_l), & + save_03(c_f:c_l), & + f8, f9, data_offset, run) !-----------------! ! Temperature ! !-----------------! if(Flow % heat_transfer) then - call Results % Save_Scalar_Real("Temperature [K]", plot_inside, & - Flow % t % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Temperature","[K]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Flow % t % n(c_f:c_l), & + f8, f9, data_offset, run) save_01(:) = 0.0 save_02(:) = 0.0 save_03(:) = 0.0 @@ -503,40 +536,46 @@ subroutine Save_Results(Results, & call Flow % Calculate_Grad_Matrix() end if - call Results % Save_Vector_Real("Temperature Gradients [K/m]", & - plot_inside, & - save_01(c_f:c_l), & - save_02(c_f:c_l), & - save_03(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Temperature Gradients","[K/m]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), & + plot_inside, & + save_01(c_f:c_l), & + save_02(c_f:c_l), & + save_03(c_f:c_l), & + f8, f9, data_offset, run) end if !-------------------------! ! Physical properties ! !-------------------------! - call Results % Save_Scalar_Real("Physical Density [kg/m^3]", & - plot_inside, & - Flow % density(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Physical Viscosity [Pa s]", & - plot_inside, & - Flow % viscosity(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Physical Conductivity [W/m/K]", & - plot_inside, & - Flow % conductivity(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Physical Capacity [J/K]", & - plot_inside, & - Flow % capacity(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Physical Density","[kg/m^3]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Flow % density(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Physical Viscosity","[Pa s]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Flow % viscosity(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Physical Conductivity","[W/m/K]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Flow % conductivity(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Physical Capacity","[J/kg/K]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Flow % capacity(c_f:c_l), & + f8, f9, data_offset, run) if(Turb % rough_walls) then - call Results % Save_Scalar_Real("Roughness Coefficient z_o [1]", & - plot_inside, & - Turb % z_o(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Roughness Coefficient z_o","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Turb % z_o(c_f:c_l), & + f8, f9, data_offset, run) end if @@ -544,35 +583,41 @@ subroutine Save_Results(Results, & ! Volume fraction ! !---------------------! if(Flow % with_interface) then - call Results % Save_Scalar_Real("Vof Sharp [1]", & - plot_inside, & - Vof % fun % n(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Vof Smooth [1]", & - plot_inside, & - Vof % smooth % n(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Vof Curvature [1/m]", & - plot_inside, & - Vof % curv(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Vector_Real("Vof SurfaceNormals [1]", & - plot_inside, & - Vof % nx(c_f:c_l), & - Vof % ny(c_f:c_l), & - Vof % nz(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Vector_Real("Vof SurfaceTensionForce [N]", & - plot_inside, & - Vof % surf_fx(c_f:c_l), & - Vof % surf_fy(c_f:c_l), & - Vof % surf_fz(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Vof Sharp","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Vof % fun % n(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Vof Smooth","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Vof % smooth % n(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Vof Curvature","[1/m]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Vof % curv(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Vof SurfaceNormals","[1]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), & + plot_inside, & + Vof % nx(c_f:c_l), & + Vof % ny(c_f:c_l), & + Vof % nz(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Vof SurfaceTensionForce","[N]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), & + plot_inside, & + Vof % surf_fx(c_f:c_l), & + Vof % surf_fy(c_f:c_l), & + Vof % surf_fz(c_f:c_l), & + f8, f9, data_offset, run) if (allocated(Vof % m_dot)) then - call Results % Save_Scalar_Real("Vof MassTransfer [kg/m^3/s]", & - plot_inside, & - Vof % m_dot(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Vof MassTransfer","[kg/m^3/s]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Vof % m_dot(c_f:c_l), & + f8, f9, data_offset, run) end if end if @@ -580,14 +625,16 @@ subroutine Save_Results(Results, & ! Number of impacts and reflections ! !---------------------------------------! if(Flow % with_particles .and. .not. plot_inside) then - call Results % Save_Scalar_Real("Particles Reflected [1]", & - plot_inside, & - Swarm % n_reflected(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Particles Deposited [1]", & - plot_inside, & - Swarm % n_deposited(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Particles Reflected","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Swarm % n_reflected(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Particles Deposited","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), & + plot_inside, & + Swarm % n_deposited(c_f:c_l), & + f8, f9, data_offset, run) end if !------------------! @@ -595,9 +642,9 @@ subroutine Save_Results(Results, & !------------------! do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) - call Results % Save_Scalar_Real(phi % name, plot_inside, & - phi % n(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Real(phi % name, plot_inside, & + phi % n(c_f:c_l), & + f8, f9, data_offset, run) end do !-----------------! @@ -607,9 +654,10 @@ subroutine Save_Results(Results, & do c1 = c_f, c_l phi_save(c1) = (Flow % vort(c1)**2 - Flow % shear(c1)**2)/4. end do - call Results % Save_Scalar_Real("Q Criterion [1/s^2]", plot_inside, & - phi_save(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Q Criterion","[1/s^2]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var),plot_inside, & + phi_save(c_f:c_l), & + f8, f9, data_offset, run) !--------------------------! ! Turbulent quantities ! @@ -621,18 +669,18 @@ subroutine Save_Results(Results, & Turb % model .eq. HYBRID_LES_RANS .or. & Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & Turb % model .eq. RSM_HANJALIC_JAKIRLIC ) then - call Results % Save_Scalar_Real("Turbulent Kinetic Energy [m^2/s^2]", & - plot_inside, & - Turb % kin % n(c_f:c_l), & + str_var = Var_Name("Turbulent Kinetic Energy","[m^2/s^2]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % kin % n(c_f:c_l), & f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Turbulent Dissipation [m^2/s^3]", & - plot_inside, & - Turb % eps % n(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real( & - "Turbulent Kinetic Energy Production [m^2/s^3]", & - plot_inside, & - Turb % p_kin(c_f:c_l), & + str_var = Var_Name("Turbulent Dissipation","[m^2/s^3]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % eps % n(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Kinetic Energy Production","[m^2/s^3]", & + Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % p_kin(c_f:c_l), & f8, f9, data_offset, run) end if @@ -643,62 +691,63 @@ subroutine Save_Results(Results, & do c1 = c_f, c_l v2_calc(c1) = Turb % kin % n(c1) * Turb % zeta % n(c1) end do -! call Results % Save_Scalar_Real("Turbulent Quantity V2 [m^2/s^2]", & -! plot_inside, & -! v2_calc (c_f:c_l), & -! f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Turbulent Quantity Zeta [1]", & - plot_inside, & - Turb % zeta % n(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Turbulent Quantity F22 [1]", & - plot_inside, & - Turb % f22 % n(c_f:c_l), & - f8, f9, data_offset, run) +! call Results % Save_Vtu_Scalar_Real("Turbulent Quantity V2 [m^2/s^2]", & +! plot_inside, & +! v2_calc (c_f:c_l), & +! f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Quantity Zeta","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % zeta % n(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Quantity F22","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % f22 % n(c_f:c_l), & + f8, f9, data_offset, run) if(Flow % heat_transfer) then - call Results % Save_Scalar_Real("Turbulent Quantity T2 [K^2]", & - plot_inside, & - Turb % t2 % n(c_f:c_l), & - f8, f9, data_offset, run) -! call Results % Save_Scalar_Real("Turbulent T2 Production [K^2/s]", & -! plot_inside, & -! Turb % p_t2(c_f:c_l), & -! f8, f9, data_offset, run) - call Results % Save_Vector_Real("Turbulent Heat Flux [K m/s]", & - plot_inside, & - Turb % ut % n(c_f:c_l), & - Turb % vt % n(c_f:c_l), & - Turb % wt % n(c_f:c_l), & - f8, f9, data_offset, run) -! call Results % Save_Scalar_Real("Turbulent Quantity Alpha L", & -! plot_inside, & -! Turb % alpha_l(c_f:c_l), & -! f8, f9, data_offset, run) -! call Results % Save_Scalar_Real("Turbulent Quantity Alpha U", & -! plot_inside, & -! Turb % alpha_u(c_f:c_l), & -! f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Quantity T2","[K^2]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % t2 % n(c_f:c_l), & + f8, f9, data_offset, run) +! call Results % Save_Vtu_Scalar_Real("Turbulent T2 Production [K^2/s]",& +! plot_inside, & +! Turb % p_t2(c_f:c_l), & +! f8, f9, data_offset, run) + ! unit wrong ??? + str_var = Var_Name("Turbulent Heat Flux","[K m/s]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), plot_inside, & + Turb % ut % n(c_f:c_l), & + Turb % vt % n(c_f:c_l), & + Turb % wt % n(c_f:c_l), & + f8, f9, data_offset, run) +! call Results % Save_Vtu_Scalar_Real("Turbulent Quantity Alpha L", & +! plot_inside, & +! Turb % alpha_l(c_f:c_l), & +! f8, f9, data_offset, run) +! call Results % Save_Vtu_Scalar_Real("Turbulent Quantity Alpha U", & +! plot_inside, & +! Turb % alpha_u(c_f:c_l), & +! f8, f9, data_offset, run) end if end if if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - call Results % Save_Scalar_Real("Turbulent Quantity F22 [1]", & - plot_inside, & - Turb % f22 % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Quantity F22","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % f22 % n(c_f:c_l), & + f8, f9, data_offset, run) end if ! Save vis and vis_t if(Turb % model .eq. DES_SPALART .or. & Turb % model .eq. SPALART_ALLMARAS) then - call Results % Save_Scalar_Real("Turbulent Viscosity [Pa s]", & - plot_inside, & - Turb % vis % n(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Vorticity Magnitude [1/s]", & - plot_inside, & - Flow % vort(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Viscosity","[Pa s]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % vis % n(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Vorticity Magnitude","[1/s]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Flow % vort(c_f:c_l), & + f8, f9, data_offset, run) end if kin_vis_t(:) = 0.0 @@ -706,26 +755,24 @@ subroutine Save_Results(Results, & Turb % model .ne. HYBRID_LES_RANS .and. & Turb % model .ne. DNS) then kin_vis_t(c_f:c_l) = Turb % vis_t(c_f:c_l) / Flow % viscosity(c_f:c_l) - call Results % Save_Scalar_Real("Eddy Over Molecular Viscosity [1]", & - plot_inside, & - kin_vis_t(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Eddy Over Molecular Viscosity","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + kin_vis_t(c_f:c_l), & + f8, f9, data_offset, run) end if if(Turb % model .eq. HYBRID_LES_RANS) then kin_vis_t(:) = 0.0 kin_vis_t(c_f:c_l) = Turb % vis_t(c_f:c_l) / Flow % viscosity(c_f:c_l) - call Results % Save_Scalar_Real( & - "Rans Eddy Over Molecular Viscosity [1]", & - plot_inside, & - kin_vis_t(c_f:c_l), & + str_var = Var_Name("Rans Eddy Over Molecular Viscosity","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + kin_vis_t(c_f:c_l), & f8, f9, data_offset, run) kin_vis_t(:) = 0.0 kin_vis_t(c_f:c_l) = Turb % vis_t_sgs(c_f:c_l) / Flow % viscosity(c_f:c_l) - call Results % Save_Scalar_Real( & - "Sgs Eddy Over Molecular Viscosity [1]", & - plot_inside, & - kin_vis_t(c_f:c_l), & + str_var = Var_Name("Sgs Eddy Over Molecular Viscosity","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + kin_vis_t(c_f:c_l), & f8, f9, data_offset, run) end if @@ -734,33 +781,33 @@ subroutine Save_Results(Results, & Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then ! Note: follows the order in which Paraview stores tensors - call Results % Save_Tensor_6_Real("Reynolds Stress [m^2/s^2]", & - plot_inside, & - Turb % uu % n(c_f:c_l), & - Turb % vv % n(c_f:c_l), & - Turb % ww % n(c_f:c_l), & - Turb % uv % n(c_f:c_l), & - Turb % vw % n(c_f:c_l), & - Turb % uw % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Reynolds Stress","[m^2/s^2]",Results % units) + call Results % Save_Vtu_Tensor_6_Real(trim(str_var), plot_inside, & + Turb % uu % n(c_f:c_l), & + Turb % vv % n(c_f:c_l), & + Turb % ww % n(c_f:c_l), & + Turb % uv % n(c_f:c_l), & + Turb % vw % n(c_f:c_l), & + Turb % uw % n(c_f:c_l), & + f8, f9, data_offset, run) if(Flow % heat_transfer) then - call Results % Save_Vector_Real("Turbulent Heat Flux [K m/s]", & - plot_inside, & - Turb % ut % n(c_f:c_l), & - Turb % vt % n(c_f:c_l), & - Turb % wt % n(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Heat Flux","[K m/s]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), plot_inside, & + Turb % ut % n(c_f:c_l), & + Turb % vt % n(c_f:c_l), & + Turb % wt % n(c_f:c_l), & + f8, f9, data_offset, run) end if end if ! Statistics for large-scale simulations of turbulence if(Turb % statistics) then - call Results % Save_Vector_Real("Mean Velocity [m/s]", & - plot_inside, & - Turb % u_mean(c_f:c_l), & - Turb % v_mean(c_f:c_l), & - Turb % w_mean(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Mean Velocity","[m/s]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), plot_inside, & + Turb % u_mean(c_f:c_l), & + Turb % v_mean(c_f:c_l), & + Turb % w_mean(c_f:c_l), & + f8, f9, data_offset, run) save_01(:) = 0.0 save_02(:) = 0.0 save_03(:) = 0.0 @@ -777,19 +824,19 @@ subroutine Save_Results(Results, & save_05(c1) = Turb % vw_res(c1) - Turb % v_mean(c1) * Turb % w_mean(c1) save_06(c1) = Turb % uw_res(c1) - Turb % u_mean(c1) * Turb % w_mean(c1) end do - call Results % Save_Tensor_6_Real("Mean Reynolds Stress [m^s/s^2]", & - plot_inside, & - save_01(c_f:c_l), & - save_02(c_f:c_l), & - save_03(c_f:c_l), & - save_04(c_f:c_l), & - save_05(c_f:c_l), & - save_06(c_f:c_l), & + str_var = Var_Name("Mean Reynolds Stress","[m^s/s^2]",Results % units) + call Results % Save_Vtu_Tensor_6_Real(trim(str_var), plot_inside, & + save_01(c_f:c_l), & + save_02(c_f:c_l), & + save_03(c_f:c_l), & + save_04(c_f:c_l), & + save_05(c_f:c_l), & + save_06(c_f:c_l), & f8, f9, data_offset, run) if(Flow % heat_transfer) then - call Results % Save_Scalar_Real("Mean Temperature [K]", & - plot_inside, & - Turb % t_mean(c_f:c_l), & + str_var = Var_Name("Mean Temperature","[K]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % t_mean(c_f:c_l), & f8, f9, data_offset, run) phi_save(:) = 0.0 save_01(:) = 0.0 @@ -801,15 +848,15 @@ subroutine Save_Results(Results, & save_02(c1) = Turb % vt_res(c1) - Turb % v_mean(c1)*Turb % t_mean(c1) save_03(c1) = Turb % wt_res(c1) - Turb % w_mean(c1)*Turb % t_mean(c1) end do - call Results % Save_Scalar_Real("Mean Turbulent Quantity T2 [K^2]", & - plot_inside, & - phi_save(c_f:c_l), & + str_var = Var_Name("Mean Turbulent Quantity T2","[K^2]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + phi_save(c_f:c_l), & f8, f9, data_offset, run) - call Results % Save_Vector_Real("Mean Turbulent Heat Flux [K m/s]", & - plot_inside, & - save_01(c_f:c_l), & - save_02(c_f:c_l), & - save_03(c_f:c_l), & + str_var = Var_Name("Mean Turbulent Heat Flux","[K m/s]",Results % units) + call Results % Save_Vtu_Vector_Real(trim(str_var), plot_inside, & + save_01(c_f:c_l), & + save_02(c_f:c_l), & + save_03(c_f:c_l), & f8, f9, data_offset, run) end if @@ -821,42 +868,51 @@ subroutine Save_Results(Results, & do c1 = c_f, c_l phi_save(c1) = Turb % scalar_mean(sc, c1) end do - call Results % Save_Scalar_Real(name_mean, plot_inside, & - phi_save(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Real(name_mean, plot_inside, & + phi_save(c_f:c_l), & + f8, f9, data_offset, run) end do end if ! Save y+ for all turbulence models if(Turb % model .ne. NO_TURBULENCE_MODEL .and. & Turb % model .ne. DNS) then - call Results % Save_Scalar_Real("Turbulent Quantity Y Plus [1]", & - plot_inside, & - Turb % y_plus(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Turbulent Quantity Y Plus","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % y_plus(c_f:c_l), & + f8, f9, data_offset, run) end if ! Wall distance and delta, important for all models - call Results % Save_Scalar_Real("Grid Cell Volume [m^3]", & - plot_inside, & - Grid % vol(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Grid Wall Distance [m]", & - plot_inside, & - Grid % wall_dist(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Grid Cell Delta Max [m]", & - plot_inside, & - Turb % h_max(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Grid Cell Delta Min [m]", & - plot_inside, & - Turb % h_min(c_f:c_l), & - f8, f9, data_offset, run) - call Results % Save_Scalar_Real("Grid Cell Delta Wall [m]", & - plot_inside, & - Turb % h_w (c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("Grid Cell Volume","[m^3]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Grid % vol(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Grid Cell Inertia","[m^2]",Results % units) + call Results % Save_Vtu_Tensor_6_Real(trim(str_var), plot_inside, & + Grid % ixx(c_f:c_l), & + Grid % iyy(c_f:c_l), & + Grid % izz(c_f:c_l), & + Grid % ixy(c_f:c_l), & + Grid % iyz(c_f:c_l), & + Grid % ixz(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Grid Wall Distance","[m]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Grid % wall_dist(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Grid Cell Delta Max","[m]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % h_max(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Grid Cell Delta Min","[m]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % h_min(c_f:c_l), & + f8, f9, data_offset, run) + str_var = Var_Name("Grid Cell Delta Wall","[m]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + Turb % h_w (c_f:c_l), & + f8, f9, data_offset, run) !---------------------------------------------------------------------! ! Variables in the first computational point, plotted at boundary ! @@ -880,10 +936,11 @@ subroutine Save_Results(Results, & save_03(c2) = Flow % w % n(c1) end if end do - call Results % Save_Vector_Real("Velocity Near Wall [m/s]", plot_inside, & - save_01(c_f:c_l), & - save_02(c_f:c_l), & - save_03(c_f:c_l), & + call Results % Save_Vtu_Vector_Real("Velocity Near Wall [m/s]", & + plot_inside, & + save_01(c_f:c_l), & + save_02(c_f:c_l), & + save_03(c_f:c_l), & f8, f9, data_offset, run) if(Turb % model .eq. K_EPS .or. & @@ -892,104 +949,97 @@ subroutine Save_Results(Results, & ! Copy internal values to boundary var_ins(:) = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + var_ins(c2) = Turb % kin % n(c1) - end if + end do end do - call Results % Save_Scalar_Real("T.K.E. Near Wall [m^2/s^2]", & - plot_inside, & - var_ins(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("T.K.E. Near Wall","[m^2/s^2]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + var_ins(c_f:c_l), & + f8, f9, data_offset, run) ! Copy internal values to boundary var_ins(:) = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + var_ins(c2) = Turb % y_plus(c1) - end if + end do end do - call Results % Save_Scalar_Real("y+ Near Wall [1]", & - plot_inside, & - var_ins(c_f:c_l), & - f8, f9, data_offset, run) + str_var = Var_Name("y+ Near Wall","[1]",Results % units) + call Results % Save_Vtu_Scalar_Real(trim(str_var), plot_inside, & + var_ins(c_f:c_l), & + f8, f9, data_offset, run) do sc = 1, Flow % n_scalars phi => Flow % scalar(sc) ! Copy internal values to boundary var_ins(:) = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + var_ins(c2) = phi % n(c1) - end if + end do end do - call Results % Save_Scalar_Real("Scalar Near Wall", & - plot_inside, & - var_ins(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Real("Scalar Near Wall", & + plot_inside, & + var_ins(c_f:c_l), & + f8, f9, data_offset, run) ! Copy internal values to boundary var_ins(:) = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + var_ins(c2) = phi_save(c1) ! Turb % scalar_mean(sc, c1) - end if + end do end do - call Results % Save_Scalar_Real("Mean Scalar Near Wall", & - plot_inside, & - var_ins(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Real("Mean Scalar Near Wall", & + plot_inside, & + var_ins(c_f:c_l), & + f8, f9, data_offset, run) ! Copy internal values to boundary var_ins(:) = 0.0 - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + var_ins(c2) = phi % q(c2) ! Turb % scalar_mean(sc, c1) - end if + end do end do - call Results % Save_Scalar_Real("Wall Scalar Flux", & - plot_inside, & - var_ins(c_f:c_l), & - f8, f9, data_offset, run) + call Results % Save_Vtu_Scalar_Real("Wall Scalar Flux", & + plot_inside, & + var_ins(c_f:c_l), & + f8, f9, data_offset, run) end do end if end if - !----------------------! - ! Save user arrays ! - !----------------------! - do ua = 1, Grid % n_user_arrays - - a_name = 'A_00' - write(a_name(3:4), '(i2.2)') ua - call Results % Save_Scalar_Real(a_name, plot_inside, & - Grid % user_array(ua,c_f:c_l), & - f8, f9, data_offset, run) - end do - !----------------------! ! ! ! End of cell data ! ! ! !----------------------! if(run .eq. 1) then - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(f8) IN_3 // '' // LF end if write(f9) IN_3 // '' // LF @@ -1018,21 +1068,21 @@ subroutine Save_Results(Results, & ! Footer ! ! ! !------------! - if(n_proc > 1 .and. this_proc .eq. 1) then - do n = 1, n_proc + if(Parallel_Run() .and. First_Proc()) then + do n = 1, N_Procs() if(plot_inside) then - call File % Set_Name(name_out_9, & - processor=n, & - time_step=ts, & - extension='.vtu', & - domain=domain) + call File % Set_Name(name_out_9, & + processor = n, & + time_step = Time % Curr_Dt(), & + extension = '.vtu', & + domain = domain) else - call File % Set_Name(name_out_9, & - processor=n, & - time_step=ts, & - appendix ='-bnd', & - extension='.vtu', & - domain=domain) + call File % Set_Name(name_out_9, & + processor = n, & + time_step = Time % Curr_Dt(), & + appendix = '-bnd', & + extension = '.vtu', & + domain = domain) end if write(f8) IN_2 // '' // LF end do @@ -1049,3 +1099,16 @@ subroutine Save_Results(Results, & call Profiler % Stop('Save_Vtu_Results') end subroutine + +!==============================================================================! + Character(SL) function Var_Name(str1, str2, bool) +!------------------------------------------------------------------------------! + implicit none +!--------------------------------[Arguments]-----------------------------------! + character(*) :: str1, str2 + logical :: bool +!==============================================================================! + Var_Name = trim(str1) + if (bool) Var_Name = trim(Var_Name) // " " // trim(str2) + + end function diff --git a/Sources/Process/Results_Mod/Save_Scalar_Int.f90 b/Sources/Process/Results_Mod/Save_Vtu_Scalar_Int.f90 similarity index 86% rename from Sources/Process/Results_Mod/Save_Scalar_Int.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Scalar_Int.f90 index f2d7345b1..284eed745 100644 --- a/Sources/Process/Results_Mod/Save_Scalar_Int.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Scalar_Int.f90 @@ -1,8 +1,8 @@ !==============================================================================! - subroutine Save_Scalar_Int(Results, & - var_name, plot_inside, & - val, fs, fp, & - data_offset, sweep) + subroutine Save_Vtu_Scalar_Int(Results, & + var_name, plot_inside, & + val, fs, fp, & + data_offset, sweep) !------------------------------------------------------------------------------! ! Writes one integer scalar defined over cells. ! !------------------------------------------------------------------------------! @@ -19,6 +19,8 @@ subroutine Save_Scalar_Int(Results, & integer(SP) :: data_size integer :: c1, c2, c_f, c_l character(SL) :: str1 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Results) !==============================================================================! ! Set precision for plotting (intp and floatp variables) @@ -31,7 +33,7 @@ subroutine Save_Scalar_Int(Results, & ! Header if(sweep .eq. 1) then - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(fs) IN_4 // & '' // LF diff --git a/Sources/Process/Results_Mod/Save_Scalar_Real.f90 b/Sources/Process/Results_Mod/Save_Vtu_Scalar_Real.f90 similarity index 86% rename from Sources/Process/Results_Mod/Save_Scalar_Real.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Scalar_Real.f90 index 314696249..b85bd8e67 100644 --- a/Sources/Process/Results_Mod/Save_Scalar_Real.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Scalar_Real.f90 @@ -1,8 +1,8 @@ !==============================================================================! - subroutine Save_Scalar_Real(Results, & - var_name, plot_inside, & - val, fs, fp, & - data_offset, sweep) + subroutine Save_Vtu_Scalar_Real(Results, & + var_name, plot_inside, & + val, fs, fp, & + data_offset, sweep) !------------------------------------------------------------------------------! ! Writes one real scalar defined over cells. ! !------------------------------------------------------------------------------! @@ -19,6 +19,8 @@ subroutine Save_Scalar_Real(Results, & integer(SP) :: data_size integer :: c1, c2, c_f, c_l character(SL) :: str1 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Results) !==============================================================================! ! Set precision for plotting (intp and floatp variables) @@ -31,7 +33,7 @@ subroutine Save_Scalar_Real(Results, & ! Header if(sweep .eq. 1) then - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(fs) IN_4 // & '' // LF diff --git a/Sources/Process/Results_Mod/Save_Surf.f90 b/Sources/Process/Results_Mod/Save_Vtu_Surf.f90 similarity index 79% rename from Sources/Process/Results_Mod/Save_Surf.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Surf.f90 index 5eb8603f0..8197cc488 100644 --- a/Sources/Process/Results_Mod/Save_Surf.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Surf.f90 @@ -1,32 +1,25 @@ !==============================================================================! - subroutine Save_Surf(Results, surf, time_step) + subroutine Save_Vtu_Surf(Results, Surf) !------------------------------------------------------------------------------! ! Writes surface vertices in VTU file format (for VisIt and Paraview) ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! - class(Results_Type) :: Results - type(Surf_Type), target :: surf - integer :: time_step + class(Results_Type), intent(in) :: Results + type(Surf_Type), target, intent(in) :: Surf !----------------------------------[Locals]------------------------------------! type(Vert_Type), pointer :: Vert integer :: v, e ! vertex and element counters integer :: offset, fu character(SL) :: name_out -!-----------------------------[Local parameters]-------------------------------! - integer, parameter :: VTK_TRIANGLE = 5 ! cell shapes in VTK format - character(len= 0) :: IN_0 = '' ! indentation levels - character(len= 2) :: IN_1 = ' ' - character(len= 4) :: IN_2 = ' ' - character(len= 6) :: IN_3 = ' ' - character(len= 8) :: IN_4 = ' ' - character(len=10) :: IN_5 = ' ' +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Results) !==============================================================================! ! Set precision for plotting (intp and floatp variables) call Vtk_Mod_Set_Precision() - if(surf % n_verts < 1) return + if(Surf % n_verts < 1) return !---------------------------! ! ! @@ -34,11 +27,11 @@ subroutine Save_Surf(Results, surf, time_step) ! ! !---------------------------! - if(this_proc < 2) then + if(First_Proc()) then - call File % Set_Name(name_out, & - time_step = time_step, & - appendix = '-surf', & + call File % Set_Name(name_out, & + time_step = Time % Curr_Dt(), & + appendix = '-surf', & extension = '.vtu') call File % Open_For_Writing_Ascii(name_out, fu) @@ -54,8 +47,8 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_1, '' write(fu,'(a,a,i0.0,a,i0.0,a)') & - IN_2, '' + IN_2, '' !------------------------! ! ! @@ -66,8 +59,8 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' - do v = 1, surf % n_verts - Vert => surf % Vert(v) + do v = 1, Surf % n_verts + Vert => Surf % Vert(v) write(fu, '(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & IN_5, Vert % x_n, Vert % y_n, Vert % z_n end do @@ -87,7 +80,7 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' - do v = 1, surf % n_verts + do v = 1, Surf % n_verts write(fu,'(a,i9)') IN_5, v end do write(fu,'(a,a)') IN_4, '' @@ -98,8 +91,8 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' - do v = 1, surf % n_verts - write(fu,'(a,i9)') IN_5, surf % Vert(v) % nne + do v = 1, Surf % n_verts + write(fu,'(a,i9)') IN_5, Surf % Vert(v) % nne end do write(fu,'(a,a)') IN_4, '' @@ -109,8 +102,8 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' - do v = 1, surf % n_verts - Vert => surf % Vert(v) + do v = 1, Surf % n_verts + Vert => Surf % Vert(v) write(fu,'(a,1pe16.6e4)') IN_5, Vert % curv end do write(fu,'(a,a)') IN_4, '' @@ -127,12 +120,12 @@ subroutine Save_Surf(Results, surf, time_step) ' Name="connectivity"' // & ' format="ascii">' ! Cell topology - do e = 1, surf % n_elems + do e = 1, Surf % n_elems write(fu,'(a,3i9)') & IN_5, & - surf % elem(e) % v(1)-1, & - surf % elem(e) % v(2)-1, & - surf % elem(e) % v(3)-1 + Surf % Elem(e) % v(1)-1, & + Surf % Elem(e) % v(2)-1, & + Surf % Elem(e) % v(3)-1 end do ! Cell offsets @@ -140,7 +133,7 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' offset = 0 - do e = 1, surf % n_elems + do e = 1, Surf % n_elems offset = offset + 3 write(fu,'(a,i9)') IN_5, offset end do @@ -149,7 +142,7 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' write(fu,'(a,a)') IN_4, '' - do e = 1, surf % n_elems + do e = 1, Surf % n_elems write(fu,'(a,i9)') IN_5, VTK_TRIANGLE end do write(fu,'(a,a)') IN_4, '' @@ -170,8 +163,8 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(a,a)') IN_4, '' - do e = 1, surf % n_elems - write(fu,'(a,i9)') IN_5, surf % elem(e) % nne + do e = 1, Surf % n_elems + write(fu,'(a,i9)') IN_5, Surf % Elem(e) % nne end do write(fu,'(a,a)') IN_4, '' @@ -181,9 +174,9 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(4a)') IN_4, & '' - do e = 1, surf % n_elems + do e = 1, Surf % n_elems write(fu,'(a,1pe16.6e4,1pe16.6e4,1pe16.6e4)') & - IN_5, surf % elem(e) % nx, surf % elem(e) % ny, surf % elem(e) % nz + IN_5, Surf % Elem(e) % nx, Surf % Elem(e) % ny, Surf % Elem(e) % nz end do write(fu,'(a,a)') IN_4, '' @@ -193,8 +186,8 @@ subroutine Save_Surf(Results, surf, time_step) write(fu,'(4a)') IN_4, & '' - do e = 1, surf % n_elems - write(fu,'(a,1pe16.6e4)') IN_5, surf % elem(e) % curv + do e = 1, Surf % n_elems + write(fu,'(a,1pe16.6e4)') IN_5, Surf % Elem(e) % curv end do write(fu,'(a,a)') IN_4, '' diff --git a/Sources/Process/Results_Mod/Save_Swarm.f90 b/Sources/Process/Results_Mod/Save_Vtu_Swarm.f90 similarity index 92% rename from Sources/Process/Results_Mod/Save_Swarm.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Swarm.f90 index e0d66b8fc..dc4f6f4fb 100644 --- a/Sources/Process/Results_Mod/Save_Swarm.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Swarm.f90 @@ -1,14 +1,13 @@ !==============================================================================! - subroutine Save_Swarm(Results, Swarm, time_step, domain) + subroutine Save_Vtu_Swarm(Results, Swarm, domain) !------------------------------------------------------------------------------! ! Writes particles in VTU file format (for VisIt and Paraview) ! !------------------------------------------------------------------------------! implicit none !--------------------------------[Arguments]-----------------------------------! - class(Results_Type) :: Results - type(Swarm_Type), target :: Swarm - integer :: time_step - integer, optional :: domain + class(Results_Type), intent(in) :: Results + type(Swarm_Type), target :: Swarm + integer, optional, intent(in) :: domain !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow @@ -16,13 +15,8 @@ subroutine Save_Swarm(Results, Swarm, time_step, domain) integer :: k, fu character(SL) :: name_out integer :: n_remaining_particles -!-----------------------------[Local parameters]-------------------------------! - character(len= 0) :: IN_0 = '' ! indentation levels - character(len= 2) :: IN_1 = ' ' - character(len= 4) :: IN_2 = ' ' - character(len= 6) :: IN_3 = ' ' - character(len= 8) :: IN_4 = ' ' - character(len=10) :: IN_5 = ' ' +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Results) !==============================================================================! if(Swarm % n_particles < 1) return @@ -52,7 +46,7 @@ subroutine Save_Swarm(Results, Swarm, time_step, domain) end do if(n_remaining_particles .eq. 0) then - if(this_proc < 2) then + if(First_Proc()) then print *, '# No particles remaining in the domain, nothing to save!' end if return @@ -64,13 +58,13 @@ subroutine Save_Swarm(Results, Swarm, time_step, domain) ! ! !----------------------------! - if(this_proc < 2) then + if(First_Proc()) then - call File % Set_Name(name_out, & - time_step=time_step, & - appendix ='-swarm', & - extension='.vtu', & - domain=domain) + call File % Set_Name(name_out, & + time_step = Time % Curr_Dt(), & + appendix = '-swarm', & + extension = '.vtu', & + domain = domain) call File % Open_For_Writing_Ascii(name_out, fu) !------------! diff --git a/Sources/Process/Results_Mod/Save_Tensor_6_Real.f90 b/Sources/Process/Results_Mod/Save_Vtu_Tensor_6_Real.f90 similarity index 84% rename from Sources/Process/Results_Mod/Save_Tensor_6_Real.f90 rename to Sources/Process/Results_Mod/Save_Vtu_Tensor_6_Real.f90 index ea18da02f..e2281e991 100644 --- a/Sources/Process/Results_Mod/Save_Tensor_6_Real.f90 +++ b/Sources/Process/Results_Mod/Save_Vtu_Tensor_6_Real.f90 @@ -1,10 +1,10 @@ !==============================================================================! - subroutine Save_Tensor_6_Real(Results, & - var_name, plot_inside, & - val_11, val_22, val_33, & - val_12, val_13, val_23, & - fs, fp, & - data_offset, sweep) + subroutine Save_Vtu_Tensor_6_Real(Results, & + var_name, plot_inside, & + val_11, val_22, val_33, & + val_12, val_13, val_23, & + fs, fp, & + data_offset, sweep) !------------------------------------------------------------------------------! ! Writes one real symmetric tensor defined over cells. ! !------------------------------------------------------------------------------! @@ -22,6 +22,8 @@ subroutine Save_Tensor_6_Real(Results, & integer(SP) :: data_size integer :: c1, c2, c_f, c_l character(SL) :: str1 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Results) !==============================================================================! ! Set precision for plotting (intp and floatp variables) @@ -34,7 +36,7 @@ subroutine Save_Tensor_6_Real(Results, & ! Header if(sweep .eq. 1) then - if(n_proc > 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(fs) IN_4 // & ' 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(fs) IN_4 // & ' 1 .and. this_proc .eq. 1) then + if(Parallel_Run() .and. First_Proc()) then write(fs) IN_4 // & - '' // LF end if diff --git a/Sources/Process/Results_Mod/Time_To_Save.f90 b/Sources/Process/Results_Mod/Time_To_Save_Results.f90 similarity index 61% rename from Sources/Process/Results_Mod/Time_To_Save.f90 rename to Sources/Process/Results_Mod/Time_To_Save_Results.f90 index 3a466b07e..0af63c7a6 100644 --- a/Sources/Process/Results_Mod/Time_To_Save.f90 +++ b/Sources/Process/Results_Mod/Time_To_Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - logical function Time_To_Save(Results, curr_dt) + logical function Time_To_Save_Results(Results) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -7,8 +7,8 @@ logical function Time_To_Save(Results, curr_dt) integer :: curr_dt ! current time step !==============================================================================! - Time_To_Save = mod(curr_dt, Results % interval) .eq. 0 & - .or. & - curr_dt .eq. 0 .and. Results % initial + Time_To_Save_Results = mod(Time % Curr_Dt(), Results % interval) .eq. 0 & + .or. & + Time % Curr_Dt() .eq. 0 .and. Results % initial end function diff --git a/Sources/Process/Results_Mod/Time_To_Save_Swarm.f90 b/Sources/Process/Results_Mod/Time_To_Save_Swarm.f90 index e0387e928..bac3a3952 100644 --- a/Sources/Process/Results_Mod/Time_To_Save_Swarm.f90 +++ b/Sources/Process/Results_Mod/Time_To_Save_Swarm.f90 @@ -1,14 +1,14 @@ !==============================================================================! - logical function Time_To_Save_Swarm(Results, curr_dt) + logical function Time_To_Save_Swarm(Results) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! class(Results_Type) :: Results - integer :: curr_dt ! current time step !==============================================================================! - Time_To_Save_Swarm = mod(curr_dt, Results % interval_swarm) .eq. 0 & - .or. & - curr_dt .eq. 0 .and. Results % initial + Time_To_Save_Swarm = mod(Time % Curr_Dt(), & + Results % interval_swarm) .eq. 0 & + .or. & + Time % Curr_Dt() .eq. 0 .and. Results % initial end function diff --git a/Sources/Process/Solver_Mod.f90 b/Sources/Process/Solver_Mod.f90 index 20de990ec..1c53732c6 100644 --- a/Sources/Process/Solver_Mod.f90 +++ b/Sources/Process/Solver_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Unused.h90" + !==============================================================================! module Solver_Mod !------------------------------------------------------------------------------! diff --git a/Sources/Process/Solver_Mod/End.f90 b/Sources/Process/Solver_Mod/End.f90 index 502f29243..89aabfea8 100644 --- a/Sources/Process/Solver_Mod/End.f90 +++ b/Sources/Process/Solver_Mod/End.f90 @@ -6,6 +6,8 @@ subroutine End(Sol) implicit none !---------------------------------[Arguments]----------------------------------! class(Solver_Type) :: Sol +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Sol) !==============================================================================! ! Call linear solver to solve the equations diff --git a/Sources/Process/Solver_Mod/Linear_Solvers_Code.f90 b/Sources/Process/Solver_Mod/Linear_Solvers_Code.f90 index 0a6ed2763..64c4c229c 100644 --- a/Sources/Process/Solver_Mod/Linear_Solvers_Code.f90 +++ b/Sources/Process/Solver_Mod/Linear_Solvers_Code.f90 @@ -15,14 +15,12 @@ integer function Solver_Mod_Linear_Solvers_Code(name) Solver_Mod_Linear_Solvers_Code = PETSC case default - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solvers option: ', & - trim(name) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(80, 'Unknown linear solver option: '//trim(name)// & + '. This error is critical, exiting! ' // & + 'Check the file: Documents/all_control' // & + '_keywords to see which linear solvers are '// & + 'available. Probably just native and petsc.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end select end function diff --git a/Sources/Process/Solver_Mod/Remove_Singular.f90 b/Sources/Process/Solver_Mod/Remove_Singular.f90 index 1ba68fe9b..9b947c1c7 100644 --- a/Sources/Process/Solver_Mod/Remove_Singular.f90 +++ b/Sources/Process/Solver_Mod/Remove_Singular.f90 @@ -5,6 +5,8 @@ subroutine Remove_Singular(Sol, A) !---------------------------------[Arguments]----------------------------------! class(Solver_Type) :: Sol type(Matrix_Type) :: A +!------------------------[Avoid unused parent warning]-------------------------! + Unused(A) !==============================================================================! ! Remove singularity information for PETSc diff --git a/Sources/Process/Surf_Mod.f90 b/Sources/Process/Surf_Mod.f90 index 24e4d6003..7e1a2d826 100644 --- a/Sources/Process/Surf_Mod.f90 +++ b/Sources/Process/Surf_Mod.f90 @@ -23,21 +23,21 @@ module Surf_Mod contains - procedure :: Advance_Vertices - procedure :: Allocate_Surf - procedure :: Calculate_Curvatures_From_Edges - procedure :: Calculate_Curvatures_From_Elems - procedure :: Calculate_Curvatures_From_Verts - procedure :: Compress_Surf_Vertices - procedure :: Find_Boundaries - procedure :: Find_Surf_Elements - procedure :: Handle_3_Points - procedure :: Handle_4_Points - procedure :: Handle_5_Points - procedure :: Handle_6_Points - procedure :: Improve_Mesh_Quality - procedure :: Initialize_Surf - procedure :: Place_Surf_At_Value + procedure :: Advance_Vertices + procedure :: Allocate_Surf + procedure :: Calculate_Curvatures_From_Edges + procedure :: Calculate_Curvatures_From_Elems + procedure :: Calculate_Curvatures_From_Verts + procedure :: Compress_Surf_Vertices + procedure :: Find_Boundaries + procedure :: Find_Surf_Elements + procedure :: Handle_3_Points + procedure :: Handle_4_Points + procedure :: Handle_5_Points + procedure :: Handle_6_Points + procedure :: Improve_Mesh_Quality + procedure :: Initialize_Surf + procedure :: Place_Surf_At_Value procedure, private :: Distribute_Mesh procedure, private :: Distribute_Smooth procedure, private :: Distribute_Cell_Coords diff --git a/Sources/Process/Surf_Mod/Check_Side.f90 b/Sources/Process/Surf_Mod/Check_Side.f90 index 8a862ff34..f865ce0b0 100644 --- a/Sources/Process/Surf_Mod/Check_Side.f90 +++ b/Sources/Process/Surf_Mod/Check_Side.f90 @@ -10,26 +10,26 @@ subroutine Check_Side(Surf, s) integer :: s !-----------------------------------[Locals]-----------------------------------! type(Side_Type), pointer :: side - type(Elem_Type), pointer :: elem(:) + type(Elem_Type), pointer :: Elem(:) integer :: a, b, c, d integer :: i_a, j_a, k_a, i_b, j_b, k_b, sum_a, sum_b !==============================================================================! side => Surf % side(s) - elem => Surf % elem + Elem => Surf % Elem a = side % a b = side % b c = side % c d = side % d - i_a = elem(side % ea) % v(1) - j_a = elem(side % ea) % v(2) - k_a = elem(side % ea) % v(3) + i_a = Elem(side % ea) % v(1) + j_a = Elem(side % ea) % v(2) + k_a = Elem(side % ea) % v(3) - i_b = elem(side % eb) % v(1) - j_b = elem(side % eb) % v(2) - k_b = elem(side % eb) % v(3) + i_b = Elem(side % eb) % v(1) + j_b = Elem(side % eb) % v(2) + k_b = Elem(side % eb) % v(3) sum_a = i_a + j_a + k_a - c - d - a sum_b = i_b + j_b + k_b - c - d - b diff --git a/Sources/Process/Surf_Mod/Compress_Surf_Vertices.f90 b/Sources/Process/Surf_Mod/Compress_Surf_Vertices.f90 index eec8f456a..402fd75bf 100644 --- a/Sources/Process/Surf_Mod/Compress_Surf_Vertices.f90 +++ b/Sources/Process/Surf_Mod/Compress_Surf_Vertices.f90 @@ -107,9 +107,9 @@ subroutine Compress_Surf_Vertices(Surf, verbose) nv = n_vert nv_tot = n_vert if(Surf % mesh_divided) then - call Comm_Mod_Global_Sum_Int(nv_tot) + call Global % Sum_Int(nv_tot) end if - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(a40,i8)', ' # Compressed number of vertices: ', nv_tot end if diff --git a/Sources/Process/Surf_Mod/Distribute_Cell_Coords.f90 b/Sources/Process/Surf_Mod/Distribute_Cell_Coords.f90 index c6ba2b2ab..4a77f79f7 100644 --- a/Sources/Process/Surf_Mod/Distribute_Cell_Coords.f90 +++ b/Sources/Process/Surf_Mod/Distribute_Cell_Coords.f90 @@ -16,7 +16,7 @@ subroutine Distribute_Cell_Coords(Surf) Vert => Surf % Vert nv => Surf % n_verts - if(n_proc < 2) then + if(Sequential_Run()) then do v = 1, nv c = Surf % Vert(v) % cell ! get nearest cell Surf % Vert(v) % cell_x = Grid % xc(c) @@ -33,7 +33,7 @@ subroutine Distribute_Cell_Coords(Surf) c = Surf % Vert(v) % cell ! get nearest cell if(c > 0) then ! if cell is in this processor - if(Grid % Comm % cell_proc(c) .eq. this_proc) then + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then Surf % buff_x(v) = Grid % xc(c) Surf % buff_y(v) = Grid % yc(c) Surf % buff_z(v) = Grid % zc(c) @@ -43,10 +43,10 @@ subroutine Distribute_Cell_Coords(Surf) end do - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_x) - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_y) - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_z) - call Comm_Mod_Global_Sum_Int_Array (nv, Surf % buff_n) + call Global % Sum_Real_Array(nv, Surf % buff_x) + call Global % Sum_Real_Array(nv, Surf % buff_y) + call Global % Sum_Real_Array(nv, Surf % buff_z) + call Global % Sum_Int_Array (nv, Surf % buff_n) do v = 1, nv Surf % Vert(v) % cell_x = Surf % buff_x(v) / Surf % buff_n(v) diff --git a/Sources/Process/Surf_Mod/Distribute_Mesh.f90 b/Sources/Process/Surf_Mod/Distribute_Mesh.f90 index 09dd9da80..ee322757d 100644 --- a/Sources/Process/Surf_Mod/Distribute_Mesh.f90 +++ b/Sources/Process/Surf_Mod/Distribute_Mesh.f90 @@ -42,20 +42,20 @@ subroutine Distribute_Mesh(Surf, verbose) !------------------------------------------------------------! ! Estimate number of vertices and elements per processor ! !------------------------------------------------------------! - allocate(nv_proc(n_proc)); nv_proc(:) = 0 - allocate(ne_proc(n_proc)); ne_proc(:) = 0 + allocate(nv_proc(N_Procs())); nv_proc(:) = 0 + allocate(ne_proc(N_Procs())); ne_proc(:) = 0 - nv_proc(this_proc) = nv - ne_proc(this_proc) = ne + nv_proc(This_Proc()) = nv + ne_proc(This_Proc()) = ne - call Comm_Mod_Global_Sum_Int_Array(n_proc, nv_proc) - call Comm_Mod_Global_Sum_Int_Array(n_proc, ne_proc) + call Global % Sum_Int_Array(N_Procs(), nv_proc) + call Global % Sum_Int_Array(N_Procs(), ne_proc) - nv_tot = sum(nv_proc(1:n_proc)) - ne_tot = sum(ne_proc(1:n_proc)) + nv_tot = sum(nv_proc(1:N_Procs())) + ne_tot = sum(ne_proc(1:N_Procs())) if(verbose) then - if(this_proc < 2) then + if(First_Proc()) then print '(a40,i8)', ' # Cummulative number of elements found:', ne_tot print '(a40,i8)', ' # Cummulative number of vertices found:', nv_tot end if @@ -67,8 +67,8 @@ subroutine Distribute_Mesh(Surf, verbose) n_acc_vert = 0 ! accumulated nodes n_acc_elem = 0 ! accumulated nodes - n_acc_vert = sum(nv_proc(1:this_proc-1)) - n_acc_elem = sum(ne_proc(1:this_proc-1)) + n_acc_vert = sum(nv_proc(1:This_Proc()-1)) + n_acc_elem = sum(ne_proc(1:This_Proc()-1)) ! PRINT *, 'N_ACC_VERT', THIS_PROC, N_ACC_VERT ! PRINT *, 'N_ACC_ELEM', THIS_PROC, N_ACC_ELEM @@ -95,15 +95,15 @@ subroutine Distribute_Mesh(Surf, verbose) end do ! Summ the buffer arrays for coordinates up - call Comm_Mod_Global_Sum_Real_Array(nv_tot, Surf % buff_x) - call Comm_Mod_Global_Sum_Real_Array(nv_tot, Surf % buff_y) - call Comm_Mod_Global_Sum_Real_Array(nv_tot, Surf % buff_z) + call Global % Sum_Real_Array(nv_tot, Surf % buff_x) + call Global % Sum_Real_Array(nv_tot, Surf % buff_y) + call Global % Sum_Real_Array(nv_tot, Surf % buff_z) ! Summ the buffer arrays for elements' vertices up - call Comm_Mod_Global_Sum_Int_Array(ne_tot, Surf % buff_i) - call Comm_Mod_Global_Sum_Int_Array(ne_tot, Surf % buff_j) - call Comm_Mod_Global_Sum_Int_Array(ne_tot, Surf % buff_k) - call Comm_Mod_Global_Sum_Int_Array(ne_tot, Surf % buff_n) + call Global % Sum_Int_Array(ne_tot, Surf % buff_i) + call Global % Sum_Int_Array(ne_tot, Surf % buff_j) + call Global % Sum_Int_Array(ne_tot, Surf % buff_k) + call Global % Sum_Int_Array(ne_tot, Surf % buff_n) ! Fetch coordinates from all vertices do j = 1, nv_tot diff --git a/Sources/Process/Surf_Mod/Distribute_Smooth.f90 b/Sources/Process/Surf_Mod/Distribute_Smooth.f90 index 91387c25a..3af46a5dc 100644 --- a/Sources/Process/Surf_Mod/Distribute_Smooth.f90 +++ b/Sources/Process/Surf_Mod/Distribute_Smooth.f90 @@ -17,7 +17,7 @@ subroutine Distribute_Smooth(Surf, smooth) Vert => Surf % Vert nv => Surf % n_verts - if(n_proc < 2) then + if(Sequential_Run()) then do v = 1, nv c = Surf % Vert(v) % cell ! get nearest cell Surf % Vert(v) % smooth = smooth % n(c) @@ -36,7 +36,7 @@ subroutine Distribute_Smooth(Surf, smooth) c = Surf % Vert(v) % cell ! get nearest cell if(c > 0) then ! if cell is in this processor - if(Grid % Comm % cell_proc(c) .eq. this_proc) then + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then Surf % buff_v(v) = smooth % n(c) Surf % buff_x(v) = smooth % x(c) Surf % buff_y(v) = smooth % y(c) @@ -47,11 +47,11 @@ subroutine Distribute_Smooth(Surf, smooth) end do - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_v) - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_x) - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_y) - call Comm_Mod_Global_Sum_Real_Array(nv, Surf % buff_z) - call Comm_Mod_Global_Sum_Int_Array (nv, Surf % buff_n) + call Global % Sum_Real_Array(nv, Surf % buff_v) + call Global % Sum_Real_Array(nv, Surf % buff_x) + call Global % Sum_Real_Array(nv, Surf % buff_y) + call Global % Sum_Real_Array(nv, Surf % buff_z) + call Global % Sum_Int_Array (nv, Surf % buff_n) do v = 1, nv Surf % Vert(v) % smooth = Surf % buff_v(v) / Surf % buff_n(v) diff --git a/Sources/Process/Surf_Mod/Handle_4_Points.f90 b/Sources/Process/Surf_Mod/Handle_4_Points.f90 index a4e67a2b6..893459942 100644 --- a/Sources/Process/Surf_Mod/Handle_4_Points.f90 +++ b/Sources/Process/Surf_Mod/Handle_4_Points.f90 @@ -65,10 +65,10 @@ subroutine Handle_4_Points(Surf, surf_v, enforce_triangles) end do - print *, '# ERROR: Failed to find a good permutation in Handle_4_Points!' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + call Message % Error(72, & + 'Failed to find a good permutation in Handle_4_Points! '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) !--------------------------------------------------------------------! ! You've found a permutation which works, store new elements now ! diff --git a/Sources/Process/Surf_Mod/Handle_5_Points.f90 b/Sources/Process/Surf_Mod/Handle_5_Points.f90 index a5c517eb8..eb3f0600a 100644 --- a/Sources/Process/Surf_Mod/Handle_5_Points.f90 +++ b/Sources/Process/Surf_Mod/Handle_5_Points.f90 @@ -90,10 +90,10 @@ subroutine Handle_5_Points(Surf, surf_v, enforce_triangles) end do - print *, '# ERROR: Failed to find a good permutation in Handle_5_Points!' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + call Message % Error(72, & + 'Failed to find a good permutation in Handle_5_Points! '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) !--------------------------------------------------------------------! ! You've found a permutation which works, store new elements now ! diff --git a/Sources/Process/Surf_Mod/Handle_6_Points.f90 b/Sources/Process/Surf_Mod/Handle_6_Points.f90 index c5bb2495e..10ac05019 100644 --- a/Sources/Process/Surf_Mod/Handle_6_Points.f90 +++ b/Sources/Process/Surf_Mod/Handle_6_Points.f90 @@ -194,10 +194,10 @@ subroutine Handle_6_Points(Surf, surf_v, enforce_triangles) end do - print *, '# ERROR: Failed to find a good permutation in Handle_6_Points!' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + call Message % Error(72, & + 'Failed to find a good permutation in Handle_6_Points! '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) !--------------------------------------------------------------------! ! You've found a permutation which works, store new elements now ! diff --git a/Sources/Process/Surf_Mod/Place_Surf_At_Value.f90 b/Sources/Process/Surf_Mod/Place_Surf_At_Value.f90 index 9c863e1e4..e35f58352 100644 --- a/Sources/Process/Surf_Mod/Place_Surf_At_Value.f90 +++ b/Sources/Process/Surf_Mod/Place_Surf_At_Value.f90 @@ -140,7 +140,7 @@ subroutine Place_Surf_At_Value(Surf, sharp, smooth, verbose) ! should be unique since buffer cells are avoided in the loop above ! ! ! !-----------------------------------------------------------------------! - if(n_proc > 1) then + if(Parallel_Run()) then call Surf % Distribute_Mesh(verbose) end if diff --git a/Sources/Process/Swarm_Mod/Advance_Particles.f90 b/Sources/Process/Swarm_Mod/Advance_Particles.f90 index 75bd07fcb..881da009d 100644 --- a/Sources/Process/Swarm_Mod/Advance_Particles.f90 +++ b/Sources/Process/Swarm_Mod/Advance_Particles.f90 @@ -1,12 +1,11 @@ !==============================================================================! - subroutine Swarm_Mod_Advance_Particles(Swarm, n, n_stat_p, first_dt_p) + subroutine Swarm_Mod_Advance_Particles(Swarm, n_stat_p, first_dt_p) !------------------------------------------------------------------------------! ! Advances all particles in the Swarm. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! current time step integer, intent(in) :: n_stat_p ! starting time for swarm statistics integer, intent(in) :: first_dt_p ! starting time for swarm simulation !-----------------------------------[Locals]-----------------------------------! @@ -45,12 +44,12 @@ subroutine Swarm_Mod_Advance_Particles(Swarm, n, n_stat_p, first_dt_p) call Swarm_Mod_Particle_Time_Scale(Swarm) ! Store gradients for modeled Flow quantities for Swarm - call Swarm_Mod_Grad_Modeled_Flow(Swarm, k) + call Swarm_Mod_Grad_Modeled_Flow(Swarm) end if ! Gaussian random no.s interval (for SEIM model) - Swarm % time_eim = n - first_dt_p + Swarm % time_eim = Time % Curr_Dt() - first_dt_p !---------------------------------------------! ! Store old particle coordinates ! @@ -92,7 +91,7 @@ subroutine Swarm_Mod_Advance_Particles(Swarm, n, n_stat_p, first_dt_p) if(.not. deposited .and. .not. escaped .and. .not. trapped) then ! If particle is in this processor, carry on with it - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then ! Compute velocity at the particle, and move it ! (also calls Bounce_Particle) @@ -120,14 +119,14 @@ subroutine Swarm_Mod_Advance_Particles(Swarm, n, n_stat_p, first_dt_p) call Swarm % Check_Periodicity(k, n_parts_in_buffers) ! Gathering Swarm statistics - call Swarm_Mod_Calculate_Mean(Swarm, k, n, n_stat_p, ss) + call Swarm_Mod_Calculate_Mean(Swarm, k, n_stat_p) end if ! in this processor end if ! deposited or escaped end do ! through particles ! Exchange particles for parallel version; if needed - call Comm_Mod_Global_Sum_Int(n_parts_in_buffers) + call Global % Sum_Int(n_parts_in_buffers) if(n_parts_in_buffers > 0) then call Swarm_Mod_Exchange_Particles(Swarm) end if @@ -148,7 +147,7 @@ subroutine Swarm_Mod_Advance_Particles(Swarm, n, n_stat_p, first_dt_p) if(trapped) then ! If particle is in this processor, carry on with it - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then call Swarm % Move_Trapped(k) ! It might have moved to a new cell @@ -162,7 +161,7 @@ subroutine Swarm_Mod_Advance_Particles(Swarm, n, n_stat_p, first_dt_p) end do ! through particles ! Exchange particles for parallel version; if needed - call Comm_Mod_Global_Sum_Int(n_parts_in_buffers) + call Global % Sum_Int(n_parts_in_buffers) if(n_parts_in_buffers > 0) then call Swarm_Mod_Exchange_Particles(Swarm) end if diff --git a/Sources/Process/Swarm_Mod/Allocate_Swarm.f90 b/Sources/Process/Swarm_Mod/Allocate_Swarm.f90 index d9cf4305a..903c15eaa 100644 --- a/Sources/Process/Swarm_Mod/Allocate_Swarm.f90 +++ b/Sources/Process/Swarm_Mod/Allocate_Swarm.f90 @@ -26,14 +26,11 @@ subroutine Allocate_Swarm(Swarm, Flow, Turb, Vof) if(Swarm % max_particles > 0) then allocate(Swarm % Particle(Swarm % max_particles)) else - if(this_proc < 2) then - print *, '# ERROR! You are attempting a simulation with' - print *, '# particles but max number of particles is zero.' - print *, '# Did you set the parameter MAX_PARTICLES in control file?' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop - end if + call Message % Error(72, & + 'You are attempting a simulation with particles, but max '// & + 'number of particles is zero. Did you set the parameter '// & + 'MAX_PARTICLES in control file? This error is critical. '// & + ' Exiting!', file=__FILE__, line=__LINE__, one_proc=.true.) end if ! Allocate logical array if cell holds particles diff --git a/Sources/Process/Swarm_Mod/Bounce_Particle.f90 b/Sources/Process/Swarm_Mod/Bounce_Particle.f90 index 5f2c6da6d..e309d9d82 100644 --- a/Sources/Process/Swarm_Mod/Bounce_Particle.f90 +++ b/Sources/Process/Swarm_Mod/Bounce_Particle.f90 @@ -35,7 +35,7 @@ subroutine Bounce_Particle(Swarm, k) s = Grid % cells_bnd_face(c2) ! index of the closest boundary face end if - ! Debug: write(this_proc*1000+k, '(a,4i7)') & + ! Debug: write(This_Proc()*1000+k, '(a,4i7)') & ! Debug: 'time, part, cell and face: ', n, k, c2, s ! If no boundary cell close, no need to stay here @@ -119,7 +119,7 @@ subroutine Bounce_Particle(Swarm, k) escaped = .true. ! Mark the particle by enlarging it big time Part % d = 1.0e-4 - ! Debug: write(this_proc*1000+k, '(a,2i7,a)') & + ! Debug: write(This_Proc()*1000+k, '(a,2i7,a)') & ! Debug: 'time, part ', n, k, ' is out' end if @@ -222,7 +222,7 @@ subroutine Bounce_Particle(Swarm, k) ! Increasing the number of particle reflections Swarm % n_reflected(c2) = Swarm % n_reflected(c2) + 1 - ! Debug: write(this_proc*1000+k, '(a,2i7, 5(e12.4))') & + ! Debug: write(This_Proc()*1000+k, '(a,2i7, 5(e12.4))') & ! Debug: 'time, part bounced at ', & ! Debug: n, k, & ! Debug: xi, yi, zi, dsc_n, dsc_o diff --git a/Sources/Process/Swarm_Mod/Calculate_Mean.f90 b/Sources/Process/Swarm_Mod/Calculate_Mean.f90 index 9c4bf3b1c..d0776250a 100644 --- a/Sources/Process/Swarm_Mod/Calculate_Mean.f90 +++ b/Sources/Process/Swarm_Mod/Calculate_Mean.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Swarm_Mod_Calculate_Mean(Swarm, k, n, n_stat_p, ss) + subroutine Swarm_Mod_Calculate_Mean(Swarm, k, n_stat_p) !------------------------------------------------------------------------------! ! Calculates particle time averaged velocity ! !------------------------------------------------------------------------------! @@ -7,9 +7,7 @@ subroutine Swarm_Mod_Calculate_Mean(Swarm, k, n, n_stat_p, ss) !---------------------------------[Arguments]----------------------------------! type(Swarm_Type), target :: Swarm integer, intent(in) :: k ! particle index - integer, intent(in) :: n ! current time step (flow time step) integer, intent(in) :: n_stat_p ! starting time step for swarm statist. - integer, intent(in) :: ss ! sub steo !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow @@ -26,7 +24,7 @@ subroutine Swarm_Mod_Calculate_Mean(Swarm, k, n, n_stat_p, ss) Flow => Swarm % pnt_flow Turb => Swarm % pnt_turb - l = n - n_stat_p + l = Time % Curr_Dt() - n_stat_p if(l > -1) then !---------------------------------! diff --git a/Sources/Process/Swarm_Mod/Check_Periodicity.f90 b/Sources/Process/Swarm_Mod/Check_Periodicity.f90 index ace762832..157d551c3 100644 --- a/Sources/Process/Swarm_Mod/Check_Periodicity.f90 +++ b/Sources/Process/Swarm_Mod/Check_Periodicity.f90 @@ -26,7 +26,7 @@ subroutine Check_Periodicity(Swarm, k, n_parts_in_buffers) Swarm % cell_has_particles(:) = .false. ! assume no cells has particles Part => Swarm % Particle(k) - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then Swarm % cell_has_particles(Part % cell) = .true. end if @@ -49,7 +49,7 @@ subroutine Check_Periodicity(Swarm, k, n_parts_in_buffers) Part => Swarm % Particle(k) - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then xc1 = Grid % xc(c1) yc1 = Grid % yc(c1) @@ -105,7 +105,7 @@ subroutine Check_Periodicity(Swarm, k, n_parts_in_buffers) Part => Swarm % Particle(k) - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then ! Take position of c1 at its shadow position xc1 = Grid % xc(c2) - Grid % dx(s) diff --git a/Sources/Process/Swarm_Mod/Exchange_Particles.f90 b/Sources/Process/Swarm_Mod/Exchange_Particles.f90 index 2e0bbe43f..c5e5ae086 100644 --- a/Sources/Process/Swarm_Mod/Exchange_Particles.f90 +++ b/Sources/Process/Swarm_Mod/Exchange_Particles.f90 @@ -21,7 +21,7 @@ subroutine Swarm_Mod_Exchange_Particles(Swarm) ! Exchange particle data between processors ! ! ! !-----------------------------------------------! - if(n_proc > 1) then + if(Parallel_Run()) then Swarm % i_work(:) = 0 Swarm % l_work(:) = .false. @@ -36,7 +36,7 @@ subroutine Swarm_Mod_Exchange_Particles(Swarm) ! Pack data for sending (all processors which ... ! ! ... send will put data in this globall pool) ! !-----------------------------------------------------! - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then i = (k-1) * Swarm % N_I_VARS Swarm % i_work(i + 1) = Part % proc ! where it resides Swarm % i_work(i + 2) = Part % buff ! where it wants to go @@ -73,13 +73,13 @@ subroutine Swarm_Mod_Exchange_Particles(Swarm) !-----------------------! ! Exchange the data ! !-----------------------! - call Comm_Mod_Global_Sum_Int_Array ( & + call Global % Sum_Int_Array ( & Swarm % n_particles * Swarm % N_I_VARS, & Swarm % i_work) - call Comm_Mod_Global_Lor_Log_Array ( & + call Global % Lor_Log_Array ( & Swarm % n_particles * Swarm % N_L_VARS, & Swarm % l_work) - call Comm_Mod_Global_Sum_Real_Array( & + call Global % Sum_Real_Array( & Swarm % n_particles * Swarm % N_R_VARS, & Swarm % r_work) @@ -98,8 +98,8 @@ subroutine Swarm_Mod_Exchange_Particles(Swarm) Part % node = Swarm % i_work(i + 4) ! Particle was not in this processor but wants to enter here - if(Part % proc .ne. this_proc .and. & - Part % buff .eq. this_proc) then + if(Part % proc .ne. This_Proc() .and. & + Part % buff .eq. This_Proc()) then ! Set particle processor to correct value Part % proc = Part % buff @@ -130,7 +130,7 @@ subroutine Swarm_Mod_Exchange_Particles(Swarm) ! Particle was not in this processor and doesn't even want to ... ! ... enter here or particle was in this processor but has left it - else if(Part % buff .ne. this_proc) then + else if(Part % buff .ne. This_Proc()) then Part % proc = Part % buff end if diff --git a/Sources/Process/Swarm_Mod/Grad_Modeled_Flow.f90 b/Sources/Process/Swarm_Mod/Grad_Modeled_Flow.f90 index 17abb7c77..f3143145c 100644 --- a/Sources/Process/Swarm_Mod/Grad_Modeled_Flow.f90 +++ b/Sources/Process/Swarm_Mod/Grad_Modeled_Flow.f90 @@ -1,12 +1,11 @@ !==============================================================================! - subroutine Swarm_Mod_Grad_Modeled_Flow(Swarm, k) + subroutine Swarm_Mod_Grad_Modeled_Flow(Swarm) !------------------------------------------------------------------------------! ! Stores gradients of modeled Flow parameters for swarm SGS models ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! type(Swarm_Type), target :: Swarm - integer :: k !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid diff --git a/Sources/Process/Swarm_Mod/Move_Particle.f90 b/Sources/Process/Swarm_Mod/Move_Particle.f90 index bde18fdc0..f26205729 100644 --- a/Sources/Process/Swarm_Mod/Move_Particle.f90 +++ b/Sources/Process/Swarm_Mod/Move_Particle.f90 @@ -28,7 +28,7 @@ subroutine Move_Particle(Swarm, k) real :: f_fx, f_fy, f_fz ! Brownian force components real :: fd_p ! particle damping funct. real :: v2_mod_xc, v2_mod_yc, v2_mod_zc - real :: u_mod, v_mod, w_mod + real :: w_mod ! , u_mod, v_mod !==============================================================================! ! Take aliases for Flow diff --git a/Sources/Process/Swarm_Mod/Move_Trapped.f90 b/Sources/Process/Swarm_Mod/Move_Trapped.f90 index 8ba62f31d..6cca3b267 100644 --- a/Sources/Process/Swarm_Mod/Move_Trapped.f90 +++ b/Sources/Process/Swarm_Mod/Move_Trapped.f90 @@ -14,9 +14,10 @@ subroutine Move_Trapped(Swarm, k) type(Field_Type), pointer :: Flow type(Particle_Type), pointer :: Part type(Var_Type), pointer :: u, v, w, smooth - integer :: ver, c, n_verts_in_buffers - real :: max_dis, rx, ry, rz, r, u_p, v_p, w_p + integer :: c + real :: max_dis, rx, ry, rz real :: nx, ny, nz, dm, smooth_m, smooth_p +! real :: r, u_p, v_p, w_p !==============================================================================! ! Take aliases diff --git a/Sources/Process/Swarm_Mod/Print_Statistics.f90 b/Sources/Process/Swarm_Mod/Print_Statistics.f90 index 66101fb92..9ddecce5b 100644 --- a/Sources/Process/Swarm_Mod/Print_Statistics.f90 +++ b/Sources/Process/Swarm_Mod/Print_Statistics.f90 @@ -31,7 +31,7 @@ subroutine Swarm_Mod_Print_Statistics(Swarm) max_st = -HUGE do k = 1, Swarm % n_particles Part => Swarm % Particle(k) - if(Part % proc .eq. this_proc) then + if(Part % proc .eq. This_Proc()) then avg_cfl = avg_cfl + Part % cfl avg_re = avg_re + Part % re avg_st = avg_st + Part % st @@ -40,12 +40,12 @@ subroutine Swarm_Mod_Print_Statistics(Swarm) max_st = max(max_st, Part % st) end if end do - call Comm_Mod_Global_Sum_Real(avg_cfl) - call Comm_Mod_Global_Sum_Real(avg_st) - call Comm_Mod_Global_Sum_Real(avg_re) - call Comm_Mod_Global_Max_Real(max_cfl) - call Comm_Mod_Global_Max_Real(max_re) - call Comm_Mod_Global_Max_Real(max_st) + call Global % Sum_Real(avg_cfl) + call Global % Sum_Real(avg_st) + call Global % Sum_Real(avg_re) + call Global % Max_Real(max_cfl) + call Global % Max_Real(max_re) + call Global % Max_Real(max_st) avg_cfl = avg_cfl / real(Swarm % n_particles) avg_re = avg_re / real(Swarm % n_particles) avg_st = avg_st / real(Swarm % n_particles) @@ -54,20 +54,20 @@ subroutine Swarm_Mod_Print_Statistics(Swarm) n_esc = 0 n_ref = 0 do c = -Grid % n_bnd_cells, -1 - if(Grid % Comm % cell_proc(c) .eq. this_proc) then ! avoid buffer cells + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then ! avoid buffer cells n_dep = n_dep + nint(Swarm % n_deposited(c)) n_esc = n_esc + nint(Swarm % n_escaped(c)) n_ref = n_ref + nint(Swarm % n_reflected(c)) end if end do - call Comm_Mod_Global_Sum_Int(n_dep) - call Comm_Mod_Global_Sum_Int(n_esc) - call Comm_Mod_Global_Sum_Int(n_ref) + call Global % Sum_Int(n_dep) + call Global % Sum_Int(n_esc) + call Global % Sum_Int(n_ref) !-----------------------------------! ! Print some data on the screen ! !-----------------------------------! - if(this_proc < 2) then + if(First_Proc()) then line( 1:160) = ' ' line( 1+T:52+T) = ' #================================================#' print '(a)', trim(line) diff --git a/Sources/Process/Swarm_Mod/Sgs_Discrete_Random_Walk.f90 b/Sources/Process/Swarm_Mod/Sgs_Discrete_Random_Walk.f90 index 5e63fe649..08a01a0ee 100644 --- a/Sources/Process/Swarm_Mod/Sgs_Discrete_Random_Walk.f90 +++ b/Sources/Process/Swarm_Mod/Sgs_Discrete_Random_Walk.f90 @@ -159,7 +159,7 @@ subroutine Swarm_Mod_Sgs_Discrete_Random_Walk(Swarm, k, rx, ry, rz) flag3 = .true. end if else - if(this_proc < 2) then + if(First_Proc()) then print *, "# Sigma is not continuous!" end if stop diff --git a/Sources/Process/Time_Mod.f90 b/Sources/Process/Time_Mod.f90 new file mode 100644 index 000000000..2dfcd9e61 --- /dev/null +++ b/Sources/Process/Time_Mod.f90 @@ -0,0 +1,56 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Unused.h90" + +!==============================================================================! + module Time_Mod +!------------------------------------------------------------------------------! +! Module containing data and procedures pertinent to time stepping ! +!------------------------------------------------------------------------------! +!----------------------------------[Modules]-----------------------------------! + use Assert_Mod +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + !---------------! + ! Time type ! + !---------------! + type Time_Type + + real, private :: physical_time ! physical time of simulation [s] + integer, private :: current_time_step ! current dt in this simulation + integer, private :: first_time_step ! first dt in this simulation + integer, private :: last_time_step ! last dt in this simulation + + contains + procedure :: Curr_Dt + procedure :: First_Dt + procedure :: Get_Time + procedure :: Last_Dt + procedure :: Needs_More_Steps + procedure :: Increase_Time + procedure :: Set_Curr_Dt + procedure :: Set_First_Dt + procedure :: Set_Last_Dt + procedure :: Set_Time + + end type + + !----------------------! + ! Singleton object ! + !----------------------! + type(Time_Type) :: Time + + contains +# include "Time_Mod/Curr_Dt.f90" +# include "Time_Mod/First_Dt.f90" +# include "Time_Mod/Get_Time.f90" +# include "Time_Mod/Last_Dt.f90" +# include "Time_Mod/Needs_More_Steps.f90" +# include "Time_Mod/Increase_Time.f90" +# include "Time_Mod/Set_Curr_Dt.f90" +# include "Time_Mod/Set_First_Dt.f90" +# include "Time_Mod/Set_Last_Dt.f90" +# include "Time_Mod/Set_Time.f90" + + end module diff --git a/Sources/Process/Time_Mod/Curr_Dt.f90 b/Sources/Process/Time_Mod/Curr_Dt.f90 new file mode 100644 index 000000000..4077340ca --- /dev/null +++ b/Sources/Process/Time_Mod/Curr_Dt.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure integer function Curr_Dt(Time) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(in) :: Time +!==============================================================================! + + Curr_Dt = Time % current_time_step + + end function diff --git a/Sources/Process/Time_Mod/First_Dt.f90 b/Sources/Process/Time_Mod/First_Dt.f90 new file mode 100644 index 000000000..49f1b2fa8 --- /dev/null +++ b/Sources/Process/Time_Mod/First_Dt.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure integer function First_Dt(Time) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(in) :: Time +!==============================================================================! + + First_Dt = Time % first_time_step + + end function diff --git a/Sources/Process/Time_Mod/Get_Time.f90 b/Sources/Process/Time_Mod/Get_Time.f90 new file mode 100644 index 000000000..da7f0c23b --- /dev/null +++ b/Sources/Process/Time_Mod/Get_Time.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure real function Get_Time(Time) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(in) :: Time +!==============================================================================! + + Get_Time = Time % physical_time + + end function diff --git a/Sources/Process/Time_Mod/Increase_Time.f90 b/Sources/Process/Time_Mod/Increase_Time.f90 new file mode 100644 index 000000000..55e4d1d4f --- /dev/null +++ b/Sources/Process/Time_Mod/Increase_Time.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Increase_Time(Time, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(inout) :: Time + real, intent(in) :: val +!==============================================================================! + + Time % physical_time = Time % physical_time + val + + end subroutine diff --git a/Sources/Process/Time_Mod/Last_Dt.f90 b/Sources/Process/Time_Mod/Last_Dt.f90 new file mode 100644 index 000000000..a4aec8cb6 --- /dev/null +++ b/Sources/Process/Time_Mod/Last_Dt.f90 @@ -0,0 +1,11 @@ +!==============================================================================! + pure integer function Last_Dt(Time) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(in) :: Time +!==============================================================================! + + Last_Dt = Time % last_time_step + + end function diff --git a/Sources/Process/Time_Mod/Needs_More_Steps.f90 b/Sources/Process/Time_Mod/Needs_More_Steps.f90 new file mode 100644 index 000000000..4d02f0a41 --- /dev/null +++ b/Sources/Process/Time_Mod/Needs_More_Steps.f90 @@ -0,0 +1,40 @@ +!==============================================================================! + logical function Needs_More_Steps(Time) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(inout) :: Time +!-----------------------------------[Locals]-----------------------------------! + logical, save :: first_entry = .true. +!==============================================================================! + + !--------------------------------------------! + ! You visit this for the first time, you ! + ! are at the beginning of a simulation ! + !--------------------------------------------! + if(first_entry) then + Time % current_time_step = Time % First_Time_Step + 1 + first_entry = .false. + + !-----------------------------------------! + ! You are not in the first time step, ! + ! increase the time step counter ! + !-----------------------------------------! + else + Time % current_time_step = & + Time % current_time_step + 1 + + end if + + !-------------------------------------------------! + ! Decide if more time steps are needed or not ! + !-------------------------------------------------! + if(Time % current_time_step .gt. Time % last_time_step) then + Needs_More_Steps = .false. + + else + Needs_More_Steps = .true. + + end if + + end function diff --git a/Sources/Process/Time_Mod/Set_Curr_Dt.f90 b/Sources/Process/Time_Mod/Set_Curr_Dt.f90 new file mode 100644 index 000000000..429d130ff --- /dev/null +++ b/Sources/Process/Time_Mod/Set_Curr_Dt.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_Curr_Dt(Time, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(inout) :: Time + integer, intent(in) :: val +!==============================================================================! + + Time % current_time_step = val + + end subroutine diff --git a/Sources/Process/Time_Mod/Set_First_Dt.f90 b/Sources/Process/Time_Mod/Set_First_Dt.f90 new file mode 100644 index 000000000..e0f495666 --- /dev/null +++ b/Sources/Process/Time_Mod/Set_First_Dt.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_First_Dt(Time, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(inout) :: Time + integer, intent(in) :: val +!==============================================================================! + + Time % first_time_step = val + + end subroutine diff --git a/Sources/Process/Time_Mod/Set_Last_Dt.f90 b/Sources/Process/Time_Mod/Set_Last_Dt.f90 new file mode 100644 index 000000000..e41a5b121 --- /dev/null +++ b/Sources/Process/Time_Mod/Set_Last_Dt.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_Last_Dt(Time, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(inout) :: Time + integer, intent(in) :: val +!==============================================================================! + + Time % last_time_step = val + + end subroutine diff --git a/Sources/Process/Time_Mod/Set_Time.f90 b/Sources/Process/Time_Mod/Set_Time.f90 new file mode 100644 index 000000000..22ffc73ad --- /dev/null +++ b/Sources/Process/Time_Mod/Set_Time.f90 @@ -0,0 +1,12 @@ +!==============================================================================! + pure subroutine Set_Time(Time, val) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Time_Type), intent(inout) :: Time + real, intent(in) :: val +!==============================================================================! + + Time % physical_time = val + + end subroutine diff --git a/Sources/Process/Turb_Mod.f90 b/Sources/Process/Turb_Mod.f90 index faab376d3..e9148be8b 100644 --- a/Sources/Process/Turb_Mod.f90 +++ b/Sources/Process/Turb_Mod.f90 @@ -1,3 +1,7 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Turb_Mod !------------------------------------------------------------------------------! @@ -5,6 +9,7 @@ module Turb_Mod !------------------------------------------------------------------------------! !----------------------------------[Modules]-----------------------------------! use Info_Mod + use Iter_Mod !------------------------------------------------------------------------------! implicit none !==============================================================================! @@ -141,6 +146,7 @@ module Turb_Mod procedure :: Alias_Heat_Fluxes procedure :: Alias_Stresses procedure :: Alias_T2 + procedure :: Alias_Vis procedure :: Calculate_Deltas procedure :: Calculate_Heat_Flux @@ -192,6 +198,7 @@ module Turb_Mod procedure, private :: Vis_T_Wale procedure, private :: Vis_T_Tensorial + procedure, private :: Beta_Scalar procedure, private :: Ebf_Momentum procedure, private :: Ebf_Scalar procedure :: Prandtl_Turb @@ -200,7 +207,7 @@ module Turb_Mod procedure :: Tau_Wall_Log_Law procedure :: U_Plus_Log_Law procedure :: Time_And_Length_Scale - procedure :: Roughness_Coefficient + procedure :: Roughness_Coeff procedure :: Les @@ -281,6 +288,7 @@ module Turb_Mod # include "Turb_Mod/Alias_Heat_Fluxes.f90" # include "Turb_Mod/Alias_Stresses.f90" # include "Turb_Mod/Alias_T2.f90" +# include "Turb_Mod/Alias_Vis.f90" # include "Turb_Mod/Calculate_Deltas.f90" # include "Turb_Mod/Calculate_Heat_Flux.f90" @@ -332,6 +340,7 @@ module Turb_Mod # include "Turb_Mod/Vis_T_Tensorial.f90" ! Other subroutines ellipitic blending, turbulent Prandtl number +# include "Turb_Mod/Beta_Scalar.f90" # include "Turb_Mod/Ebf_Momentum.f90" # include "Turb_Mod/Ebf_Scalar.f90" # include "Turb_Mod/Prandtl_Turb.f90" @@ -340,7 +349,7 @@ module Turb_Mod # include "Turb_Mod/Tau_Wall_Log_Law.f90" # include "Turb_Mod/U_Plus_Log_Law.f90" # include "Turb_Mod/Time_And_Length_Scale.f90" -# include "Turb_Mod/Roughness_Coefficient.f90" +# include "Turb_Mod/Roughness_Coeff.f90" # include "Turb_Mod/Les.f90" diff --git a/Sources/Shared/Grid_Mod/Bnd_Cond_Name.f90 b/Sources/Process/Turb_Mod/Alias_Vis.f90 similarity index 61% rename from Sources/Shared/Grid_Mod/Bnd_Cond_Name.f90 rename to Sources/Process/Turb_Mod/Alias_Vis.f90 index 63fe32a3d..79ab4d045 100644 --- a/Sources/Shared/Grid_Mod/Bnd_Cond_Name.f90 +++ b/Sources/Process/Turb_Mod/Alias_Vis.f90 @@ -1,16 +1,14 @@ !==============================================================================! - character(SL) function Bnd_Cond_Name(Grid, bnd_cell) + subroutine Alias_Vis(Turb, vis) !------------------------------------------------------------------------------! -! Provides a shortcut to obtain boundary condition type. ! +! Create alias for t2 variable. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid - integer :: bnd_cell + class(Turb_Type), target :: Turb + type(Var_Type), pointer :: vis !==============================================================================! - Bnd_Cond_Name = & - Grid % bnd_cond % name(Grid % bnd_cond % color(bnd_cell)) - - end function + vis => Turb % vis + end subroutine diff --git a/Sources/Process/Turb_Mod/Beta_Scalar.f90 b/Sources/Process/Turb_Mod/Beta_Scalar.f90 new file mode 100644 index 000000000..b2bb9e7af --- /dev/null +++ b/Sources/Process/Turb_Mod/Beta_Scalar.f90 @@ -0,0 +1,18 @@ +!==============================================================================! + pure real function Beta_Scalar(Turb, coef_l, coef_t) +!------------------------------------------------------------------------------! +! Calculates elliptic blending function for scalars. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Turb_Type), intent(in) :: Turb + real, intent(in) :: coef_l ! laminar Prandtl (or Schmidt) number + real, intent(in) :: coef_t ! turbulent Prandtl (or Schmidt) number +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Turb) +!==============================================================================! + + Beta_Scalar = 9.24 * ((coef_l/coef_t)**0.75 - 1.0) & + * (1.0 + 0.28 * exp(-0.007*coef_l/coef_t)) + + end function diff --git a/Sources/Process/Turb_Mod/Calculate_Deltas.f90 b/Sources/Process/Turb_Mod/Calculate_Deltas.f90 index c0f9ec048..245aa8c1b 100644 --- a/Sources/Process/Turb_Mod/Calculate_Deltas.f90 +++ b/Sources/Process/Turb_Mod/Calculate_Deltas.f90 @@ -30,7 +30,7 @@ subroutine Calculate_Deltas(Turb) h_w_z(-nb:nc)) ! Normalize gradients - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() d = sqrt( h_w_x(c)**2 + h_w_y(c)**2 + h_w_z(c)**2) h_w_x(c) = h_w_x(c) / d h_w_y(c) = h_w_y(c) / d @@ -78,7 +78,7 @@ subroutine Calculate_Deltas(Turb) end do ! Correct h_max and h_min - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() Turb % h_max(c) = Turb % h_max(c) * 2.0 Turb % h_min(c) = Turb % h_min(c) * 2.0 end do diff --git a/Sources/Process/Turb_Mod/Calculate_Heat_Flux.f90 b/Sources/Process/Turb_Mod/Calculate_Heat_Flux.f90 index 96ab5776d..05a2b246f 100644 --- a/Sources/Process/Turb_Mod/Calculate_Heat_Flux.f90 +++ b/Sources/Process/Turb_Mod/Calculate_Heat_Flux.f90 @@ -12,7 +12,7 @@ subroutine Calculate_Heat_Flux(Turb) type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw type(Var_Type), pointer :: t, ut, vt, wt, t2 type(Var_Type), pointer :: u, v, w - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: ut_log_law, vt_log_law, wt_log_law real :: nx, ny, nz, qx, qy, qz, ebf !==============================================================================! @@ -30,43 +30,44 @@ subroutine Calculate_Heat_Flux(Turb) ! ... maybe this call is not needed call Flow % Grad_Variable(t) + ! It used to read pr_t from here, so check it just in case + Assert(pr_t > 0.0) + !-----------------------------------------! + ! ! ! Compute the sources in the interior ! + ! ! !-----------------------------------------! - call Control_Mod_Turbulent_Prandtl_Number(pr_t) !-----------------------------------------------------------! ! By default turbulent heat flux is caalculated by SGDH ! !-----------------------------------------------------------! if(Turb % heat_flux_model .eq. SGDH) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() pr_t = max(Turb % Prandtl_Turb(c), TINY) - ut % n(c) = - Turb % vis_t(c) / Flow % density(c) / pr_t * t % x(c) - vt % n(c) = - Turb % vis_t(c) / Flow % density(c) / pr_t * t % y(c) - wt % n(c) = - Turb % vis_t(c) / Flow % density(c) / pr_t * t % z(c) + ut % n(c) = -Turb % vis_t(c) / Flow % density(c) / pr_t * t % x(c) + vt % n(c) = -Turb % vis_t(c) / Flow % density(c) / pr_t * t % y(c) + wt % n(c) = -Turb % vis_t(c) / Flow % density(c) / pr_t * t % z(c) if(Turb % model .eq. HYBRID_LES_RANS) then - ut % n(c) = - Turb % vis_t_eff(c) / Flow % density(c) & - / pr_t * t % x(c) - vt % n(c) = - Turb % vis_t_eff(c) / Flow % density(c) & - / pr_t * t % y(c) - wt % n(c) = - Turb % vis_t_eff(c) / Flow % density(c) & - / pr_t * t % z(c) + ut % n(c) = -Turb % vis_t_eff(c) / Flow % density(c) / pr_t * t % x(c) + vt % n(c) = -Turb % vis_t_eff(c) / Flow % density(c) / pr_t * t % y(c) + wt % n(c) = -Turb % vis_t_eff(c) / Flow % density(c) / pr_t * t % z(c) end if end do else if(Turb % heat_flux_model .eq. GGDH) then - do c = 1, Grid % n_cells - ut % n(c) = -c_theta * Turb % t_scale(c) * (uu % n(c) * t % x(c) + & - uv % n(c) * t % y(c) + & - uw % n(c) * t % z(c)) - vt % n(c) = -c_theta * Turb % t_scale(c) * (uv % n(c) * t % x(c) + & - vv % n(c) * t % y(c) + & - vw % n(c) * t % z(c)) - wt % n(c) = -c_theta * Turb % t_scale(c) * (uw % n(c) * t % x(c) + & - vw % n(c) * t % y(c) + & - ww % n(c) * t % z(c)) + do c = Cells_In_Domain_And_Buffers() + ut % n(c) = -c_theta * Turb % t_scale(c) * ( uu % n(c) * t % x(c) & + + uv % n(c) * t % y(c) & + + uw % n(c) * t % z(c)) + vt % n(c) = -c_theta * Turb % t_scale(c) * ( uv % n(c) * t % x(c) & + + vv % n(c) * t % y(c) & + + vw % n(c) * t % z(c)) + wt % n(c) = -c_theta * Turb % t_scale(c) * ( uw % n(c) * t % x(c) & + + vw % n(c) * t % y(c) & + + ww % n(c) * t % z(c)) end do else if(Turb % heat_flux_model .eq. AFM) then @@ -74,7 +75,7 @@ subroutine Calculate_Heat_Flux(Turb) call Flow % Grad_Variable(Flow % v) call Flow % Grad_Variable(Flow % w) - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() ut % n(c) = -c_theta * Turb % t_scale(c) & * (( uu % n(c) * t % x(c) & + uv % n(c) * t % y(c) & @@ -104,18 +105,21 @@ subroutine Calculate_Heat_Flux(Turb) end do end if + !--------------------------------------! + ! ! + ! Compute the sources at the walls ! + ! ! + !--------------------------------------! if(Turb % model .eq. K_EPS .or. & Turb % model .eq. K_EPS_ZETA_F .or. & Turb % model .eq. HYBRID_LES_RANS) then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - if(c2 < 0) then - - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) nx = Grid % sx(s) / Grid % s(s) ny = Grid % sy(s) / Grid % s(s) @@ -145,9 +149,10 @@ subroutine Calculate_Heat_Flux(Turb) + vt_log_law * exp(-1.0 / ebf) wt % n(c1) = wt % n(c1) * exp(-1.0 * ebf) & + wt_log_law * exp(-1.0 / ebf) - end if - end if - end do + + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end if end subroutine diff --git a/Sources/Process/Turb_Mod/Calculate_Mean.f90 b/Sources/Process/Turb_Mod/Calculate_Mean.f90 index 91a5a73ec..5a5e3358e 100644 --- a/Sources/Process/Turb_Mod/Calculate_Mean.f90 +++ b/Sources/Process/Turb_Mod/Calculate_Mean.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Calculate_Mean(Turb, n0, n1) + subroutine Calculate_Mean(Turb, n0) !------------------------------------------------------------------------------! ! Calculates time averaged velocity and velocity fluctuations. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! class(Turb_Type), target :: Turb - integer :: n0, n1 + integer, intent(in) :: n0 !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -84,7 +84,7 @@ subroutine Calculate_Mean(Turb, n0, n1) ut_res => Turb % ut_res; vt_res => Turb % vt_res; wt_res => Turb % wt_res t2_res => Turb % t2_res - n = n1 - n0 + n = Time % Curr_Dt() - n0 if(n > -1) then diff --git a/Sources/Process/Turb_Mod/Calculate_Scalar_Flux.f90 b/Sources/Process/Turb_Mod/Calculate_Scalar_Flux.f90 index 63cdda2c6..d5ff49dac 100644 --- a/Sources/Process/Turb_Mod/Calculate_Scalar_Flux.f90 +++ b/Sources/Process/Turb_Mod/Calculate_Scalar_Flux.f90 @@ -13,10 +13,9 @@ subroutine Calculate_Scalar_Flux(Turb, sc) type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw, kin, zeta, eps, f type(Var_Type), pointer :: u, v, w type(Var_Type), pointer :: phi - integer :: c, k, c1, c2, s + integer :: c, k, c1, c2, s, reg real :: uc_log_law, vc_log_law, wc_log_law real :: nx, ny, nz, ebf - real :: uc_new, vc_new, wc_new !==============================================================================! ! Take aliases @@ -31,43 +30,47 @@ subroutine Calculate_Scalar_Flux(Turb, sc) ! ... maybe this call is not needed call Flow % Grad_Variable(phi) + ! It used to read sc_t from here which is an overkill, so check + Assert(sc_t > 0.0) + !-----------------------------------------! + ! ! ! Compute the sources in the interior ! + ! ! !-----------------------------------------! - call Control_Mod_Turbulent_Schmidt_Number(sc_t) !-----------------------------------------! ! First guess is the flux defined by SGDH ! !-----------------------------------------! if(Turb % scalar_flux_model .eq. SGDH) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() - Turb % uc(c) = - Turb % vis_t(c) / Flow % density(c) / sc_t * phi % x(c) - Turb % vc(c) = - Turb % vis_t(c) / Flow % density(c) / sc_t * phi % y(c) - Turb % wc(c) = - Turb % vis_t(c) / Flow % density(c) / sc_t * phi % z(c) + Turb % uc(c) = -Turb % vis_t(c) / Flow % density(c) / sc_t * phi % x(c) + Turb % vc(c) = -Turb % vis_t(c) / Flow % density(c) / sc_t * phi % y(c) + Turb % wc(c) = -Turb % vis_t(c) / Flow % density(c) / sc_t * phi % z(c) if(Turb % model .eq. HYBRID_LES_RANS) then - Turb % uc(c) = - Turb % vis_t_eff(c) / Flow % density(c) & - / sc_t * phi % x(c) - Turb % vc(c) = - Turb % vis_t_eff(c) / Flow % density(c) & - / sc_t * phi % y(c) - Turb % wc(c) = - Turb % vis_t_eff(c) / Flow % density(c) & - / sc_t * phi % z(c) + Turb % uc(c) = -Turb % vis_t_eff(c) / Flow % density(c) & + / sc_t * phi % x(c) + Turb % vc(c) = -Turb % vis_t_eff(c) / Flow % density(c) & + / sc_t * phi % y(c) + Turb % wc(c) = -Turb % vis_t_eff(c) / Flow % density(c) & + / sc_t * phi % z(c) end if end do else if(Turb % scalar_flux_model .eq. GGDH) then - do c = 1, Grid % n_cells - Turb % uc(c) = -c_theta * Turb % t_scale(c) * (uu % n(c) * phi % x(c) + & - uv % n(c) * phi % y(c) + & - uw % n(c) * phi % z(c)) - Turb % vc(c) = -c_theta * Turb % t_scale(c) * (uv % n(c) * phi % x(c) + & - vv % n(c) * phi % y(c) + & - vw % n(c) * phi % z(c)) - Turb % wc(c) = -c_theta * Turb % t_scale(c) * (uw % n(c) * phi % x(c) + & - vw % n(c) * phi % y(c) + & - ww % n(c) * phi % z(c)) + do c = Cells_In_Domain_And_Buffers() + Turb % uc(c) = -c_theta * Turb % t_scale(c) * ( uu % n(c) * phi % x(c) & + + uv % n(c) * phi % y(c) & + + uw % n(c) * phi % z(c)) + Turb % vc(c) = -c_theta * Turb % t_scale(c) * ( uv % n(c) * phi % x(c) & + + vv % n(c) * phi % y(c) & + + vw % n(c) * phi % z(c)) + Turb % wc(c) = -c_theta * Turb % t_scale(c) * ( uw % n(c) * phi % x(c) & + + vw % n(c) * phi % y(c) & + + ww % n(c) * phi % z(c)) end do else if(Turb % scalar_flux_model .eq. AFM) then @@ -75,46 +78,48 @@ subroutine Calculate_Scalar_Flux(Turb, sc) call Flow % Grad_Variable(Flow % v) call Flow % Grad_Variable(Flow % w) do k = 1, 3 - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() - Turb % uc(c) = -c_theta*Turb % t_scale(c) * (( uu % n(c) * phi % x(c) & - + uv % n(c) * phi % y(c) & - + uw % n(c) * phi % z(c)) & - + afm_eta * ( Turb % uc(c) * u % x(c) & - + Turb % vc(c) * u % y(c) & + Turb % uc(c) = -c_theta*Turb % t_scale(c) * (( uu % n(c) * phi % x(c) & + + uv % n(c) * phi % y(c) & + + uw % n(c) * phi % z(c)) & + + afm_eta * ( Turb % uc(c) * u % x(c) & + + Turb % vc(c) * u % y(c) & + Turb % wc(c) * u % z(c))) - - Turb % vc(c) = -c_theta*Turb % t_scale(c) * (( uv % n(c) * phi % x(c) & - + vv % n(c) * phi % y(c) & - + vw % n(c) * phi % z(c)) & - + afm_eta * ( Turb % uc(c) * v % x(c) & - + Turb % vc(c) * v % y(c) & + Turb % vc(c) = -c_theta*Turb % t_scale(c) * (( uv % n(c) * phi % x(c) & + + vv % n(c) * phi % y(c) & + + vw % n(c) * phi % z(c)) & + + afm_eta * ( Turb % uc(c) * v % x(c) & + + Turb % vc(c) * v % y(c) & + Turb % wc(c) * v % z(c))) - Turb % wc(c) = -c_theta*Turb % t_scale(c) * (( uw % n(c) * phi % x(c) & - + vw % n(c) * phi % y(c) & - + ww % n(c) * phi % z(c)) & - + afm_eta * ( Turb % uc(c) * w % x(c) & - + Turb % vc(c) * w % y(c) & + Turb % wc(c) = -c_theta*Turb % t_scale(c) * (( uw % n(c) * phi % x(c) & + + vw % n(c) * phi % y(c) & + + ww % n(c) * phi % z(c)) & + + afm_eta * ( Turb % uc(c) * w % x(c) & + + Turb % vc(c) * w % y(c) & + Turb % wc(c) * w % z(c))) end do - end do - end if - + end do ! browse three times, but why? + end if ! scalar model SGDH, GGDH or AFM + + !--------------------------------------! + ! ! + ! Compute the sources at the walls ! + ! ! + !--------------------------------------! if(Turb % model .eq. K_EPS .or. & Turb % model .eq. K_EPS_ZETA_F .or. & Turb % model .eq. HYBRID_LES_RANS) then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - if(c2 < 0) then - - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) nx = Grid % sx(s) / Grid % s(s) ny = Grid % sy(s) / Grid % s(s) @@ -138,9 +143,9 @@ subroutine Calculate_Scalar_Flux(Turb, sc) + vc_log_law * exp(-1.0 / ebf) Turb % wc(c1) = Turb % wc(c1) * exp(-1.0 * ebf) & + wc_log_law * exp(-1.0 / ebf) - end if - end if - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end if end subroutine diff --git a/Sources/Process/Turb_Mod/Calculate_Stress.f90 b/Sources/Process/Turb_Mod/Calculate_Stress.f90 index e08d52317..644f7ddb4 100644 --- a/Sources/Process/Turb_Mod/Calculate_Stress.f90 +++ b/Sources/Process/Turb_Mod/Calculate_Stress.f90 @@ -13,12 +13,8 @@ subroutine Calculate_Stress(Turb) type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw type(Var_Type), pointer :: kin, eps, zeta, f22 integer :: c, nc, nb - real :: wd_m, u2, v2, w2 - real, contiguous, pointer :: wd_x(:), wd_y(:), wd_z(:) !==============================================================================! - call Work % Connect_Real_Cell(wd_x, wd_y, wd_z) - ! Take aliases Flow => Turb % pnt_flow Grid => Flow % pnt_grid @@ -35,7 +31,7 @@ subroutine Calculate_Stress(Turb) if( Turb % model .eq. K_EPS .or. & Turb % model .eq. K_EPS_ZETA_F) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() uu % n(c) = - 2. * Turb % vis_t(c) / Flow % density(c) & * u % x(c) + TWO_THIRDS * kin % n(c) @@ -52,7 +48,7 @@ subroutine Calculate_Stress(Turb) else if(Turb % model .eq. HYBRID_LES_RANS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() uu % n(c) = - 2. * Turb % vis_t_eff(c) / Flow % density(c) & * u % x(c) + TWO_THIRDS * kin % n(c) @@ -69,7 +65,7 @@ subroutine Calculate_Stress(Turb) if( Turb % model .eq. K_EPS_ZETA_F .or. & Turb % model .eq. HYBRID_LES_RANS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() uu % n(c) = zeta % n(c) * kin % n(c) vv % n(c) = zeta % n(c) * kin % n(c) @@ -78,6 +74,4 @@ subroutine Calculate_Stress(Turb) end do end if - call Work % Disconnect_Real_Cell(wd_x, wd_y, wd_z) - end subroutine diff --git a/Sources/Process/Turb_Mod/Compute_F22.f90 b/Sources/Process/Turb_Mod/Compute_F22.f90 index abd52a046..98b14e24a 100644 --- a/Sources/Process/Turb_Mod/Compute_F22.f90 +++ b/Sources/Process/Turb_Mod/Compute_F22.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) + subroutine Compute_F22(Turb, Sol, phi) !------------------------------------------------------------------------------! ! Discretizes and solves eliptic relaxation equations for f22. ! !------------------------------------------------------------------------------! @@ -7,8 +7,6 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) !--------------------------------[Arguments]-----------------------------------! class(Turb_Type) :: Turb type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini type(Var_Type) :: phi !----------------------------------[Locals]------------------------------------! type(Field_Type), pointer :: Flow @@ -20,7 +18,7 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) real :: a0, a12, a21 real :: phi_x_f, phi_y_f, phi_z_f real, contiguous, pointer :: cross(:) -!==============================================================================! +!------------------------------------------------------------------------------! ! ! ! The form of equations which are solved: ! ! ! @@ -38,7 +36,9 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) ! ! ! f22 [1/s] ! ! Lsc [m] ! -!------------------------------------------------------------------------------! +!==============================================================================! + + call Profiler % Start('Compute_F22 (without solvers)') call Work % Connect_Real_Cell(cross) @@ -53,15 +53,15 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) b (:) = 0.0 ! Old values (o) and older than old (oo) - if(ini .eq. 1) then - do c = 1, Grid % n_cells + if(Iter % Current() .eq. 1) then + do c = Cells_In_Domain_And_Buffers() phi % oo(c) = phi % o(c) phi % o (c) = phi % n(c) end do end if ! New values - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() cross(c) = 0.0 end do @@ -138,7 +138,7 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) end do ! through faces ! Cross diffusion terms are treated explicity - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() b(c) = b(c) + cross(c) end do @@ -162,7 +162,8 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) ! Underrelax the equations call Numerics_Mod_Under_Relax(phi, a, b) - call Profiler % Start('Linear_Solver_For_Turbulence') + call Profiler % Start(String % First_Upper(phi % solver) // & + ' (solver for turbulence)') ! Call linear solver to solve the equations call Sol % Run(phi % solver, & @@ -176,17 +177,20 @@ subroutine Compute_F22(Turb, Sol, curr_dt, ini, phi) phi % tol, & phi % res) - call Profiler % Stop('Linear_Solver_For_Turbulence') + call Profiler % Stop(String % First_Upper(phi % solver) // & + ' (solver for turbulence)') ! Print info on the screen if(Turb % model .eq. K_EPS_ZETA_F) then - call Info_Mod_Iter_Fill_At(3, 4, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 4, phi % name, phi % res, phi % eniter) else if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - call Info_Mod_Iter_Fill_At(4, 2, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(4, 2, phi % name, phi % res, phi % eniter) end if call Flow % Grad_Variable(phi) call Work % Disconnect_Real_Cell(cross) + call Profiler % Stop('Compute_F22 (without solvers)') + end subroutine diff --git a/Sources/Process/Turb_Mod/Compute_Stress.f90 b/Sources/Process/Turb_Mod/Compute_Stress.f90 index 13a8d7e1a..7413c1556 100644 --- a/Sources/Process/Turb_Mod/Compute_Stress.f90 +++ b/Sources/Process/Turb_Mod/Compute_Stress.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) + subroutine Compute_Stress(Turb, Sol, phi) !------------------------------------------------------------------------------! ! Discretizes and solves transport equation for Re stresses for RSM. ! !------------------------------------------------------------------------------! @@ -7,8 +7,6 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) !---------------------------------[Arguments]----------------------------------! class(Turb_Type), target :: Turb type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini type(Var_Type) :: phi !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow @@ -30,7 +28,7 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) real, contiguous, pointer :: phi_x(:), phi_y(:), phi_z(:), cross(:) real, contiguous, pointer :: u1uj_phij(:), u2uj_phij(:), u3uj_phij(:) real, contiguous, pointer :: u1uj_phij_x(:), u2uj_phij_y(:), u3uj_phij_z(:) -!==============================================================================! +!------------------------------------------------------------------------------! ! ! ! The form of equations which are being solved: ! ! ! @@ -40,9 +38,9 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) ! | dt | | sigma | ! ! / / / / ! ! ! -!------------------------------------------------------------------------------! +!==============================================================================! - call Profiler % Start('Compute_Turbulence (without solvers)') + call Profiler % Start('Compute_Stress (without solvers)') call Work % Connect_Real_Cell(phi_x, phi_y, phi_z, cross, & u1uj_phij, u2uj_phij, u3uj_phij, & @@ -67,8 +65,8 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) b (:) = 0.0 ! Old values (o) and older than old (oo) - if(ini .eq. 1) then - do c = 1, Grid % n_cells + if(Iter % Current() .eq. 1) then + do c = Cells_In_Domain_And_Buffers() phi % oo(c) = phi % o(c) phi % o (c) = phi % n(c) end do @@ -181,7 +179,7 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) if(Turb % model_variant .ne. STABILIZED) then if(Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() u1uj_phij(c) = Flow % density(c) * c_mu_d / phi % sigma & * kin % n(c) & / max(eps % n(c), TINY) & @@ -207,7 +205,7 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) - Flow % viscosity(c) * phi_z(c) end do else if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() u1uj_phij(c) = Flow % density(c) * c_mu_d / phi % sigma & * Turb % t_scale(c) & * ( uu % n(c) * phi_x(c) & @@ -232,7 +230,7 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) call Flow % Grad_Component(u2uj_phij(-nb:nc), 2, u2uj_phij_y(-nb:nc)) call Flow % Grad_Component(u3uj_phij(-nb:nc), 3, u3uj_phij_z(-nb:nc)) - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() b(c) = b(c) + ( u1uj_phij_x(c) & + u2uj_phij_y(c) & + u3uj_phij_z(c) ) * Grid % vol(c) @@ -277,7 +275,7 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) ! Source term contains difference between ! ! explicity and implicitly treated advection ! !------------------------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() b(c) = b(c) + cross(c) end do @@ -310,7 +308,8 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) ! Under-relax the equations call Numerics_Mod_Under_Relax(phi, a, b) - call Profiler % Start('Linear_Solver_For_Turbulence') + call Profiler % Start(String % First_Upper(phi % solver) // & + ' (solver for turbulence)') ! Call linear solver to solve the equations call Sol % Run(phi % solver, & @@ -324,23 +323,24 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) phi % tol, & phi % res) - call Profiler % Stop('Linear_Solver_For_Turbulence') + call Profiler % Stop(String % First_Upper(phi % solver) // & + ' (solver for turbulence)') ! Print info on the screen if( phi % name .eq. 'UU' ) & - call Info_Mod_Iter_Fill_At(3, 1, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 1, phi % name, phi % res, phi % eniter) if( phi % name .eq. 'VV' ) & - call Info_Mod_Iter_Fill_At(3, 2, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 2, phi % name, phi % res, phi % eniter) if( phi % name .eq. 'WW' ) & - call Info_Mod_Iter_Fill_At(3, 3, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 3, phi % name, phi % res, phi % eniter) if( phi % name .eq. 'UV' ) & - call Info_Mod_Iter_Fill_At(3, 4, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 4, phi % name, phi % res, phi % eniter) if( phi % name .eq. 'UW' ) & - call Info_Mod_Iter_Fill_At(3, 5, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 5, phi % name, phi % res, phi % eniter) if( phi % name .eq. 'VW' ) & - call Info_Mod_Iter_Fill_At(3, 6, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 6, phi % name, phi % res, phi % eniter) if( phi % name .eq. 'EPS' ) & - call Info_Mod_Iter_Fill_At(4, 1, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(4, 1, phi % name, phi % res, phi % eniter) if(phi % name .eq. 'EPS') then do c= 1, Grid % n_cells @@ -354,7 +354,7 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) if(phi % name .eq. 'UU' .or. & phi % name .eq. 'VV' .or. & phi % name .eq. 'WW') then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() phi % n(c) = phi % n(c) if(phi % n(c) < 0.) then phi % n(c) = phi % o(c) @@ -368,6 +368,6 @@ subroutine Compute_Stress(Turb, Sol, curr_dt, ini, phi) u1uj_phij, u2uj_phij, u3uj_phij, & u1uj_phij_x, u2uj_phij_y, u3uj_phij_z) - call Profiler % Stop('Compute_Turbulence (without solvers)') + call Profiler % Stop('Compute_Stress (without solvers)') end subroutine diff --git a/Sources/Process/Turb_Mod/Compute_Variable.f90 b/Sources/Process/Turb_Mod/Compute_Variable.f90 index 27f0408e0..aedb63120 100644 --- a/Sources/Process/Turb_Mod/Compute_Variable.f90 +++ b/Sources/Process/Turb_Mod/Compute_Variable.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) + subroutine Compute_Variable(Turb, Sol, phi) !------------------------------------------------------------------------------! ! Discretizes and solves transport equations for different turbulent ! ! variables. ! @@ -8,8 +8,6 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) !--------------------------------[Arguments]-----------------------------------! class(Turb_Type), target :: Turb type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini type(Var_Type) :: phi !----------------------------------[Locals]------------------------------------! type(Field_Type), pointer :: Flow @@ -27,7 +25,7 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) real :: dt real :: visc_f, pr_t1, pr_t2, pr_1, pr_2 real, contiguous, pointer :: cross(:) -!==============================================================================! +!------------------------------------------------------------------------------! ! ! ! The form of equations which are solved: ! ! ! @@ -37,9 +35,9 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) ! | dt | | sigma | ! ! / / / / ! ! ! -!------------------------------------------------------------------------------! +!==============================================================================! - call Profiler % Start('Compute_Turbulence (without solvers)') + call Profiler % Start('Compute_Variable (without solvers)') call Work % Connect_Real_Cell(cross) @@ -58,8 +56,8 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) b (:) = 0.0 ! Old values (o) and older than old (oo) - if(ini .eq. 1) then - do c = 1, Grid % n_cells + if(Iter % Current() .eq. 1) then + do c = Cells_In_Domain_And_Buffers() phi % oo(c) = phi % o(c) phi % o (c) = phi % n(c) end do @@ -191,7 +189,7 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) end do ! through faces ! Cross diffusion terms are treated explicity - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() b(c) = b(c) + cross(c) end do @@ -220,7 +218,7 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) if(phi % name .eq. 'KIN') call Turb % Src_Kin_K_Eps_Zeta_F(Sol) if(phi % name .eq. 'EPS') call Turb % Src_Eps_K_Eps_Zeta_F(Sol) if(phi % name .eq. 'ZETA') & - call Turb % Src_Zeta_K_Eps_Zeta_F(Sol, curr_dt) + call Turb % Src_Zeta_K_Eps_Zeta_F(Sol) if(Flow % heat_transfer) then if(phi % name .eq. 'T2') call Turb % Src_T2(Sol) end if @@ -240,7 +238,8 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) ! Under-relax the equations call Numerics_Mod_Under_Relax(phi, A, b) - call Profiler % Start('Linear_Solver_For_Turbulence') + call Profiler % Start(String % First_Upper(phi % solver) // & + ' (solver for turbulence)') ! Call linear solver to solve the equations call Sol % Run(phi % solver, & @@ -254,23 +253,24 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) phi % tol, & phi % res) - call Profiler % Stop('Linear_Solver_For_Turbulence') + call Profiler % Stop(String % First_Upper(phi % solver) // & + ' (solver for turbulence)') ! Avoid negative values for all computed turbulent quantities - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() if( phi % n(c) < 0.0 ) phi % n(c) = phi % o(c) end do ! Set the lower limit of zeta to 1.8 if(phi % name .eq. 'ZETA') then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() phi % n(c) = min(phi % n(c), 1.8) end do end if ! Set the lower limit of epsilon if(phi % name .eq. 'EPS') then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() phi % n(c) = max(phi % n(c), 1.0e-10) end do end if @@ -280,14 +280,14 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) Turb % model .eq. K_EPS_ZETA_F .or. & Turb % model .eq. HYBRID_LES_RANS) then if(phi % name .eq. 'KIN') & - call Info_Mod_Iter_Fill_At(3, 1, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 1, phi % name, phi % res, phi % eniter) if(phi % name .eq. 'EPS') & - call Info_Mod_Iter_Fill_At(3, 2, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 2, phi % name, phi % res, phi % eniter) if(phi % name .eq. 'ZETA') & - call Info_Mod_Iter_Fill_At(3, 3, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 3, phi % name, phi % res, phi % eniter) if(Flow % heat_transfer) then if(phi % name .eq. 'T2') & - call Info_Mod_Iter_Fill_At(3, 5, phi % name, phi % eniter, phi % res) + call Info % Iter_Fill_At(3, 5, phi % name, phi % res, phi % eniter) end if end if @@ -295,6 +295,6 @@ subroutine Compute_Variable(Turb, Sol, curr_dt, ini, phi) call Work % Disconnect_Real_Cell(cross) - call Profiler % Stop('Compute_Turbulence (without solvers)') + call Profiler % Stop('Compute_Variable (without solvers)') end subroutine diff --git a/Sources/Process/Turb_Mod/Const_Les.f90 b/Sources/Process/Turb_Mod/Const_Les.f90 index 9d0b1b559..066892a3d 100644 --- a/Sources/Process/Turb_Mod/Const_Les.f90 +++ b/Sources/Process/Turb_Mod/Const_Les.f90 @@ -6,6 +6,8 @@ subroutine Const_Les(Turb) implicit none !---------------------------------[Arguments]----------------------------------! class(Turb_Type), target :: Turb +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Turb) !==============================================================================! c_mu = 0.09 diff --git a/Sources/Process/Turb_Mod/Ebf_Momentum.f90 b/Sources/Process/Turb_Mod/Ebf_Momentum.f90 index 5b4e8170b..3ee0c1a20 100644 --- a/Sources/Process/Turb_Mod/Ebf_Momentum.f90 +++ b/Sources/Process/Turb_Mod/Ebf_Momentum.f90 @@ -1,12 +1,12 @@ !==============================================================================! - real function Ebf_Momentum(Turb, c) + pure real function Ebf_Momentum(Turb, c) !------------------------------------------------------------------------------! ! Calculates elliptic blending function for momentum. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Turb_Type) :: Turb - integer :: c + class(Turb_Type), intent(in) :: Turb + integer, intent(in) :: c !==============================================================================! Ebf_Momentum = max( 0.01 * Turb % y_plus(c)**4 & diff --git a/Sources/Process/Turb_Mod/Ebf_Scalar.f90 b/Sources/Process/Turb_Mod/Ebf_Scalar.f90 index 86730ebdd..af2620b67 100644 --- a/Sources/Process/Turb_Mod/Ebf_Scalar.f90 +++ b/Sources/Process/Turb_Mod/Ebf_Scalar.f90 @@ -1,13 +1,13 @@ !==============================================================================! - real function Ebf_Scalar(Turb, c, coef) + pure real function Ebf_Scalar(Turb, c, coef) !------------------------------------------------------------------------------! ! Calculates elliptic blending function for scalars. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Turb_Type) :: Turb - integer :: c - real :: coef ! Prandtl number (maybe even Shmidt number) + class(Turb_Type), intent(in) :: Turb + integer, intent(in) :: c + real, intent(in) :: coef ! Prandtl number (Shmidt number) !==============================================================================! Ebf_Scalar = 0.01 * ((coef * Turb % y_plus(c)) ** 4 & diff --git a/Sources/Process/Turb_Mod/Main_Turb.f90 b/Sources/Process/Turb_Mod/Main_Turb.f90 index 53c0f521e..f6ba9ed88 100644 --- a/Sources/Process/Turb_Mod/Main_Turb.f90 +++ b/Sources/Process/Turb_Mod/Main_Turb.f90 @@ -1,14 +1,12 @@ !==============================================================================! - subroutine Main_Turb(Turb, Sol, curr_dt, ini) + subroutine Main_Turb(Turb, Sol) !------------------------------------------------------------------------------! ! Turbulence model main function (called inside inner iterations) ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Turb_Type) :: Turb - type(Solver_Type) :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + class(Turb_Type) :: Turb + type(Solver_Type) :: Sol !----------------------------------[Locals]------------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -38,13 +36,13 @@ subroutine Main_Turb(Turb, Sol, curr_dt, ini) call Calculate_Shear_And_Vorticity(Flow) call Turb % Time_And_Length_Scale(Grid) - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % kin) - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % eps) + call Turb % Compute_Variable(Sol, Turb % kin) + call Turb % Compute_Variable(Sol, Turb % eps) if(Flow % heat_transfer) then call Turb % Calculate_Stress () call Turb % Calculate_Heat_Flux() - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % t2) + call Turb % Compute_Variable(Sol, Turb % t2) end if call Turb % Vis_T_K_Eps() @@ -65,22 +63,22 @@ subroutine Main_Turb(Turb, Sol, curr_dt, ini) call Calculate_Shear_And_Vorticity(Flow) - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % kin) - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % eps) + call Turb % Compute_Variable(Sol, Turb % kin) + call Turb % Compute_Variable(Sol, Turb % eps) if(Flow % heat_transfer) then call Turb % Calculate_Stress () call Turb % Calculate_Heat_Flux() - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % t2) + call Turb % Compute_Variable(Sol, Turb % t2) end if - call Turb % Compute_F22(Sol, curr_dt, ini, Turb % f22) - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % zeta) + call Turb % Compute_F22(Sol, Turb % f22) + call Turb % Compute_Variable(Sol, Turb % zeta) ! For some cases, it is beneficial to start simulations with ! turbulent viscosity computed with k-eps. Particularly for ! cases with mild pressure drops such as channel, pipe flows - if(curr_dt < 10) then + if(Time % Curr_Dt() < 10) then call Turb % Vis_T_K_Eps() else call Turb % Vis_T_K_Eps_Zeta_F() @@ -97,19 +95,19 @@ subroutine Main_Turb(Turb, Sol, curr_dt, ini) call Flow % Grad_Variable(Flow % v) call Flow % Grad_Variable(Flow % w) - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % uu) - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % vv) - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % ww) + call Turb % Compute_Stress(Sol, Turb % uu) + call Turb % Compute_Stress(Sol, Turb % vv) + call Turb % Compute_Stress(Sol, Turb % ww) - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % uv) - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % uw) - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % vw) + call Turb % Compute_Stress(Sol, Turb % uv) + call Turb % Compute_Stress(Sol, Turb % uw) + call Turb % Compute_Stress(Sol, Turb % vw) if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - call Turb % Compute_F22(Sol, curr_dt, ini, Turb % f22) + call Turb % Compute_F22(Sol, Turb % f22) end if - call Turb % Compute_Stress(Sol, curr_dt, ini, Turb % eps) + call Turb % Compute_Stress(Sol, Turb % eps) call Turb % Vis_T_Rsm() @@ -122,7 +120,7 @@ subroutine Main_Turb(Turb, Sol, curr_dt, ini) Turb % model .eq. DES_SPALART) then call Calculate_Shear_And_Vorticity(Flow) - call Turb % Compute_Variable(Sol, curr_dt, ini, Turb % vis) + call Turb % Compute_Variable(Sol, Turb % vis) call Turb % Vis_T_Spalart_Allmaras() end if diff --git a/Sources/Process/Turb_Mod/Roughness_Coefficient.f90 b/Sources/Process/Turb_Mod/Roughness_Coeff.f90 similarity index 92% rename from Sources/Process/Turb_Mod/Roughness_Coefficient.f90 rename to Sources/Process/Turb_Mod/Roughness_Coeff.f90 index f99acf5e2..64df00239 100644 --- a/Sources/Process/Turb_Mod/Roughness_Coefficient.f90 +++ b/Sources/Process/Turb_Mod/Roughness_Coeff.f90 @@ -1,5 +1,5 @@ !==============================================================================! - real function Roughness_Coefficient(Turb, c1, c2) + real function Roughness_Coeff(Turb, c1, c2) !------------------------------------------------------------------------------! ! Set up roughness coefficient ! !------------------------------------------------------------------------------! @@ -21,6 +21,6 @@ real function Roughness_Coefficient(Turb, c1, c2) end if ! Specify the return value - Roughness_Coefficient = z_o + Roughness_Coeff = z_o end function diff --git a/Sources/Process/Turb_Mod/Src_Eps_K_Eps.f90 b/Sources/Process/Turb_Mod/Src_Eps_K_Eps.f90 index ba7b14c4f..993abbb1a 100644 --- a/Sources/Process/Turb_Mod/Src_Eps_K_Eps.f90 +++ b/Sources/Process/Turb_Mod/Src_Eps_K_Eps.f90 @@ -4,7 +4,14 @@ subroutine Src_Eps_K_Eps(Turb, Sol) ! Computes the source terms in the eps transport equation, ! ! wall shear stress (wall function approuch) ! !------------------------------------------------------------------------------! -! int( density (c_1e eps/kin Gk - c_2e eps^2/kin) )dV ! +! +! The form of the term being discretized: +! ! +! / ! +! | ! +! | ( density (c_1e eps/kin Gk - c_2e eps^2/kin) ) dV ! +! | ! +! / ! ! ! ! assigns epsilon from the wall function: ! ! ! @@ -22,12 +29,12 @@ subroutine Src_Eps_K_Eps(Turb, Sol) type(Var_Type), pointer :: kin, eps type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: s, c, c1, c2, j + integer :: s, c, c1, c2, j, reg real :: u_tan, u_tau - real :: re_t, f_mu, u_tau_new, fa, kin_vis + real :: re_t, f_mu, fa, kin_vis real :: eps_wf, eps_int, y_star, dia_coef_tmp real :: p_kin_int, p_kin_wf, ebf, z_o -!==============================================================================! +!------------------------------------------------------------------------------! ! Dimensions: ! ! ! ! production p_kin [m^2/s^3] | rate-of-strain shear [1/s] ! @@ -39,7 +46,7 @@ subroutine Src_Eps_K_Eps(Turb, Sol) !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -48,7 +55,7 @@ subroutine Src_Eps_K_Eps(Turb, Sol) call Turb % Alias_K_Eps (kin, eps) call Sol % Alias_Native (A, b) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin_vis = Flow % viscosity(c) / Flow % density(c) ! Positive contribution: @@ -82,16 +89,19 @@ subroutine Src_Eps_K_Eps(Turb, Sol) end do ! Imposing a boundary condition on wall for eps - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - kin_vis = Flow % viscosity(c1) / Flow % density(c1) - if( Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + Assert(c2 < 0) ! just to make sure + + kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) ! Compute tangential velocity component u_tan = Flow % U_Tan(s) @@ -141,8 +151,8 @@ subroutine Src_Eps_K_Eps(Turb, Sol) eps % n(c2) = 2.0 * kin_vis * kin % n(c1) & / Grid % wall_dist(c1)**2 end if ! y_plus(c1) < 3 - end if ! wall or wall_flux - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end subroutine diff --git a/Sources/Process/Turb_Mod/Src_Eps_K_Eps_Zeta_F.f90 b/Sources/Process/Turb_Mod/Src_Eps_K_Eps_Zeta_F.f90 index 973a39d15..9a95b87ec 100644 --- a/Sources/Process/Turb_Mod/Src_Eps_K_Eps_Zeta_F.f90 +++ b/Sources/Process/Turb_Mod/Src_Eps_K_Eps_Zeta_F.f90 @@ -15,13 +15,13 @@ subroutine Src_Eps_K_Eps_Zeta_F(Turb, Sol) type(Var_Type), pointer :: kin, eps, zeta, f22, ut, vt, wt type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: c, s, c1, c2, j + integer :: c, s, c1, c2, j, reg real :: u_tan, u_tau real :: e_sor, c_11e, ebf real :: eps_wf, eps_int - real :: fa, u_tau_new, kin_vis, p_kin_int, p_kin_wf + real :: fa, kin_vis, p_kin_int, p_kin_wf real :: z_o, dia_coef_tmp -!==============================================================================! +!------------------------------------------------------------------------------! ! In dissipation of turbulent kinetic energy equation exist two ! ! source terms which have form: ! ! ! @@ -44,7 +44,7 @@ subroutine Src_Eps_K_Eps_Zeta_F(Turb, Sol) !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -56,7 +56,7 @@ subroutine Src_Eps_K_Eps_Zeta_F(Turb, Sol) call Turb % Time_And_Length_Scale(Grid) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() e_sor = Grid % vol(c)/(Turb % t_scale(c)+TINY) c_11e = c_1e*(1.0 + alpha * ( 1.0/(zeta % n(c)+TINY) )) b(c) = b(c) + c_11e * e_sor * Turb % p_kin(c) @@ -79,16 +79,19 @@ subroutine Src_Eps_K_Eps_Zeta_F(Turb, Sol) !-------------------------------------------------------! ! Imposing a boundary condition on wall for eps - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - kin_vis = Flow % viscosity(c1) / Flow % density(c1) - if( Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + Assert(c2 < 0) + + kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) ! Compute tangential velocity component u_tan = Flow % U_Tan(s) @@ -138,8 +141,8 @@ subroutine Src_Eps_K_Eps_Zeta_F(Turb, Sol) eps % n(c2) = 2.0 * kin_vis * kin % n(c1) & / Grid % wall_dist(c1)**2 end if ! y_plus(c1) < 3 - end if ! wall or wall_flux - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end subroutine diff --git a/Sources/Process/Turb_Mod/Src_F22_K_Eps_Zeta_F.f90 b/Sources/Process/Turb_Mod/Src_F22_K_Eps_Zeta_F.f90 index ed18c622d..b664e0682 100644 --- a/Sources/Process/Turb_Mod/Src_F22_K_Eps_Zeta_F.f90 +++ b/Sources/Process/Turb_Mod/Src_F22_K_Eps_Zeta_F.f90 @@ -14,13 +14,18 @@ subroutine Src_F22_K_Eps_Zeta_F(Turb, Sol) type(Var_Type), pointer :: kin, eps, f22, zeta type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: s, c, c1, c2 + integer :: s, c, c1, c2, reg real :: sor_11, f22hg -!==============================================================================! +!------------------------------------------------------------------------------! ! ! ! The form of source terms are : ! ! ! -! int( f22hg*dV ), ! +! / ! +! | ! +! | f22hg * dV ! +! | ! +! / ! +! ! ! where f22hg - f22hg homogenious is placed in a source coefficients b(c) ! ! ! ! f22hg = (1.0 - Cv_1)*(vi2(c)/kin(c) - 2.0/3.0)/t_scale(c) & ! @@ -28,7 +33,6 @@ subroutine Src_F22_K_Eps_Zeta_F(Turb, Sol) ! ! ! int( f22*dV ); this term is placed in a diagonal of coefficient matrix ! ! ! -! ! ! Dimensions of certain variables ! ! ! ! t_scale [s] ! @@ -37,7 +41,8 @@ subroutine Src_F22_K_Eps_Zeta_F(Turb, Sol) ! vi2 [m^2/s^2] ! ! f22 [-] ! ! l_scale [m] ! -!------------------------------------------------------------------------------! +! ! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -48,7 +53,7 @@ subroutine Src_F22_K_Eps_Zeta_F(Turb, Sol) call Turb % Time_And_Length_Scale(Grid) ! Source term f22hg - do c = 1, Grid % n_cells + do c = Cells_In_Domain() f22hg = (1.0 - c_f1 - 0.65 * Turb % p_kin(c) / Flow % density(c) & / (eps % n(c) + TINY)) & * (zeta % n(c) - TWO_THIRDS) & @@ -58,18 +63,20 @@ subroutine Src_F22_K_Eps_Zeta_F(Turb, Sol) end do ! Source term f22hg - do c = 1, Grid % n_cells + do c = Cells_In_Domain() sor_11 = Grid % vol(c)/(Turb % l_scale(c)**2 + TINY) A % val(A % dia(c)) = A % val(A % dia(c)) + sor_11 end do ! Imposing boundary condition for f22 on the wall - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + Assert(c2 < 0) f22 % n(c2) = -2.0 * Flow % viscosity(c1) & / Flow % density(c1) * zeta % n(c1) & @@ -80,8 +87,8 @@ subroutine Src_F22_K_Eps_Zeta_F(Turb, Sol) ! Linearization of the near wall terms helps to get more ! stable solution, especially for small wall distance. b(c1) = b(c1) + A % fc(s) * f22 % n(c2) - end if ! end if of BC=wall - end if ! end if of c2<0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end subroutine diff --git a/Sources/Process/Turb_Mod/Src_F22_Rsm_Manceau_Hanjalic.f90 b/Sources/Process/Turb_Mod/Src_F22_Rsm_Manceau_Hanjalic.f90 index 0dfb135eb..88c6f9e33 100644 --- a/Sources/Process/Turb_Mod/Src_F22_Rsm_Manceau_Hanjalic.f90 +++ b/Sources/Process/Turb_Mod/Src_F22_Rsm_Manceau_Hanjalic.f90 @@ -14,9 +14,9 @@ subroutine Src_F22_Rsm_Manceau_Hanjalic(Turb, Sol) type(Var_Type), pointer :: f22 type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: s, c, c1, c2 - real :: sor11, f22hg -!==============================================================================! + integer :: s, c, c1, c2, reg + real :: sor11, f22hg +!------------------------------------------------------------------------------! ! ! ! The form of source terms are : ! ! ! @@ -44,7 +44,7 @@ subroutine Src_F22_Rsm_Manceau_Hanjalic(Turb, Sol) ! f22 [-] ! ! l_scale [m] ! ! ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -55,7 +55,7 @@ subroutine Src_F22_Rsm_Manceau_Hanjalic(Turb, Sol) call Turb % Time_And_Length_Scale(Grid) ! Source term f22hg - do c = 1, Grid % n_cells + do c = Cells_In_Domain() f22hg = 1.0 sor11 = Grid % vol(c) / Turb % l_scale(c)**2 A % val(A % dia(c)) = A % val(A % dia(c)) + sor11 @@ -63,17 +63,17 @@ subroutine Src_F22_Rsm_Manceau_Hanjalic(Turb, Sol) end do ! Source term - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - f22 % n(c2) = 0.0 + f22 % n(c2) = 0.0 - end if ! end if of BC=wall - end if ! end if of c2<0 - end do + end do ! faces + end if ! boundary condition type + end do ! regions end subroutine diff --git a/Sources/Process/Turb_Mod/Src_Kin_K_Eps.f90 b/Sources/Process/Turb_Mod/Src_Kin_K_Eps.f90 index 9a66c3de0..90e009d28 100644 --- a/Sources/Process/Turb_Mod/Src_Kin_K_Eps.f90 +++ b/Sources/Process/Turb_Mod/Src_Kin_K_Eps.f90 @@ -14,14 +14,14 @@ subroutine Src_Kin_K_Eps(Turb, Sol) type(Var_Type), pointer :: kin, eps, ut, vt, wt, t2 type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: u_tan, u_tau - real :: kin_vis ! [m^2/s] + real :: kin_vis real :: p_kin_int, p_kin_wf real :: z_o, ebf real :: ut_log_law, vt_log_law, wt_log_law real :: nx, ny, nz, qx, qy, qz, g_buoy_wall -!==============================================================================! +!------------------------------------------------------------------------------! ! Dimensions: ! ! ! ! production p_kin [m^2/s^3] | rate-of-strain shear [1/s] ! @@ -29,11 +29,12 @@ subroutine Src_Kin_K_Eps(Turb, Sol) ! wall shear s. tau_wall [kg/(m*s^2)]| dyn visc. viscosity [kg/(m*s)] ! ! density density [kg/m^3] | turb. kin en. kin % n [m^2/s^2] ! ! cell volume vol [m^3] | length lf [m] ! -! left hand s. A [kg/s] | right hand s. b [kg*m^2/s^3]! +! left hand s. A [kg/s] | kin. visc kin_vis [m^2/s] ! +! right hand s. b [kg*m^2/s^3]| ! !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -48,8 +49,9 @@ subroutine Src_Kin_K_Eps(Turb, Sol) !-----------------------------------------! ! Compute the sources in the interior ! !-----------------------------------------! + ! Production source: - do c = 1, Grid % n_cells + do c = Cells_In_Domain() Turb % p_kin(c) = Turb % vis_t(c) * Flow % shear(c)**2 b(c) = b(c) + Turb % p_kin(c) * Grid % vol(c) @@ -72,20 +74,20 @@ subroutine Src_Kin_K_Eps(Turb, Sol) !-----------------------------------------------! ! Compute the sources in the near wall cells ! !-----------------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - if(c2 < 0) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! Kinematic viscosity - kin_vis = Flow % viscosity(c1) / Flow % density(c1) + Assert(c2 < 0) ! just to be on the safe side - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + ! Kinematic viscosity + kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) ! Compute tangential velocity component u_tan = Flow % U_Tan(s) @@ -130,14 +132,14 @@ subroutine Src_Kin_K_Eps(Turb, Sol) qy = t % q(c2) * ny qz = t % q(c2) * nz - ut_log_law = - Turb % con_w(c1) & - / (Flow % density(c1) * Flow % capacity(c1)) & + ut_log_law = - Turb % con_w(c1) & + / (Flow % density(c1) * Flow % capacity(c1)) & * (t % n(c2) - t % n(c1))/Grid % wall_dist(c1) * nx - vt_log_law = - Turb % con_w(c1) & - / (Flow % density(c1) * Flow % capacity(c1)) & + vt_log_law = - Turb % con_w(c1) & + / (Flow % density(c1) * Flow % capacity(c1)) & * (t % n(c2) - t % n(c1))/Grid % wall_dist(c1) * ny - wt_log_law = - Turb % con_w(c1) & - / (Flow % density(c1) * Flow % capacity(c1)) & + wt_log_law = - Turb % con_w(c1) & + / (Flow % density(c1) * Flow % capacity(c1)) & * (t % n(c2) - t % n(c1))/Grid % wall_dist(c1) * nz ut % n(c1) = ut % n(c1) * exp(-1.0 * ebf) & @@ -170,9 +172,9 @@ subroutine Src_Kin_K_Eps(Turb, Sol) b(c1) = b(c1) + Turb % g_buoy(c1) * Grid % vol(c1) end if ! Flow % buoyancy .eq. THERMALLY_DRIVEN - end if ! Grid % Bnd_Cond_Type(c2) .eq. WALL or WALLFL - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions call Grid % Exchange_Cells_Real(kin % n) diff --git a/Sources/Process/Turb_Mod/Src_Kin_K_Eps_Zeta_F.f90 b/Sources/Process/Turb_Mod/Src_Kin_K_Eps_Zeta_F.f90 index a1d2d3f1f..ba4653523 100644 --- a/Sources/Process/Turb_Mod/Src_Kin_K_Eps_Zeta_F.f90 +++ b/Sources/Process/Turb_Mod/Src_Kin_K_Eps_Zeta_F.f90 @@ -23,14 +23,14 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) type(Var_Type), pointer :: kin, eps, zeta, f, ut, vt, wt, t2 type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: u_tan, u_tau real :: lf, ebf, p_kin_int, p_kin_wf, l_rans_d, l_rans_v real :: kin_vis real :: z_o, alpha_d, alpha_v, l_sgs_d, l_sgs_v real :: ut_log_law, vt_log_law, wt_log_law real :: nx, ny, nz, qx, qy, qz, g_buoy_wall -!==============================================================================! +!------------------------------------------------------------------------------! ! Dimensions: ! ! ! ! production p_kin [m^2/s^3] | rate-of-strain shear [1/s] ! @@ -42,7 +42,7 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -55,13 +55,13 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) call Sol % Alias_Native (A, b) ! Production source: - do c = 1, Grid % n_cells + do c = Cells_In_Domain() Turb % p_kin(c) = max(Turb % vis_t(c) * Flow % shear(c)**2, TINY) b(c) = b(c) + Turb % p_kin(c) * Grid % vol(c) end do if(Flow % buoyancy .eq. THERMALLY_DRIVEN) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() Turb % g_buoy(c) = -Flow % beta & * ( Flow % grav_x * ut % n(c) & + Flow % grav_y * vt % n(c) & @@ -82,7 +82,7 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) end if if(Turb % model .eq. HYBRID_LES_RANS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() lf = Grid % vol(c)**ONE_THIRD @@ -112,7 +112,7 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) end if end do else ! turbuence model will be K_EPS_ZETA_F - do c = 1, Grid % n_cells + do c = Cells_In_Domain() A % val(A % dia(c)) = A % val(A % dia(c)) & + Flow % density(c) * eps % n(c) & / (kin % n(c) + TINY) * Grid % vol(c) @@ -123,20 +123,20 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) !-----------------------------------------------! ! Compute the sources in the near wall cells ! !-----------------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - if(c2 < 0) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - ! Kinematic viscosity - kin_vis = Flow % viscosity(c1) / Flow % density(c1) + Assert(c2 < 0) - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + ! Kinematic viscosity + kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) ! Compute tangential velocity component u_tan = Flow % U_Tan(s) @@ -181,14 +181,14 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) qy = t % q(c2) * ny qz = t % q(c2) * nz - ut_log_law = - Turb % con_w(c1) & - / (Flow % density(c1) * Flow % capacity(c1)) & + ut_log_law = - Turb % con_w(c1) & + / (Flow % density(c1) * Flow % capacity(c1)) & * (t % n(c2) - t % n(c1))/Grid % wall_dist(c1) * nx - vt_log_law = - Turb % con_w(c1) & - / (Flow % density(c1) * Flow % capacity(c1)) & + vt_log_law = - Turb % con_w(c1) & + / (Flow % density(c1) * Flow % capacity(c1)) & * (t % n(c2) - t % n(c1))/Grid % wall_dist(c1) * ny - wt_log_law = - Turb % con_w(c1) & - / (Flow % density(c1) * Flow % capacity(c1)) & + wt_log_law = - Turb % con_w(c1) & + / (Flow % density(c1) * Flow % capacity(c1)) & * (t % n(c2) - t % n(c1))/Grid % wall_dist(c1) * nz ut % n(c1) = ut % n(c1) * exp(-1.0 * ebf) & @@ -221,8 +221,8 @@ subroutine Src_Kin_K_Eps_Zeta_F(Turb, Sol) b(c1) = b(c1) + Turb % g_buoy(c1) * Grid % vol(c1) end if ! Flow % buoyancy .eq. THERMALLY_DRIVEN - end if ! Grid % Bnd_Cond_Type(c2) .eq. WALL or WALLFL - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end subroutine diff --git a/Sources/Process/Turb_Mod/Src_Rsm_Hanjalic_Jakirlic.f90 b/Sources/Process/Turb_Mod/Src_Rsm_Hanjalic_Jakirlic.f90 index a42139ba0..1f76c77fb 100644 --- a/Sources/Process/Turb_Mod/Src_Rsm_Hanjalic_Jakirlic.f90 +++ b/Sources/Process/Turb_Mod/Src_Rsm_Hanjalic_Jakirlic.f90 @@ -17,7 +17,7 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: c, s, c1, c2, i, icont, nc, nb + integer :: c, s, c1, c2, i, icont, nc, nb, reg real :: mag real :: a11, a22, a33, a12, a13, a23 real :: s11, s22, s33, s12, s13, s23 @@ -67,8 +67,8 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) ! Take aliases Flow => Turb % pnt_flow Grid => Flow % pnt_grid - nc = Grid % n_cells nb = Grid % n_bnd_cells + nc = Grid % n_cells call Flow % Alias_Momentum (u, v, w) call Turb % Alias_K_Eps_Zeta_F(kin, eps, zeta, f22) call Turb % Alias_Stresses (uu, vv, ww, uv, uw, vw) @@ -79,9 +79,10 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) ee = 0.5 aa = 0.5 - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin % n(c) = max(0.5*(uu % n(c) + vv % n(c) + ww % n(c)), TINY) end do + call Grid % Exchange_Cells_Real(kin % n(-nb:nc)) ! !---------------------------------------------------! ! ! Below is one of versions of Hanjalic-Jakirlic ! @@ -133,7 +134,7 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) ! call Flow % Grad_Component(w % x, 3, var12y) ! d2W/dxdz ! call Flow % Grad_Component(w % y, 3, var12z) ! d2W/dydz ! -! do c = 1, Grid % n_cells +! do c = Cells_In_Domain_And_Buffers() ! uxx = var1x(c) ! uyy = var1y(c) ! uzz = var1z(c) @@ -251,7 +252,7 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) call Flow % Grad_Component(w % z, 3, ui_zz(-nb:nc)) ! d2w/dzdz end if - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin_vis = Flow % viscosity(c) / Flow % density(c) if(i == 1) then uxx = ui_xx(c) @@ -320,6 +321,8 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) + ww % n(c)*(uzx*uzx + uzy*uzy + uzz*uzz)) end if end do + call Grid % Exchange_Cells_Real(diss1(-nb:nc)) + end do ! i end if ! end if EPS == yes @@ -329,7 +332,7 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) r13 = ONE_THIRD r23 = TWO_THIRDS - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin_vis = Flow % viscosity(c) / Flow % density(c) Turb % p_kin(c) = max( & - ( uu % n(c)*u % x(c) + uv % n(c)*u % y(c) + uw % n(c)*u % z(c) & @@ -370,9 +373,9 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) 3*a12**2*(a11+a22) + 3*a13**2*(a11+a33) + & 3*a23**2*(a22+a33) + 6*a12*a13*a23 - aa=1.0 - (9.0/8.0)*(aa2-aa3) - aa=max(aa,0.0) - aa=min(aa,1.0) + aa = 1.0 - (9.0/8.0)*(aa2-aa3) + aa = max(aa, 0.0) + aa = min(aa, 1.0) uu_nn = (uu % n(c)*n1*n1+uv % n(c)*n1*n2+uw % n(c)*n1*n3 & + uv % n(c)*n2*n1+vv % n(c)*n2*n2+vw % n(c)*n2*n3 & @@ -489,12 +492,12 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) + 2.0 * Flow % omega_y * uv % n(c) & - 2.0 * Flow % omega_z * uw % n(c) - var1_11 = -cc1*eps%n(c)*a11 - var1_22 = -cc1*eps%n(c)*a22 - var1_33 = -cc1*eps%n(c)*a33 - var1_12 = -cc1*eps%n(c)*a12 - var1_13 = -cc1*eps%n(c)*a13 - var1_23 = -cc1*eps%n(c)*a23 + var1_11 = -cc1 * eps % n(c) * a11 + var1_22 = -cc1 * eps % n(c) * a22 + var1_33 = -cc1 * eps % n(c) * a33 + var1_12 = -cc1 * eps % n(c) * a12 + var1_13 = -cc1 * eps % n(c) * a13 + var1_23 = -cc1 * eps % n(c) * a23 var2_11 = -cc2*(p11 - r23 * Turb % p_kin(c)) var2_22 = -cc2*(p22 - r23 * Turb % p_kin(c)) @@ -685,15 +688,16 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) end if end do - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin_e(c) = sqrt( 0.5 * (uu % n(c) + vv % n(c) + ww % n(c)) ) end do + call Grid % Exchange_Cells_Real(kin_e(-nb:nc)) if(name_phi == 'EPS') then call Flow % Grad(kin_e(-nb:nc), kin_e_x(-nb:nc), & kin_e_y(-nb:nc), & kin_e_z(-nb:nc)) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin_vis = Flow % viscosity(c) / Flow % density(c) re_t = (kin % n(c)**2) / (kin_vis*eps % n(c) + TINY) f_eps = 1.0 - ((c_2e-1.4)/c_2e) * exp(-(re_t/6.0)**2) @@ -707,23 +711,21 @@ subroutine Src_Rsm_Hanjalic_Jakirlic(Turb, Sol, name_phi) end if if(name_phi == 'EPS') then - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - ! Calculate a values of dissipation on wall - if(c2 < 0 ) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then - + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + ! Calculate a values of dissipation on wall kin_vis = Flow % viscosity(c1) / Flow % density(c1) eps % n(c2) = kin_vis * ( kin_e_x(c1)**2 & + kin_e_y(c1)**2 & + kin_e_z(c1)**2) - - end if ! end if of BC=wall - end if ! end if of c2<0 - end do + end do ! faces + end if ! boundary condition type + end do ! regions end if call Work % Disconnect_Real_Cell(l_sc_x, l_sc_y, l_sc_z, & diff --git a/Sources/Process/Turb_Mod/Src_Rsm_Manceau_Hanjalic.f90 b/Sources/Process/Turb_Mod/Src_Rsm_Manceau_Hanjalic.f90 index 582a98c85..c91d153f6 100644 --- a/Sources/Process/Turb_Mod/Src_Rsm_Manceau_Hanjalic.f90 +++ b/Sources/Process/Turb_Mod/Src_Rsm_Manceau_Hanjalic.f90 @@ -1,7 +1,7 @@ !==============================================================================! subroutine Src_Rsm_Manceau_Hanjalic(Turb, Sol, name_phi) !------------------------------------------------------------------------------! -! Calculate source terms for Re stresses and dissipation for +! Calculate source terms for Re stresses and dissipation for ! ! RSM_MANCEAU_HANJALIC model ! !------------------------------------------------------------------------------! implicit none @@ -17,7 +17,7 @@ subroutine Src_Rsm_Manceau_Hanjalic(Turb, Sol, name_phi) type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: c, s, c1, c2 + integer :: c, s, c1, c2, nb, nc, reg real :: prod, diss, phi_hom, phi_wall, mag, phi_tot real :: b11, b22, b33, b12, b13, b21, b31, b23, b32 real :: s11, s22, s33, s12, s13, s21, s31, s23, s32 @@ -29,7 +29,9 @@ subroutine Src_Rsm_Manceau_Hanjalic(Turb, Sol, name_phi) ! Take aliases Flow => Turb % pnt_flow Grid => Flow % pnt_grid - call Flow % Alias_Momentum(u, v, w) + nb = Grid % n_bnd_cells + nc = Grid % n_cells + call Flow % Alias_Momentum (u, v, w) call Turb % Alias_K_Eps_Zeta_F(kin, eps, zeta, f22) call Turb % Alias_Stresses (uu, vv, ww, uv, uw, vw) call Sol % Alias_Native (A, b) @@ -38,7 +40,7 @@ subroutine Src_Rsm_Manceau_Hanjalic(Turb, Sol, name_phi) call Flow % Grad_Variable(f22) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin % n(c) = max(0.5*( uu % n(c) & + vv % n(c) & + ww % n(c)), TINY) @@ -233,7 +235,7 @@ subroutine Src_Rsm_Manceau_Hanjalic(Turb, Sol, name_phi) + b21*s11 + b22*s12 + b23*s13) & + g5*kin % n(c)*( b11*v21 + b12*v22 + b13*v23 & + b21*v11 + b22*v12 + b23*v13) - + prod = -( uu % n(c) * v % x(c) & + uw % n(c) * v % z(c) & + uv % n(c) *(v % y(c) + u % x(c)) & @@ -362,22 +364,24 @@ subroutine Src_Rsm_Manceau_Hanjalic(Turb, Sol, name_phi) + c_2e * esor * Flow % density(c) end if end do + call Grid % Exchange_Cells_Real(kin % n(-nb:nc)) + call Grid % Exchange_Cells_Real(Turb % p_kin(-nb:nc)) if(name_phi == 'EPS') then - do s = 1, Grid % n_faces - c1=Grid % faces_c(1,s) - c2=Grid % faces_c(2,s) - - ! Calculate a values of dissipation on wall - if(c2 < 0) then - kin_vis = Flow % viscosity(c1) / Flow % density(c1) - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + ! Calculate a values of dissipation on wall + kin_vis = Flow % viscosity(c1) / Flow % density(c1) eps % n(c2) = kin_vis*(uu % n(c1) + vv % n(c1) + ww % n(c1))& / Grid % wall_dist(c1)**2 - end if ! end if of BC=wall - end if ! end if of c2<0 - end do + end do ! faces + end if ! boundary condition type + end do ! regions end if end subroutine diff --git a/Sources/Process/Turb_Mod/Src_T2.f90 b/Sources/Process/Turb_Mod/Src_T2.f90 index 1eea58708..045cfda68 100644 --- a/Sources/Process/Turb_Mod/Src_T2.f90 +++ b/Sources/Process/Turb_Mod/Src_T2.f90 @@ -14,10 +14,10 @@ subroutine Src_T2(Turb, Sol) type(Var_Type), pointer :: kin, eps, ut, vt, wt, t2 type(Matrix_Type), pointer :: A real, pointer :: b(:) - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: kin_vis, p_t2_wall, ebf, u_tau real :: ut_sgdh, vt_sgdh, wt_sgdh, z_o -!==============================================================================! +!------------------------------------------------------------------------------! ! Dimensions: ! ! ! ! production p_kin [m^2/s^3] | rate-of-strain shear [1/s] ! @@ -29,7 +29,7 @@ subroutine Src_T2(Turb, Sol) !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -49,7 +49,7 @@ subroutine Src_T2(Turb, Sol) call Flow % Grad_Variable(t) ! Production source: - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() !-------------------------------------------------------------------! ! ut, vt and wt defined by AFM or GGDH could lead to divergence ! @@ -79,18 +79,18 @@ subroutine Src_T2(Turb, Sol) end do - ! Implementation of wall function approach for buoyancy-driven flows + !------------------------------------------------------------------------! + ! Implementation of wall function approach for buoyancy-driven flows ! + !------------------------------------------------------------------------! + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then - - ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + ! Set up roughness coefficient + z_o = Turb % Roughness_Coeff(c1, c2) ! Kinematic viscosities kin_vis = Flow % viscosity(c1) / Flow % density(c1) @@ -101,7 +101,6 @@ subroutine Src_T2(Turb, Sol) Grid % wall_dist(c1), & kin_vis, & z_o) - ebf = Turb % Ebf_Momentum(c1) p_t2_wall = Flow % density(c1) & @@ -115,16 +114,16 @@ subroutine Src_T2(Turb, Sol) Turb % p_t2(c1) = p_t2_wall else Turb % p_t2(c1) = ( Turb % p_t2(c1) * exp(-1.0 * ebf) & - + p_t2_wall * exp(-1.0/ebf)) + + p_t2_wall * exp(-1.0 / ebf)) end if b(c1) = b(c1) + Turb % p_t2(c1) * Grid % vol(c1) t2 % n(c2) = 0.0 - end if ! Grid % Bnd_Cond_Type(c2).eq.WALL or WALLFL - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions end subroutine diff --git a/Sources/Process/Turb_Mod/Src_Vis_Spalart_Almaras.f90 b/Sources/Process/Turb_Mod/Src_Vis_Spalart_Almaras.f90 index 7430206dc..7c66339cc 100644 --- a/Sources/Process/Turb_Mod/Src_Vis_Spalart_Almaras.f90 +++ b/Sources/Process/Turb_Mod/Src_Vis_Spalart_Almaras.f90 @@ -26,7 +26,7 @@ subroutine Src_Vis_Spalart_Almaras(Turb, Sol) if(Turb % model .eq. SPALART_ALLMARAS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() !---------------------------------! ! Compute the production term ! @@ -60,7 +60,7 @@ subroutine Src_Vis_Spalart_Almaras(Turb, Sol) end do else if(Turb % model .eq. DES_SPALART) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() ! What is 0.65 here? A ghost number dist = min(Grid % wall_dist(c), 0.65 * Turb % h_max(c)) diff --git a/Sources/Process/Turb_Mod/Src_Zeta_K_Eps_Zeta_F.f90 b/Sources/Process/Turb_Mod/Src_Zeta_K_Eps_Zeta_F.f90 index b6d9022e3..81b0474aa 100644 --- a/Sources/Process/Turb_Mod/Src_Zeta_K_Eps_Zeta_F.f90 +++ b/Sources/Process/Turb_Mod/Src_Zeta_K_Eps_Zeta_F.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Src_Zeta_K_Eps_Zeta_F(Turb, Sol, curr_dt) + subroutine Src_Zeta_K_Eps_Zeta_F(Turb, Sol) !------------------------------------------------------------------------------! ! Calculate source terms in equation for zeta. ! ! Term which is negative is put on left hand side in diagonal of ! @@ -9,7 +9,6 @@ subroutine Src_Zeta_K_Eps_Zeta_F(Turb, Sol, curr_dt) !--------------------------------[Arguments]-----------------------------------! class(Turb_Type), target :: Turb type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt !----------------------------------[Locals]------------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -17,7 +16,7 @@ subroutine Src_Zeta_K_Eps_Zeta_F(Turb, Sol, curr_dt) type(Matrix_Type), pointer :: A real, pointer :: b(:) integer :: c -!==============================================================================! +!------------------------------------------------------------------------------! ! In transport equation for zeta two source terms exist which have form: ! ! ! ! / ! @@ -30,7 +29,7 @@ subroutine Src_Zeta_K_Eps_Zeta_F(Turb, Sol, curr_dt) ! sign of term , it is placed on left or right hand side. Second, negative ! ! source term is added to main diagonal left hand side coefficient matrix ! ! in order to increase stability of solver ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -43,8 +42,8 @@ subroutine Src_Zeta_K_Eps_Zeta_F(Turb, Sol, curr_dt) ! sensitive to initial condition while the second one can lead to ! instabilities for some cases such as Flow around cylinder. That is why we ! choose this particular way to the add source term. - do c = 1, Grid % n_cells - if(curr_dt > 500) then + do c = Cells_In_Domain() + if(Time % Curr_Dt() > 500) then b(c) = b(c) + f22 % n(c) * Grid % vol(c) * Flow % density(c) else b(c) = b(c) + max(0.0, f22 % n(c)*Grid % vol(c)) * Flow % density(c) diff --git a/Sources/Process/Turb_Mod/Tau_Wall_Log_Law.f90 b/Sources/Process/Turb_Mod/Tau_Wall_Log_Law.f90 index e5113c457..df1ac1bc4 100644 --- a/Sources/Process/Turb_Mod/Tau_Wall_Log_Law.f90 +++ b/Sources/Process/Turb_Mod/Tau_Wall_Log_Law.f90 @@ -8,6 +8,8 @@ real function Tau_Wall_Log_Law(Turb, dens, u_tau, u_tan, wall_dist, & !---------------------------------[Arguments]----------------------------------! class(Turb_Type) :: Turb real :: dens, u_tau, u_tan, wall_dist, y_plus, z_o +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Turb) !==============================================================================! if(z_o > TINY) then diff --git a/Sources/Process/Turb_Mod/Time_And_Length_Scale.f90 b/Sources/Process/Turb_Mod/Time_And_Length_Scale.f90 index 7fbc20ef8..38507296d 100644 --- a/Sources/Process/Turb_Mod/Time_And_Length_Scale.f90 +++ b/Sources/Process/Turb_Mod/Time_And_Length_Scale.f90 @@ -36,7 +36,7 @@ subroutine Time_And_Length_Scale(Turb, Grid) if(Turb % model .eq. K_EPS_ZETA_F) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() eps_l(c) = eps % n(c) + TINY ! limited eps % n kin_vis = Flow % viscosity(c) / Flow % density(c) @@ -55,7 +55,7 @@ subroutine Time_And_Length_Scale(Turb, Grid) end do else if(Turb % model .eq. HYBRID_LES_RANS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() eps_l(c) = eps % n(c) + TINY ! limited eps % n kin_vis = Flow % viscosity(c) / Flow % density(c) @@ -73,7 +73,7 @@ subroutine Time_And_Length_Scale(Turb, Grid) else if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() eps_l(c) = eps % n(c) + TINY ! limited eps % n kin_vis = Flow % viscosity(c) / Flow % density(c) @@ -92,7 +92,7 @@ subroutine Time_And_Length_Scale(Turb, Grid) else if(Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() eps_l(c) = eps % n(c) + TINY ! limited eps % n t_1(c) = kin % n(c)/eps_l(c) @@ -105,7 +105,7 @@ subroutine Time_And_Length_Scale(Turb, Grid) else if(Turb % model .eq. K_EPS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() eps_l(c) = eps % n(c) + TINY ! limited eps % n t_1(c) = kin % n(c) / eps_l(c) diff --git a/Sources/Process/Turb_Mod/U_Plus_Log_Law.f90 b/Sources/Process/Turb_Mod/U_Plus_Log_Law.f90 index dab1b1679..0831cc237 100644 --- a/Sources/Process/Turb_Mod/U_Plus_Log_Law.f90 +++ b/Sources/Process/Turb_Mod/U_Plus_Log_Law.f90 @@ -7,6 +7,8 @@ real function U_Plus_Log_Law(Turb, wall_dist, y_plus, z_o) !---------------------------------[Arguments]----------------------------------! class(Turb_Type) :: Turb real :: y_plus, wall_dist, z_o +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Turb) !==============================================================================! if(z_o > TINY) then diff --git a/Sources/Process/Turb_Mod/Vis_T_Dynamic.f90 b/Sources/Process/Turb_Mod/Vis_T_Dynamic.f90 index 6b7a1589b..41821c2a7 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Dynamic.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Dynamic.f90 @@ -72,7 +72,7 @@ subroutine Vis_T_Dynamic(Turb) call Grid % Exchange_Cells_Real(w % n) call Grid % Exchange_Cells_Real(Flow % shear) - do c =1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() u_a = 0.0 v_a = 0.0 w_a = 0.0 @@ -180,7 +180,7 @@ subroutine Vis_T_Dynamic(Turb) w % y, & ! dW/dy w % z) ! dW/dz - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() l_g = Grid % vol(c)**ONE_THIRD l_f = 2.0 * l_g @@ -191,16 +191,16 @@ subroutine Vis_T_Dynamic(Turb) 0.5*(u % z(c) + w % x(c))*(u % z(c) + w % x(c)) + & 0.5*(v % x(c) + u % y(c))*(v % x(c) + u % y(c)))) - l_11 = uu_f(c) - u_f(c) * u_f(c) - l_22 = vv_f(c) - v_f(c) * v_f(c) - l_33 = ww_f(c) - w_f(c) * w_f(c) - l_12 = uv_f(c) - u_f(c) * v_f(c) - l_13 = uw_f(c) - u_f(c) * w_f(c) - l_23 = vw_f(c) - v_f(c) * w_f(c) + l_11 = uu_f(c) - u_f(c) * u_f(c) + l_22 = vv_f(c) - v_f(c) * v_f(c) + l_33 = ww_f(c) - w_f(c) * w_f(c) + l_12 = uv_f(c) - u_f(c) * v_f(c) + l_13 = uw_f(c) - u_f(c) * w_f(c) + l_23 = vw_f(c) - v_f(c) * w_f(c) - m_11 = l_f**2 * shear_test(c) * u % x(c) - l_g**2 * m_11_f(c) - m_22 = l_f**2 * shear_test(c) * v % y(c) - l_g**2 * m_22_f(c) - m_33 = l_f**2 * shear_test(c) * w % z(c) - l_g**2 * m_33_f(c) + m_11 = l_f**2 * shear_test(c) * u % x(c) - l_g**2 * m_11_f(c) + m_22 = l_f**2 * shear_test(c) * v % y(c) - l_g**2 * m_22_f(c) + m_33 = l_f**2 * shear_test(c) * w % z(c) - l_g**2 * m_33_f(c) m_12 = l_f**2 * shear_test(c) * .5*(u % y(c)+v % x(c)) - l_g**2 * m_12_f(c) m_13 = l_f**2 * shear_test(c) * .5*(u % z(c)+w % x(c)) - l_g**2 * m_13_f(c) @@ -211,11 +211,11 @@ subroutine Vis_T_Dynamic(Turb) l_dot_m = l_11 * m_11 + l_22 * m_22 + l_33 * m_33 & + 2.0 * (l_12 * m_12 + l_13 * m_13 + l_23 * m_23) - Turb % c_dyn(c) = -0.5 * l_dot_m / (m_dot_m + TINY) + Turb % c_dyn(c) = -0.5 * l_dot_m / (m_dot_m + TINY) ! Set lower and upper limiter on c_dyn if(Turb % c_dyn(c) < 0.0) then - Turb % c_dyn(c) = 0.0 + Turb % c_dyn(c) = 0.0 else if(Turb % c_dyn(c) > 0.04) then Turb % c_dyn(c) = 0.04 end if diff --git a/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Prandtl.f90 b/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Prandtl.f90 index 1cb19dd03..2847e32cd 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Prandtl.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Prandtl.f90 @@ -13,8 +13,8 @@ subroutine Vis_T_Hybrid_Les_Prandtl(Turb) !---------------------------------[Arguments]----------------------------------! class(Turb_Type), target :: Turb !------------------------------[Local parameters]------------------------------! - integer, parameter :: A_POW = 8.3 - integer, parameter :: B_POW = 1.0/7.0 + real, parameter :: A_POW = 8.3 + real, parameter :: B_POW = 1.0/7.0 !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -41,7 +41,7 @@ subroutine Vis_T_Hybrid_Les_Prandtl(Turb) !----------------------------! ! Model's eddy viscosity ! !----------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() hmax = Turb % h_max(c) hwn = Turb % h_w(c) diff --git a/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Rans.f90 b/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Rans.f90 index 22dc8ff96..dbc2af84c 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Rans.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Hybrid_Les_Rans.f90 @@ -29,7 +29,7 @@ subroutine Vis_T_Hybrid_Les_Rans(Turb) call Flow % Grad_Variable(t) end if - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() lf = Grid % vol(c) ** ONE_THIRD Turb % vis_t_sgs(c) = Flow % density(c) & * (lf*lf) & ! delta^2 @@ -38,7 +38,7 @@ subroutine Vis_T_Hybrid_Les_Rans(Turb) end do if(Flow % buoyancy .eq. THERMALLY_DRIVEN) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() nc2 = -Flow % beta * ( Flow % grav_x * t % x(c) & + Flow % grav_y * t % y(c) & + Flow % grav_z * t % z(c)) diff --git a/Sources/Process/Turb_Mod/Vis_T_K_Eps.f90 b/Sources/Process/Turb_Mod/Vis_T_K_Eps.f90 index 762950e01..367ced717 100644 --- a/Sources/Process/Turb_Mod/Vis_T_K_Eps.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_K_Eps.f90 @@ -23,12 +23,12 @@ subroutine Vis_T_K_Eps(Turb) type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w type(Var_Type), pointer :: kin, eps - integer :: c1, c2, s, c + integer :: c1, c2, s, c, reg real :: pr, beta, ebf, sc real :: u_tan, u_tau real :: kin_vis, u_plus, y_star, re_t, f_mu real :: z_o -!==============================================================================! +!------------------------------------------------------------------------------! ! Dimensions: ! ! ! ! production p_kin [m^2/s^3] | rate-of-strain shear [1/s] ! @@ -42,7 +42,7 @@ subroutine Vis_T_K_Eps(Turb) !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -50,7 +50,7 @@ subroutine Vis_T_K_Eps(Turb) call Flow % Alias_Momentum(u, v, w) call Turb % Alias_K_Eps (kin, eps) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() ! Kinematic viscosities kin_vis = Flow % viscosity(c) / Flow % density(c) @@ -68,19 +68,21 @@ subroutine Vis_T_K_Eps(Turb) Turb % vis_t(c) = f_mu * c_mu * Flow % density(c) * kin % n(c)**2 & / (eps % n(c) + TINY) end do + call Grid % Exchange_Cells_Real(Turb % vis_t) - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + Assert(c2 < 0) kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) ! Compute tangential velocity component u_tan = Flow % U_Tan(s) @@ -118,15 +120,14 @@ subroutine Vis_T_K_Eps(Turb) Turb % vis_w(c1) = Turb % y_plus(c1) * Flow % viscosity(c1) & / ( Turb % y_plus(c1) * exp(-1.0 * ebf) & - + u_plus * exp(-1.0/ebf) + TINY) + + u_plus * exp(-1.0 / ebf) + TINY) end if if(Flow % heat_transfer) then pr = Flow % Prandtl_Numb(c1) pr_t = Turb % Prandtl_Turb(c1) - beta = 9.24 * ((pr/pr_t)**0.75 - 1.0) & - * (1.0 + 0.28 * exp(-0.007*pr/pr_t)) + beta = Turb % Beta_Scalar(pr, pr_t) ! According to Toparlar et al. 2019 paper ! "CFD simulation of the near-neutral atmospheric boundary layer: ! New temperature inlet profile consistent with wall functions" @@ -143,20 +144,18 @@ subroutine Vis_T_K_Eps(Turb) if(Flow % n_scalars > 0) then sc = Flow % Schmidt_Numb(c1) ! laminar Schmidt number - beta = 9.24 * ((sc/sc_t)**0.75 - 1.0) & - * (1.0 + 0.28 * exp(-0.007*sc/sc_t)) - ebf = Turb % Ebf_Scalar(c1, pr) + beta = Turb % Beta_Scalar(sc, sc_t) + ebf = Turb % Ebf_Scalar(c1, pr) Turb % diff_w(c1) = Turb % y_plus(c1) & * (Flow % viscosity(c1)/Flow % density(c1)) & / ( Turb % y_plus(c1) * sc * exp(-1.0 * ebf) & - + (u_plus + beta) * sc_t * exp(-1.0 / ebf) + TINY) + + (u_plus + beta) * sc_t * exp(-1.0 / ebf) + TINY) end if - end if ! Grid % Bnd_Cond_Type(c2).eq.WALL or WALLFL - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions - call Grid % Exchange_Cells_Real(Turb % vis_t) call Grid % Exchange_Cells_Real(Turb % vis_w) if(Flow % heat_transfer) then call Grid % Exchange_Cells_Real(Turb % con_w) diff --git a/Sources/Process/Turb_Mod/Vis_T_K_Eps_Zeta_F.f90 b/Sources/Process/Turb_Mod/Vis_T_K_Eps_Zeta_F.f90 index 1c8f8b775..25d809326 100644 --- a/Sources/Process/Turb_Mod/Vis_T_K_Eps_Zeta_F.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_K_Eps_Zeta_F.f90 @@ -11,12 +11,12 @@ subroutine Vis_T_K_Eps_Zeta_F(Turb) type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w type(Var_Type), pointer :: kin, eps, zeta, f22 - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: u_tan, u_tau real :: beta, pr, sc real :: u_plus, ebf, kin_vis real :: z_o -!==============================================================================! +!------------------------------------------------------------------------------! ! Dimensions: ! ! ! ! Production p_kin [m^2/s^3] | Rate-of-strain shear [1/s] ! @@ -30,7 +30,7 @@ subroutine Vis_T_K_Eps_Zeta_F(Turb) !------------------------------------------------------------------------------! ! p_kin = 2*vis_t / density S_ij S_ij ! ! shear = sqrt(2 S_ij S_ij) ! -!------------------------------------------------------------------------------! +!==============================================================================! ! Take aliases Flow => Turb % pnt_flow @@ -42,37 +42,42 @@ subroutine Vis_T_K_Eps_Zeta_F(Turb) ! Pure k-eps-zeta-f if(Turb % model .eq. K_EPS_ZETA_F) then - do c = -Grid % n_bnd_cells, Grid % n_cells - Turb % vis_t(c) = c_mu_d * Flow % density(c) * zeta % n(c) & - * kin % n(c) * Turb % t_scale(c) + do reg = Boundary_And_Inside_Regions() + do c = Cells_In_Region(reg) + Turb % vis_t(c) = c_mu_d * Flow % density(c) * zeta % n(c) & + * kin % n(c) * Turb % t_scale(c) + end do end do + call Grid % Exchange_Cells_Real(Turb % vis_t) ! Hybrid between k-eps-zeta-f and dynamic SGS model else if(Turb % model .eq. HYBRID_LES_RANS) then - do c = -Grid % n_bnd_cells, Grid % n_cells - Turb % vis_t(c) = c_mu_d * Flow % density(c) * zeta % n(c) & - * kin % n(c) * Turb % t_scale(c) - Turb % vis_t_eff(c) = max(Turb % vis_t(c), & - Turb % vis_t_sgs(c)) + do reg = Boundary_And_Inside_Regions() + do c = Cells_In_Region(reg) + Turb % vis_t(c) = c_mu_d * Flow % density(c) * zeta % n(c) & + * kin % n(c) * Turb % t_scale(c) + Turb % vis_t_eff(c) = max(Turb % vis_t(c), & + Turb % vis_t_sgs(c)) + end do end do + call Grid % Exchange_Cells_Real(Turb % vis_t) call Grid % Exchange_Cells_Real(Turb % vis_t_eff) end if - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - if(c2 < 0) then + Assert(c2 < 0) - ! kinematic viscosities - kin_vis = Flow % viscosity(c1) / Flow % density(c1) - - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) ! Compute tangential velocity component u_tan = Flow % U_Tan(s) @@ -117,9 +122,7 @@ subroutine Vis_T_K_Eps_Zeta_F(Turb) if(Flow % heat_transfer) then pr_t = Turb % Prandtl_Turb(c1) pr = Flow % Prandtl_Numb(c1) ! laminar Prandtl number - beta = 9.24 * ((pr/pr_t)**0.75 - 1.0) & - * (1.0 + 0.28 * exp(-0.007*pr/pr_t)) - + beta = Turb % Beta_Scalar(pr, pr_t) ! According to Toparlar et al. 2019 paper ! "CFD simulation of the near-neutral atmospheric boundary layer: ! New temperature inlet profile consistent with wall functions" @@ -132,14 +135,12 @@ subroutine Vis_T_K_Eps_Zeta_F(Turb) * Flow % viscosity(c1) & * Flow % capacity(c1) & / ( Turb % y_plus(c1) * pr * exp(-1.0 * ebf) & - + (u_plus + beta) * pr_t * exp(-1.0 / ebf) + TINY ) + + (u_plus + beta) * pr_t * exp(-1.0 / ebf) + TINY ) end if if(Flow % n_scalars > 0) then sc = Flow % Schmidt_Numb(c1) ! laminar Schmidt number - beta = 9.24 * ((sc/sc_t)**0.75 - 1.0) & - * (1.0 + 0.28 * exp(-0.007*sc/sc_t)) - + beta = Turb % Beta_Scalar(sc, sc_t) ! According to Toparlar et al. 2019 paper ! "CFD simulation of the near-neutral atmospheric boundary layer: ! New temperature inlet profile consistent with wall functions" @@ -151,14 +152,13 @@ subroutine Vis_T_K_Eps_Zeta_F(Turb) Turb % diff_w(c1) = Turb % y_plus(c1) & * (Flow % viscosity(c1)/Flow % density(c1)) & / (Turb % y_plus(c1) * sc * exp(-1.0 * ebf) & - + (u_plus + beta) * sc_t * exp(-1.0 / ebf) + TINY) + + (u_plus + beta) * sc_t * exp(-1.0 / ebf) + TINY) end if - end if ! Grid % Bnd_Cond_Type(c2).eq.WALL or WALLFL - end if ! c2 < 0 - end do + end do ! faces in regions + end if ! region is WALL or WALLFL + end do ! through regions - call Grid % Exchange_Cells_Real(Turb % vis_t) call Grid % Exchange_Cells_Real(Turb % vis_w) if(Flow % heat_transfer) then call Grid % Exchange_Cells_Real(Turb % con_w) diff --git a/Sources/Process/Turb_Mod/Vis_T_Rsm.f90 b/Sources/Process/Turb_Mod/Vis_T_Rsm.f90 index 7d31821ba..a2fc0f17c 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Rsm.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Rsm.f90 @@ -39,7 +39,7 @@ subroutine Vis_T_Rsm(Turb) call Calculate_Shear_And_Vorticity(Flow) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() kin % n(c) = 0.5*max(uu % n(c) + vv % n(c) + ww % n(c), TINY) cmu_mod = max(-( uu % n(c) * u % x(c) & diff --git a/Sources/Process/Turb_Mod/Vis_T_Spalart_Allmaras.f90 b/Sources/Process/Turb_Mod/Vis_T_Spalart_Allmaras.f90 index 29ef8d145..db82a7ab1 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Spalart_Allmaras.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Spalart_Allmaras.f90 @@ -22,7 +22,7 @@ subroutine Vis_T_Spalart_Allmaras(Turb) call Flow % Alias_Momentum(u, v, w) if(Turb % model .eq. DES_SPALART) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() x_rat = vis % n(c) / Flow % viscosity(c) f_v1 = x_rat**3/(x_rat**3 + c_v1**3) Turb % vis_t(c) = Flow % density(c) * f_v1 * vis % n(c) @@ -30,7 +30,7 @@ subroutine Vis_T_Spalart_Allmaras(Turb) end if if(Turb % model .eq. SPALART_ALLMARAS) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() x_rat = vis % n(c) / Flow % viscosity(c) f_v1 = x_rat**3/(x_rat**3 + c_v1**3) Turb % vis_t(c) = Flow % density(c) * f_v1 * vis % n(c) diff --git a/Sources/Process/Turb_Mod/Vis_T_Subgrid.f90 b/Sources/Process/Turb_Mod/Vis_T_Subgrid.f90 index 2e6228bc6..1121e040f 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Subgrid.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Subgrid.f90 @@ -11,8 +11,8 @@ subroutine Vis_T_Subgrid(Turb) !---------------------------------[Arguments]----------------------------------! class(Turb_Type), target :: Turb !------------------------------[Local parameters]------------------------------! - integer, parameter :: A_POW = 8.3 - integer, parameter :: B_POW = 1.0/7.0 + real, parameter :: A_POW = 8.3 + real, parameter :: B_POW = 1.0/7.0 !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -39,7 +39,7 @@ subroutine Vis_T_Subgrid(Turb) end if if(Turb % model .eq. LES_SMAGORINSKY) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() lf = Grid % vol(c)**ONE_THIRD nu = Flow % viscosity(c) / Flow % density(c) @@ -62,7 +62,7 @@ subroutine Vis_T_Subgrid(Turb) end do else if(Turb % model .eq. LES_DYNAMIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() lf = Grid % vol(c) ** ONE_THIRD Turb % vis_t(c) = Flow % density(c) & * (lf*lf) & ! delta^2 @@ -71,7 +71,7 @@ subroutine Vis_T_Subgrid(Turb) end do else if(Turb % model .eq. LES_WALE) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() lf = Grid % vol(c)**ONE_THIRD Turb % vis_t(c) = Flow % density(c) & * (lf*lf) & ! delta^2 @@ -85,7 +85,7 @@ subroutine Vis_T_Subgrid(Turb) ! buoyancy according to Eidson, T., JFM, 1985 ! !-------------------------------------------------! if(Flow % buoyancy .eq. THERMALLY_DRIVEN) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() nc2 = max(- Flow % beta * ( Flow % grav_x * t % x(c) & + Flow % grav_y * t % y(c) & + Flow % grav_z * t % z(c)), 0.0) @@ -127,7 +127,7 @@ subroutine Vis_T_Subgrid(Turb) kin_vis = Flow % viscosity(c1) / Flow % density(c1) ! Set up roughness coefficient - z_o = Turb % Roughness_Coefficient(c1, c2) + z_o = Turb % Roughness_Coeff(c1, c2) u_tan = Flow % U_Tan(s) @@ -164,9 +164,7 @@ subroutine Vis_T_Subgrid(Turb) pr_t = Turb % Prandtl_Turb(c1) pr = Flow % Prandtl_Numb(c1) ! laminar Prandtl number - beta = 9.24 * ((pr/pr_t)**0.75 - 1.0) & - * (1.0 + 0.28 * exp(-0.007*pr/pr_t)) - + beta = Turb % Beta_Scalar(pr, pr_t) ! According to Toparlar et al. 2019 paper ! "CFD simulation of the near-neutral atmospheric boundary layer: New ! temperature inlet profile consistent with wall functions" @@ -186,9 +184,7 @@ subroutine Vis_T_Subgrid(Turb) u_plus = u_tan / u_tau sc = Flow % Schmidt_Numb(c1) ! laminar Schmidt number - beta = 9.24 * ((sc/sc_t)**0.75 - 1.0) & - * (1.0 + 0.28 * exp(-0.007*sc/sc_t)) - + beta = Turb % Beta_Scalar(sc, sc_t) ! According to Toparlar et al. 2019 paper ! "CFD simulation of the near-neutral atmospheric boundary layer: New ! temperature inlet profile consistent with wall functions" @@ -196,12 +192,11 @@ subroutine Vis_T_Subgrid(Turb) beta = 0.0 end if - ebf = 0.01 * (sc * Turb % y_plus(c1)**4 & - / ((1.0 + 5.0 * sc**3 * Turb % y_plus(c1)) + TINY)) + ebf = Turb % Ebf_Scalar(c1, sc) Turb % diff_w(c1) = Turb % y_plus(c1) & * (Flow % viscosity(c1)/Flow % density(c1)) & / (Turb % y_plus(c1) * sc * exp(-1.0 * ebf) & - + (u_plus + beta) * sc_t * exp(-1.0 / ebf) + TINY) + + (u_plus + beta) * sc_t * exp(-1.0 / ebf) + TINY) end if end if ! Grid % Bnd_Cond_Type(c2) .eq. WALL or WALLFL diff --git a/Sources/Process/Turb_Mod/Vis_T_Tensorial.f90 b/Sources/Process/Turb_Mod/Vis_T_Tensorial.f90 index 61be6f340..25223d901 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Tensorial.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Tensorial.f90 @@ -51,7 +51,7 @@ subroutine Vis_T_Tensorial(Turb) Turb % tau_32 = 0.0 Turb % tau_33 = 0.0 - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() ixp = ( 0.5 * ( Grid % ixx (c) & - Grid % iyy (c) & - Grid % izz (c) ) ) ! I'xx (I'11) diff --git a/Sources/Process/Turb_Mod/Vis_T_Wale.f90 b/Sources/Process/Turb_Mod/Vis_T_Wale.f90 index ecbab9990..4a4187810 100644 --- a/Sources/Process/Turb_Mod/Vis_T_Wale.f90 +++ b/Sources/Process/Turb_Mod/Vis_T_Wale.f90 @@ -29,7 +29,7 @@ subroutine Vis_T_Wale(Turb) ! SGS terms ! ! ! !---------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() s11 = u % x(c) s22 = v % y(c) s33 = w % z(c) diff --git a/Sources/Process/Turb_Mod/Y_Plus_Rough_Walls.f90 b/Sources/Process/Turb_Mod/Y_Plus_Rough_Walls.f90 index 8e2e72031..57427c33b 100644 --- a/Sources/Process/Turb_Mod/Y_Plus_Rough_Walls.f90 +++ b/Sources/Process/Turb_Mod/Y_Plus_Rough_Walls.f90 @@ -7,6 +7,8 @@ real function Y_Plus_Rough_Walls(Turb, u_tau, wall_dist, kin_vis, z_o) !---------------------------------[Arguments]----------------------------------! class(Turb_Type) :: Turb real :: u_tau, wall_dist, kin_vis, z_o +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Turb) !==============================================================================! Y_Plus_Rough_Walls = u_tau * (wall_dist + z_o) / kin_vis diff --git a/Sources/Process/User_Mod.f90 b/Sources/Process/User_Mod.f90 index d46025ae4..07ba68b5f 100644 --- a/Sources/Process/User_Mod.f90 +++ b/Sources/Process/User_Mod.f90 @@ -1,3 +1,6 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" + !==============================================================================! module User_Mod !------------------------------------------------------------------------------! @@ -11,36 +14,36 @@ module User_Mod implicit none !==============================================================================! - include "User_Mod/Types.f90" +# include "User_Mod/Types.f90" contains - include "User_Mod/Before_Exit.f90" - include "User_Mod/Beginning_Of_Compute_Energy.f90" - include "User_Mod/Beginning_Of_Compute_Momentum.f90" - include "User_Mod/Beginning_Of_Compute_Pressure.f90" - include "User_Mod/Beginning_Of_Compute_Scalar.f90" - include "User_Mod/Beginning_Of_Correct_Velocity.f90" - include "User_Mod/Beginning_Of_Iteration.f90" - include "User_Mod/Beginning_Of_Simulation.f90" - include "User_Mod/Beginning_Of_Time_Step.f90" - include "User_Mod/Bulk_Velocity.f90" - include "User_Mod/Calculate_Mean.f90" - include "User_Mod/End_Of_Compute_Energy.f90" - include "User_Mod/End_Of_Compute_Momentum.f90" - include "User_Mod/End_Of_Compute_Pressure.f90" - include "User_Mod/End_Of_Compute_Scalar.f90" - include "User_Mod/End_Of_Correct_Velocity.f90" - include "User_Mod/End_Of_Iteration.f90" - include "User_Mod/End_Of_Simulation.f90" - include "User_Mod/End_Of_Time_Step.f90" - include "User_Mod/Initialize_Variables.f90" - include "User_Mod/Insert_Particles.f90" - include "User_Mod/Interface_Exchange.f90" - include "User_Mod/Force.f90" - include "User_Mod/Save_Results.f90" - include "User_Mod/Save_Swarm.f90" - include "User_Mod/Source.f90" +# include "User_Mod/Before_Exit.f90" +# include "User_Mod/Beginning_Of_Compute_Energy.f90" +# include "User_Mod/Beginning_Of_Compute_Momentum.f90" +# include "User_Mod/Beginning_Of_Compute_Pressure.f90" +# include "User_Mod/Beginning_Of_Compute_Scalar.f90" +# include "User_Mod/Beginning_Of_Correct_Velocity.f90" +# include "User_Mod/Beginning_Of_Iteration.f90" +# include "User_Mod/Beginning_Of_Simulation.f90" +# include "User_Mod/Beginning_Of_Time_Step.f90" +# include "User_Mod/Bulk_Velocity.f90" +# include "User_Mod/Calculate_Mean.f90" +# include "User_Mod/End_Of_Compute_Energy.f90" +# include "User_Mod/End_Of_Compute_Momentum.f90" +# include "User_Mod/End_Of_Compute_Pressure.f90" +# include "User_Mod/End_Of_Compute_Scalar.f90" +# include "User_Mod/End_Of_Correct_Velocity.f90" +# include "User_Mod/End_Of_Iteration.f90" +# include "User_Mod/End_Of_Simulation.f90" +# include "User_Mod/End_Of_Time_Step.f90" +# include "User_Mod/Initialize_Variables.f90" +# include "User_Mod/Insert_Particles.f90" +# include "User_Mod/Interface_Exchange.f90" +# include "User_Mod/Force.f90" +# include "User_Mod/Save_Results.f90" +# include "User_Mod/Save_Swarm.f90" +# include "User_Mod/Source.f90" end module diff --git a/Sources/Process/User_Mod/Beginning_Of_Compute_Energy.f90 b/Sources/Process/User_Mod/Beginning_Of_Compute_Energy.f90 index 5929682f0..52a4f4d14 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Compute_Energy.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Compute_Energy.f90 @@ -1,17 +1,14 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Compute_Energy(Flow, Turb, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_Beginning_Of_Compute_Energy(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the beginning of Compute_Energy function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: t, p diff --git a/Sources/Process/User_Mod/Beginning_Of_Compute_Momentum.f90 b/Sources/Process/User_Mod/Beginning_Of_Compute_Momentum.f90 index 4a7e4a493..7d68ac118 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Compute_Momentum.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Compute_Momentum.f90 @@ -1,17 +1,14 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Compute_Momentum(Flow, Turb, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_Beginning_Of_Compute_Momentum(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the beginning of Compute_Momentum function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, p diff --git a/Sources/Process/User_Mod/Beginning_Of_Compute_Pressure.f90 b/Sources/Process/User_Mod/Beginning_Of_Compute_Pressure.f90 index d8d6cd360..7347f7a4c 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Compute_Pressure.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Compute_Pressure.f90 @@ -1,16 +1,13 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Compute_Pressure(Flow, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_Beginning_Of_Compute_Pressure(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the beginning of Compute_Pressure function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, p diff --git a/Sources/Process/User_Mod/Beginning_Of_Compute_Scalar.f90 b/Sources/Process/User_Mod/Beginning_Of_Compute_Scalar.f90 index 5d865c96c..f7981c19f 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Compute_Scalar.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Compute_Scalar.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Compute_Scalar(Flow, Turb, Vof, Sol, & - curr_dt, ini, sc) + subroutine User_Mod_Beginning_Of_Compute_Scalar(Flow, Turb, Vof, Sol, sc) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Scalar function. ! !------------------------------------------------------------------------------! @@ -10,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Compute_Scalar(Flow, Turb, Vof, Sol, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration integer, intent(in) :: sc ! scalar index !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid diff --git a/Sources/Process/User_Mod/Beginning_Of_Compute_Vof.f90 b/Sources/Process/User_Mod/Beginning_Of_Compute_Vof.f90 index 5baf9b35c..0efaa329e 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Compute_Vof.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Compute_Vof.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Compute_Vof(Vof, Sol, curr_dt) + subroutine User_Mod_Beginning_Of_Compute_Vof(Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the beginning of Compute_Vof function. ! !------------------------------------------------------------------------------! @@ -7,7 +7,6 @@ subroutine User_Mod_Beginning_Of_Compute_Vof(Vof, Sol, curr_dt) !---------------------------------[Arguments]----------------------------------! type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow @@ -19,5 +18,11 @@ subroutine User_Mod_Beginning_Of_Compute_Vof(Vof, Sol, curr_dt) Flow => Vof % pnt_flow Grid => Flow % pnt_grid fun => Vof % fun + A => Sol % Nat % A + + if(Time % Curr_Dt() > 120) then + ! Do something + + end if end subroutine diff --git a/Sources/Process/User_Mod/Beginning_Of_Correct_Velocity.f90 b/Sources/Process/User_Mod/Beginning_Of_Correct_Velocity.f90 index 2ba8ae04f..0254a6d33 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Correct_Velocity.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Correct_Velocity.f90 @@ -1,16 +1,13 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the beginning of Correct_Velocity function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, p diff --git a/Sources/Process/User_Mod/Beginning_Of_Iteration.f90 b/Sources/Process/User_Mod/Beginning_Of_Iteration.f90 index f7067b2d5..5577673c6 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Iteration.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Iteration.f90 @@ -1,17 +1,14 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, & - curr_dt, time) + subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of iteration. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi diff --git a/Sources/Process/User_Mod/Beginning_Of_Simulation.f90 b/Sources/Process/User_Mod/Beginning_Of_Simulation.f90 index 5281cc00a..9ea72abc8 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Simulation.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Simulation.f90 @@ -1,17 +1,14 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & - curr_dt, time) + subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of simulation. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !==============================================================================! end subroutine diff --git a/Sources/Process/User_Mod/Beginning_Of_Time_Step.f90 b/Sources/Process/User_Mod/Beginning_Of_Time_Step.f90 index 23b1f5026..271b71557 100644 --- a/Sources/Process/User_Mod/Beginning_Of_Time_Step.f90 +++ b/Sources/Process/User_Mod/Beginning_Of_Time_Step.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, & - curr_dt, time) + subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -10,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi diff --git a/Sources/Process/User_Mod/Calculate_Mean.f90 b/Sources/Process/User_Mod/Calculate_Mean.f90 index 44cf7b9e9..a19507438 100644 --- a/Sources/Process/User_Mod/Calculate_Mean.f90 +++ b/Sources/Process/User_Mod/Calculate_Mean.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Calculate_Mean(Turb, n0, n1) + subroutine User_Mod_Calculate_Mean(Turb, n0) !------------------------------------------------------------------------------! ! User-defined calculation of time-averaged values. ! ! Follow Turb_Mod/Calculate_Mean.f90 as guideline for this function. ! @@ -8,7 +8,6 @@ subroutine User_Mod_Calculate_Mean(Turb, n0, n1) !---------------------------------[Arguments]----------------------------------! type(Turb_Type), target :: Turb integer, intent(in) :: n0 - integer, intent(in) :: n1 !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -17,7 +16,7 @@ subroutine User_Mod_Calculate_Mean(Turb, n0, n1) if(.not. Turb % statistics) return - n = n1 - n0 + n = Time % Curr_Dt() - n0 ! Take aliases Flow => Turb % pnt_flow diff --git a/Sources/Process/User_Mod/End_Of_Compute_Energy.f90 b/Sources/Process/User_Mod/End_Of_Compute_Energy.f90 index df98cb251..618c25b4f 100644 --- a/Sources/Process/User_Mod/End_Of_Compute_Energy.f90 +++ b/Sources/Process/User_Mod/End_Of_Compute_Energy.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Energy function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: t, p diff --git a/Sources/Process/User_Mod/End_Of_Compute_Momentum.f90 b/Sources/Process/User_Mod/End_Of_Compute_Momentum.f90 index 02984e13d..e6f76f6cd 100644 --- a/Sources/Process/User_Mod/End_Of_Compute_Momentum.f90 +++ b/Sources/Process/User_Mod/End_Of_Compute_Momentum.f90 @@ -1,17 +1,14 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Momentum function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, p diff --git a/Sources/Process/User_Mod/End_Of_Compute_Pressure.f90 b/Sources/Process/User_Mod/End_Of_Compute_Pressure.f90 index c872b75bc..60bbaa1b2 100644 --- a/Sources/Process/User_Mod/End_Of_Compute_Pressure.f90 +++ b/Sources/Process/User_Mod/End_Of_Compute_Pressure.f90 @@ -1,15 +1,13 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Pressure function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, p diff --git a/Sources/Process/User_Mod/End_Of_Compute_Scalar.f90 b/Sources/Process/User_Mod/End_Of_Compute_Scalar.f90 index 0600d3464..cb68afb31 100644 --- a/Sources/Process/User_Mod/End_Of_Compute_Scalar.f90 +++ b/Sources/Process/User_Mod/End_Of_Compute_Scalar.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Scalar(Flow, Turb, Vof, Sol, & - curr_dt, ini, sc) + subroutine User_Mod_End_Of_Compute_Scalar(Flow, Turb, Vof, Sol, sc) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Scalar function. ! !------------------------------------------------------------------------------! @@ -10,9 +9,7 @@ subroutine User_Mod_End_Of_Compute_Scalar(Flow, Turb, Vof, Sol, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration - integer, intent(in) :: sc ! scalar index + integer, intent(in) :: sc ! scalar index !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: phi, p diff --git a/Sources/Process/User_Mod/End_Of_Compute_Vof.f90 b/Sources/Process/User_Mod/End_Of_Compute_Vof.f90 index 898e9ae5f..a8d2adae5 100644 --- a/Sources/Process/User_Mod/End_Of_Compute_Vof.f90 +++ b/Sources/Process/User_Mod/End_Of_Compute_Vof.f90 @@ -1,13 +1,12 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol, curr_dt) + subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Vof function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow @@ -19,5 +18,11 @@ subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol, curr_dt) Flow => Vof % pnt_flow Grid => Flow % pnt_grid fun => Vof % fun + A => Sol % Nat % A + + if(Time % Curr_Dt() > 120) then + ! Do something + + end if end subroutine diff --git a/Sources/Process/User_Mod/End_Of_Correct_Velocity.f90 b/Sources/Process/User_Mod/End_Of_Correct_Velocity.f90 index 86212faad..927addd51 100644 --- a/Sources/Process/User_Mod/End_Of_Correct_Velocity.f90 +++ b/Sources/Process/User_Mod/End_Of_Correct_Velocity.f90 @@ -1,15 +1,13 @@ !==============================================================================! - subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Correct_Velocity function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, p diff --git a/Sources/Process/User_Mod/End_Of_Iteration.f90 b/Sources/Process/User_Mod/End_Of_Iteration.f90 index 022c2c291..1a6293da2 100644 --- a/Sources/Process/User_Mod/End_Of_Iteration.f90 +++ b/Sources/Process/User_Mod/End_Of_Iteration.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_End_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_End_Of_Iteration(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !==============================================================================! end subroutine diff --git a/Sources/Process/User_Mod/End_Of_Simulation.f90 b/Sources/Process/User_Mod/End_Of_Simulation.f90 index c0084b136..e0ef719eb 100644 --- a/Sources/Process/User_Mod/End_Of_Simulation.f90 +++ b/Sources/Process/User_Mod/End_Of_Simulation.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_End_Of_Simulation(Flow, Turb, Vof, Swarm, curr_dt, time) + subroutine User_Mod_End_Of_Simulation(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the end of simulation. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !==============================================================================! end subroutine diff --git a/Sources/Process/User_Mod/End_Of_Time_Step.f90 b/Sources/Process/User_Mod/End_Of_Time_Step.f90 index f9dbab005..e0ee8e0b9 100644 --- a/Sources/Process/User_Mod/End_Of_Time_Step.f90 +++ b/Sources/Process/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! start time step for Turb. stat. integer, intent(in) :: n_stat_p ! start time step for Swarm. stat. - real, intent(in) :: time ! physical time !==============================================================================! end subroutine diff --git a/Sources/Process/User_Mod/Initialize_Variables.f90 b/Sources/Process/User_Mod/Initialize_Variables.f90 index 74d1bf5ee..04bcfd307 100644 --- a/Sources/Process/User_Mod/Initialize_Variables.f90 +++ b/Sources/Process/User_Mod/Initialize_Variables.f90 @@ -20,18 +20,13 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! Remove the following 12 lines in real Lagrangian tracking simulations if(Flow % with_interface .and. .not. Vof % init_stl) then - if(this_proc < 2) then - print '(a)','#======================================================' // & - '=======================================================' - print '(a)','# ERROR: You are running a Volume of Fluid simulation' // & - 'with the default version of Initialize_Variables.' - print '(a)','# You have probably forgotten to compile Process with ' // & - 'DIR_CASE= directive.' - print '(a)','#------------------------------------------------------' // & - '-------------------------------------------------------' - end if - call Comm_Mod_End - stop + call Message % Error(96, & + 'You are running a Volume of Fluid simulation with the ' // & + 'default version of Initialize_Variables, and you did ' // & + 'not provide an STL file for initialization. You might' // & + 'have forgotten to compile Process with ' // & + 'DIR_CASE= directive.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Process/User_Mod/Insert_Particles.f90 b/Sources/Process/User_Mod/Insert_Particles.f90 index b65dc4a01..1e04f6bfc 100644 --- a/Sources/Process/User_Mod/Insert_Particles.f90 +++ b/Sources/Process/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! Insert particles for Lagrangian particle tracking ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi @@ -20,15 +18,11 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) Grid => Flow % pnt_grid ! Remove the following six lines in real Lagrangian tracking simulations - if(this_proc < 2) then - print *, '#======================================================' // & - '=======================================================' - print *, '# WARNING: You are running a Lagrangian tracking simulation' // & - 'with the default version of Insert_Particles.' - print *, '# You have probably forgotten to compile Process with ' // & - 'DIR_CASE= directive.' - print *, '#------------------------------------------------------' // & - '-------------------------------------------------------' - end if + call Message % Warning(72, & + 'You are running a Lagrangian tracking simulation ' // & + 'with the default version of Insert_Particles. You ' // & + 'have probably forgotten to compile Process with ' // & + 'DIR_CASE= directive.', & + file=__FILE__, line=__LINE__) end subroutine diff --git a/Sources/Process/User_Mod/Save_Results.f90 b/Sources/Process/User_Mod/Save_Results.f90 index f46b8e77a..13ebd38f5 100644 --- a/Sources/Process/User_Mod/Save_Results.f90 +++ b/Sources/Process/User_Mod/Save_Results.f90 @@ -1,17 +1,16 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine is called each RESULTS_SAVE_INTERVAL (set in control ! ! file), at the end of a simulation and after 'save_now' command. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step - integer, optional :: domain + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm + integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk diff --git a/Sources/Process/User_Mod/Save_Swarm.f90 b/Sources/Process/User_Mod/Save_Swarm.f90 index 20c8855fc..439e9e6c8 100644 --- a/Sources/Process/User_Mod/Save_Swarm.f90 +++ b/Sources/Process/User_Mod/Save_Swarm.f90 @@ -1,17 +1,16 @@ !==============================================================================! - subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine is called each RESULTS_SAVE_INTERVAL (set in control ! ! file), at the end of a simulation and after 'save_now' command. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step - integer, optional :: domain + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm + integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk diff --git a/Sources/Process/Var_Mod/Bnd_Cond_Name.f90 b/Sources/Process/Var_Mod/Bnd_Cond_Name.f90 index 616ece53b..02e1442ce 100644 --- a/Sources/Process/Var_Mod/Bnd_Cond_Name.f90 +++ b/Sources/Process/Var_Mod/Bnd_Cond_Name.f90 @@ -9,7 +9,7 @@ character(SL) function Var_Mod_Bnd_Cond_Name(phi, bnd_cell) integer :: bnd_cell !------------------------------------------------------------------------------! - Var_Mod_Bnd_Cond_Name = phi % pnt_grid % Bnd_Cond_Name(bnd_cell) + Var_Mod_Bnd_Cond_Name = phi % pnt_grid % Bnd_Cond_Name_At_Cell(bnd_cell) end function diff --git a/Sources/Process/Vof_Mod.f90 b/Sources/Process/Vof_Mod.f90 index cf692b4a1..d70a199c8 100644 --- a/Sources/Process/Vof_Mod.f90 +++ b/Sources/Process/Vof_Mod.f90 @@ -1,4 +1,6 @@ #include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" +#include "../Shared/Unused.h90" !==============================================================================! module Vof_Mod diff --git a/Sources/Process/Vof_Mod/Core/Compute_Vof.f90 b/Sources/Process/Vof_Mod/Core/Compute_Vof.f90 index 0aef69e91..3cbf54b1f 100644 --- a/Sources/Process/Vof_Mod/Core/Compute_Vof.f90 +++ b/Sources/Process/Vof_Mod/Core/Compute_Vof.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Compute_Vof(Vof, Sol, dt, curr_dt) + subroutine Compute_Vof(Vof, Sol, dt) !------------------------------------------------------------------------------! ! Solves Volume Fraction equation using UPWIND ADVECTION and CICSAM ! !------------------------------------------------------------------------------! @@ -8,7 +8,6 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) class(Vof_Type), target :: Vof type(Solver_Type), target :: Sol real :: dt - integer, intent(in) :: curr_dt ! current time step !-----------------------------------[Locals]-----------------------------------! type(Field_Type), pointer :: Flow type(Grid_Type), pointer :: Grid @@ -21,12 +20,12 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) real, contiguous, pointer :: c_d(:) real :: courant_max integer :: i_sub, n_sub, wrong_vf, n_wrong_vf0, n_wrong_vf1 - integer :: s, c, c1, c2, fu, corr + integer :: s, c, c1, c2, fu, corr, reg !==============================================================================! call Profiler % Start('Compute_Vof (without solvers)') - call User_Mod_Beginning_Of_Compute_Vof(Vof, Sol, curr_dt) + call User_Mod_Beginning_Of_Compute_Vof(Vof, Sol) ! Take aliases Flow => Vof % pnt_flow @@ -51,9 +50,9 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) ! Warning if Courant Number is exceeded if(n_sub > 1) then - if(this_proc < 2) then + if(First_Proc()) then call File % Append_For_Writing_Ascii('alert-dt-vof.dat', fu) - write(fu,*) 'Courant Number was exceded at iteration: ', curr_dt + write(fu,*) 'Courant Number exceded at iteration: ', Time % Curr_Dt() write(fu,*) 'Co_max = ', courant_max write(fu,*) 'Try reducing time step' close(fu) @@ -82,12 +81,12 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) !-----------------------------! ! Correct Volume Fraction ! !-----------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() fun % n(c) = max(min(fun % n(c),1.0),0.0) end do else if(fun % adv_scheme .eq. CICSAM .or. & - fun % adv_scheme .eq. STACS) then + fun % adv_scheme .eq. STACS) then do i_sub = 1, n_sub @@ -99,15 +98,16 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) !---------------------------! ! Impose zero gradient at boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .ne. INFLOW) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + fun % n(c2) = fun % n(c1) - end if - end if - end do + end do ! faces + end if ! inflow + end do ! region ! Old volume fraction: fun % o(:) = fun % n(:) @@ -127,22 +127,23 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) ! Solve System call Vof % Solve_System(Sol, b) - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .ne. INFLOW) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + fun % n(c2) = fun % n(c1) - end if - end if - end do + end do ! faces + end if ! inflow + end do ! region n_wrong_vf0 = 0 n_wrong_vf1 = 0 wrong_vf = 0 ! Determine if 0 <= fun <= 1.0 - do c = 1, Grid % n_cells + do c = Cells_In_Domain() if(fun % n(c) < -fun % tol) then n_wrong_vf0 = n_wrong_vf0 + 1 end if @@ -162,7 +163,7 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) wrong_vf = 1 end if - call Comm_Mod_Global_Sum_Int(wrong_vf) + call Global % Sum_Int(wrong_vf) if(wrong_vf == 0) then goto 1 @@ -176,27 +177,26 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) !------------------------! ! Correct boundaries ! !------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type( c2) .ne. INFLOW) then if(fun % n(c2) < FEMTO) then fun % n(c2) = 0.0 end if if(fun % n(c2) - 1.0 >= FEMTO) then fun % n(c2) = 1.0 end if - end if - end if - - end do + end do ! faces + end if ! inflow + end do ! region !--------------------------------------! ! Correct Interior Volume Fraction ! !--------------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() if(fun % n(c) < FEMTO) then fun % n(c) = 0.0 end if @@ -218,41 +218,36 @@ subroutine Compute_Vof(Vof, Sol, dt, curr_dt) if(fun % adv_scheme .eq. UPWIND) then ! At boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .ne. INFLOW) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + fun % n(c2) = fun % n(c1) - end if - end if - end do + end do ! faces + end if ! inflow + end do ! region else if(fun % adv_scheme .eq. CICSAM .or. fun % adv_scheme .eq. STACS) then ! At boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW) then - fun % n(c2) = fun % n(c1) - else if(Grid % Bnd_Cond_Type(c2) .eq. PRESSURE) then - fun % n(c2) = fun % n(c1) - else if(Grid % Bnd_Cond_Type(c2) .eq. CONVECT) then - fun % n(c2) = fun % n(c1) - else if(Grid % Bnd_Cond_Type(c2) .eq. INFLOW) then - else + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + fun % n(c2) = fun % n(c1) - end if - end if - end do + end do ! faces + end if ! inflow + end do ! region end if call Flow % Grad_Variable(fun) - call User_Mod_End_Of_Compute_Vof(Vof, Sol, curr_dt) + call User_Mod_End_Of_Compute_Vof(Vof, Sol) call Profiler % Stop('Compute_Vof (without solvers)') diff --git a/Sources/Process/Vof_Mod/Core/Correct_Beta.f90 b/Sources/Process/Vof_Mod/Core/Correct_Beta.f90 index 2c569a35e..db3f61fd9 100644 --- a/Sources/Process/Vof_Mod/Core/Correct_Beta.f90 +++ b/Sources/Process/Vof_Mod/Core/Correct_Beta.f90 @@ -26,62 +26,58 @@ subroutine Correct_Beta(Vof) c_d => Vof % c_d ! Interior faces - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then + if(abs(v_flux % n(s)) > FEMTO) then - if(abs(v_flux % n(s)) > FEMTO) then - - if(v_flux % n(s) > 0.0) then - donor = c1 - accept = c2 - else - donor = c2 - accept = c1 - end if + if(v_flux % n(s) > 0.0) then + donor = c1 + accept = c2 + else + donor = c2 + accept = c1 + end if - !--------------------! - ! Correct beta_f ! - !--------------------! - bcorr = 0.0 - delta_alfa = 0.5 * (fun % n(accept) + fun % o(accept) & - - (fun % n(donor) + fun % o(donor))) + !--------------------! + ! Correct beta_f ! + !--------------------! + bcorr = 0.0 + delta_alfa = 0.5 * (fun % n(accept) + fun % o(accept) & + - (fun % n(donor) + fun % o(donor))) - cf = c_d(donor) + cf = c_d(donor) - if(fun % n(donor) < 0.0) then - e_minus = max(-fun % n(donor), 0.0) - ! Donor value < 0.0 Ex: sd = -0.1 -> e_minus = +0.1 - if(e_minus > FEMTO .and. cf > FEMTO) then - if(delta_alfa > e_minus) then - bcorr = e_minus * (2.0 + cf - 2.0 * cf * beta_f(s)) & - / (2.0 * cf * (delta_alfa - e_minus)) - bcorr = min(bcorr, beta_f(s)) - end if + if(fun % n(donor) < 0.0) then + e_minus = max(-fun % n(donor), 0.0) + ! Donor value < 0.0 Ex: sd = -0.1 -> e_minus = +0.1 + if(e_minus > FEMTO .and. cf > FEMTO) then + if(delta_alfa > e_minus) then + bcorr = e_minus * (2.0 + cf - 2.0 * cf * beta_f(s)) & + / (2.0 * cf * (delta_alfa - e_minus)) + bcorr = min(bcorr, beta_f(s)) end if end if + end if - if(fun % n(donor) > 1.0) then - e_plus = max(fun % n(donor) - 1.0, 0.0) - ! Donor value > 1.0 Ex: sd = 1.1 -> e_plus = +0.1 - if(e_plus > FEMTO .and. cf > FEMTO) then - if(delta_alfa < - e_plus) then - bcorr = e_plus * (2.0 + cf - 2.0 * cf * beta_f(s)) & - / (2.0 * cf * (-delta_alfa - e_plus)) - bcorr = min(bcorr, beta_f(s)) - end if + if(fun % n(donor) > 1.0) then + e_plus = max(fun % n(donor) - 1.0, 0.0) + ! Donor value > 1.0 Ex: sd = 1.1 -> e_plus = +0.1 + if(e_plus > FEMTO .and. cf > FEMTO) then + if(delta_alfa < - e_plus) then + bcorr = e_plus * (2.0 + cf - 2.0 * cf * beta_f(s)) & + / (2.0 * cf * (-delta_alfa - e_plus)) + bcorr = min(bcorr, beta_f(s)) end if - end if - beta_f(s) = beta_f(s) - bcorr - beta_f(s) = max(beta_f(s), 0.0) - end if - end if ! c2 > 0 + beta_f(s) = beta_f(s) - bcorr + beta_f(s) = max(beta_f(s), 0.0) + + end if end do diff --git a/Sources/Process/Vof_Mod/Core/Discretize.f90 b/Sources/Process/Vof_Mod/Core/Discretize.f90 index 2befc2f6c..678e4ca02 100644 --- a/Sources/Process/Vof_Mod/Core/Discretize.f90 +++ b/Sources/Process/Vof_Mod/Core/Discretize.f90 @@ -16,7 +16,7 @@ subroutine Discretize(Vof, A, b, dt) type(Var_Type), pointer :: fun type(Front_Type), pointer :: Front real, contiguous, pointer :: beta_f(:) - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: upwd1, upwd2, upwd3, a0 !==============================================================================! @@ -32,87 +32,94 @@ subroutine Discretize(Vof, A, b, dt) b = 0.0 A % val = 0.0 - !-------------------------! - ! Matrix Coefficients ! - !-------------------------! + !------------------------------------! + ! Matrix coefficients for UPWIND ! + !------------------------------------! if(fun % adv_scheme .eq. UPWIND) then ! At boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if( Grid % region % type(reg) .eq. OUTFLOW & + .or. Grid % region % type(reg) .eq. CONVECT & + .or. Grid % region % type(reg) .eq. PRESSURE) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. INFLOW) then - b(c1) = b(c1) - v_flux % n(s) * fun % n(c2) - else if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW) then A % val(A % dia(c1)) = A % val(A % dia(c1)) + v_flux % n(s) - end if - end if + end do + else if(Grid % region % type(reg) .eq. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - end do + b(c1) = b(c1) - v_flux % n(s) * fun % n(c2) + end do + end if ! outflow or inflow + end do ! regions ! Interior faces - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - - upwd1 = 0.5 * max( v_flux % n(s), 0.0) - upwd2 = 0.5 * max(-v_flux % n(s), 0.0) - A % val(A % dia(c1)) = A % val(A % dia(c1)) + upwd1 - A % val(A % dia(c2)) = A % val(A % dia(c2)) + upwd2 + upwd1 = 0.5 * max( v_flux % n(s), 0.0) + upwd2 = 0.5 * max(-v_flux % n(s), 0.0) - A % val(A % pos(1,s)) = - upwd2 - A % val(A % pos(2,s)) = - upwd1 + A % val(A % dia(c1)) = A % val(A % dia(c1)) + upwd1 + A % val(A % dia(c2)) = A % val(A % dia(c2)) + upwd2 - b(c1) = b(c1) - ( upwd1 * fun % o(c1) - upwd2 * fun % o(c2) ) - b(c2) = b(c2) - ( upwd2 * fun % o(c2) - upwd1 * fun % o(c1) ) + A % val(A % pos(1,s)) = - upwd2 + A % val(A % pos(2,s)) = - upwd1 - end if + b(c1) = b(c1) - ( upwd1 * fun % o(c1) - upwd2 * fun % o(c2) ) + b(c2) = b(c2) - ( upwd2 * fun % o(c2) - upwd1 * fun % o(c1) ) end do + !----------------------------------------------! + ! Matrix coefficients for CICSAM and STACS ! + !----------------------------------------------! else if(fun % adv_scheme .eq. CICSAM .or. & fun % adv_scheme .eq. STACS) then ! At boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + if( Grid % region % type(reg) .eq. OUTFLOW & + .or. Grid % region % type(reg) .eq. CONVECT & + .or. Grid % region % type(reg) .eq. PRESSURE) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) - if(Grid % Bnd_Cond_Type(c2) .eq. OUTFLOW) then A % val(A % dia(c1)) = A % val(A % dia(c1)) + v_flux % n(s) - else - b(c1) = b(c1) - v_flux % n(s) * fun % n(c2) - end if + end do + else + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) - end if - end do + b(c1) = b(c1) - v_flux % n(s) * fun % n(c2) + end do + end if ! outflow or inflow + end do ! regions ! Interior faces - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - - upwd1 = (0.5 - beta_f(s)) * max(-v_flux % n(s), 0.0) & - - 0.5 * beta_f(s) * v_flux % n(s) - upwd2 = (0.5 - beta_f(s)) * max(+v_flux % n(s), 0.0) & - + 0.5 * beta_f(s) * v_flux % n(s) - upwd3 = 0.5 * v_flux % n(s) - A % val(A % dia(c1)) = A % val(A % dia(c1)) + upwd1 + upwd3 - A % val(A % dia(c2)) = A % val(A % dia(c2)) + upwd2 - upwd3 + upwd1 = (0.5 - beta_f(s)) * max(-v_flux % n(s), 0.0) & + - 0.5 * beta_f(s) * v_flux % n(s) + upwd2 = (0.5 - beta_f(s)) * max(+v_flux % n(s), 0.0) & + + 0.5 * beta_f(s) * v_flux % n(s) + upwd3 = 0.5 * v_flux % n(s) - A % val(A % pos(1,s)) = - upwd1 - A % val(A % pos(2,s)) = - upwd2 + A % val(A % dia(c1)) = A % val(A % dia(c1)) + upwd1 + upwd3 + A % val(A % dia(c2)) = A % val(A % dia(c2)) + upwd2 - upwd3 - b(c1) = b(c1) - (upwd1 + upwd3) * fun % o(c1) + upwd1 * fun % o(c2) - b(c2) = b(c2) - (upwd2 - upwd3) * fun % o(c2) + upwd2 * fun % o(c1) + A % val(A % pos(1,s)) = - upwd1 + A % val(A % pos(2,s)) = - upwd2 - end if + b(c1) = b(c1) - (upwd1 + upwd3) * fun % o(c1) + upwd1 * fun % o(c2) + b(c2) = b(c2) - (upwd2 - upwd3) * fun % o(c2) + upwd2 * fun % o(c1) end do end if @@ -124,7 +131,7 @@ subroutine Discretize(Vof, A, b, dt) ! Two time levels; linear interpolation if(fun % td_scheme .eq. LINEAR) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() a0 = Grid % vol(c) / dt A % val(A % dia(c)) = A % val(A % dia(c)) + a0 b(c) = b(c) + a0 * fun % o(c) @@ -133,7 +140,7 @@ subroutine Discretize(Vof, A, b, dt) ! Three time levels; parabolic interpolation if(fun % td_scheme .eq. PARABOLIC) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() a0 = Grid % vol(c) / dt A % val(A % dia(c)) = A % val(A % dia(c)) + 1.5 * a0 b(c) = b(c) + 2.0 * a0 * fun % o(c) - 0.5 * a0 * fun % oo(c) diff --git a/Sources/Process/Vof_Mod/Core/Initialize_From_Stl.f90 b/Sources/Process/Vof_Mod/Core/Initialize_From_Stl.f90 index ea0b8273f..58a1789aa 100644 --- a/Sources/Process/Vof_Mod/Core/Initialize_From_Stl.f90 +++ b/Sources/Process/Vof_Mod/Core/Initialize_From_Stl.f90 @@ -20,16 +20,16 @@ subroutine Initialize_From_Stl(Vof) real, pointer, contiguous :: surf_dist(:), node_dist(:) integer, pointer, contiguous :: dis_nod_int(:), cut_cel(:), glo(:) integer, pointer, contiguous :: set_cel(:), set_old(:) - integer :: b, c, s, i_nod, j_nod, i, j, k1, k2, m - integer :: i_iso, i_ver, i_fac, fac, p + integer :: b, c, c1, c2, s, i_nod, j_nod, i, j, k1, k2, m + integer :: i_iso, i_ver, i_fac, fac, p, reg integer :: n_cut_facets, cut_facets(1024) real :: vol_1, vol_2, vol_3, vol_4, vol_5 - real :: cell_vol, cel0_vol, cel1_vol, d, d1, d2 + real :: cell_vol, cel0_vol, cel1_vol, d real :: p1(3), p2(3), p3(3), qc(3), qn(3) real :: f(3), n(3) integer :: ij_cut(MAX_ISOAP_VERTS, MAX_ISOAP_VERTS) integer :: new_faces_n_nodes, cnt_p, cnt_m - integer :: new_faces_n(MAX_ISOAP_VERTS), processed_cells + integer :: new_faces_n(MAX_ISOAP_VERTS) logical :: flooding !==============================================================================! @@ -60,21 +60,21 @@ subroutine Initialize_From_Stl(Vof) call Work % Connect_Real_Cell(surf_dist, surf_dist_pos, surf_dist_neg) call Work % Connect_Real_Cell(node_dist) - if(Stl % n_boddies > 1 .and. this_proc < 2) then + if(Stl % n_boddies > 1 .and. First_Proc()) then print '(a,i3)', ' # Processing body ', b end if - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # Calculating distance from the STL interface' end if - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() surf_dist_pos(c) = 0.0 surf_dist_neg(c) = 0.0 node_dist(c) = -HUGE end do - do c = 1, Grid % n_cells - if(this_proc < 2) then + do c = Cells_In_Domain() + if(First_Proc()) then write(*,'(a2,f5.0,a14,a1)', advance='no') ' #', & (100.*real(c)/real(Grid % n_cells)), ' % complete...', achar(13) flush(6) @@ -124,8 +124,12 @@ subroutine Initialize_From_Stl(Vof) Grid % xn(i), Grid % yn(i), Grid % zn(i))) end do end do + call Grid % Exchange_Cells_Real(node_dist) + call Grid % Exchange_Cells_Real(surf_dist) + call Grid % Exchange_Cells_Real(surf_dist_pos) + call Grid % Exchange_Cells_Real(surf_dist_neg) - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() node_dist(c) = sqrt(node_dist(c)) end do if(DEBUG) then @@ -154,8 +158,8 @@ subroutine Initialize_From_Stl(Vof) ! the node distance for all nodes in the grid ! ! ! !----------------------------------------------------! - if(this_proc < 2) print '(a)', ' # Searching for cells cut by the STL facets' - do c = 1, Grid % n_cells + if(First_Proc()) print '(a)', ' # Searching for cells cut by the STL facets' + do c = Cells_In_Domain_And_Buffers() ! Fetch cell coordinates qc(1) = Grid % xc(c); qc(2) = Grid % yc(c); qc(3) = Grid % zc(c) @@ -166,7 +170,7 @@ subroutine Initialize_From_Stl(Vof) cut_facets(:) = 0 cut_cel(c) = NO - if(this_proc < 2) then + if(First_Proc()) then write(*,'(a2,f5.0,a14,a1)', advance='no') ' #', & (100. * real(c)/real(Grid % n_cells)), ' % complete...', achar(13) flush(6) @@ -312,13 +316,13 @@ subroutine Initialize_From_Stl(Vof) !---------------------------------------! ! The actual flood fill starts here ! !---------------------------------------! - if(this_proc < 2) write(*, '(a)', advance='no') ' # Flooding ...' + if(First_Proc()) write(*, '(a)', advance='no') ' # Flooding ...' m = 0 1 continue m = m + 1 flooding = .false. - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() if( set_cel(c) .eq. NO ) then flooding = .true. ! flooding is still going on @@ -351,10 +355,10 @@ subroutine Initialize_From_Stl(Vof) dis_nod_int(i) = -1 end do - ! Throw an error if you come to this + ! Throw a warning if you come to this else ! cnt_p == cnt_m if(cnt_p .gt. 0 .and. cnt_m .gt. 0) then - PRINT *, __FILE__, __LINE__, 'HOW ON EARTH? CELL: ', C, CNT_P, CNT_M + ! PRINT *, __FILE__, __LINE__, DENTED CELL: ', C, CNT_P, CNT_M end if end if @@ -369,7 +373,7 @@ subroutine Initialize_From_Stl(Vof) call Grid % Exchange_Cells_Real(vof_body(:,b)) ! Check if the cell has been set in another processor - do c = 1, Grid % n_cells + do c = Cells_In_Domain_And_Buffers() if( set_cel(c) .eq. YES .and. set_old(c) .eq. NO ) then if(vof_body(c, b) < MICRO) then ! the cell was filled with zero do i_nod = 1, abs(Grid % cells_n_nodes(c)) @@ -387,9 +391,9 @@ subroutine Initialize_From_Stl(Vof) end do ! Flood fill still going, go back - call Comm_Mod_Global_Lor_Log(flooding) + call Global % Lor_Log(flooding) if(flooding) goto 1 - if(this_proc < 2) print '(a)', ' done!' + if(First_Proc()) print '(a)', ' done!' if(DEBUG) then call Grid % Save_Debug_Vtu(append="set_cel", & @@ -435,9 +439,9 @@ subroutine Initialize_From_Stl(Vof) ! of VOF, some cells happen to have multiple iso-surfaces ! !---------------------------------------------------------------! if(Iso_Polygons % n_polys > 1) then - print '(4(a,i8))', __FILE__, __LINE__, & - ' # check cell ', c, & - ' in processor ', this_proc, & + print '(4(a,i8))', __FILE__, __LINE__, & + ' # check cell ', c, & + ' in processor ', This_Proc(), & ' global cell ', glo(c) call Polyhedron % Plot_Polyhedron_Vtk("check-cell", glo(c)) call Iso_Polygons % Plot_Iso_polygons_Vtk("check-iso", glo(c)) @@ -607,13 +611,30 @@ subroutine Initialize_From_Stl(Vof) call Work % Disconnect_Real_Cell(node_dist) end do ! through boddies + call Grid % Exchange_Cells_Real(Vof % fun % n) + + !-----------------------------! + ! Set boundary values too ! + !-----------------------------! + do reg = Boundary_Regions() + if(Grid % region % type(reg) .ne. INFLOW) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + + Vof % fun % n(c2) = Vof % fun % n(c1) + end do ! faces + end if ! inflow + end do ! region !------------------------------------! ! Set the old time steps as well ! !------------------------------------! - do c = 1, Grid % n_cells - Vof % fun % o (c) = Vof % fun % n(c) - Vof % fun % oo(c) = Vof % fun % n(c) + do reg = Boundary_Inside_And_Buffer_Regions() + do c = Cells_In_Region(reg) + Vof % fun % o (c) = Vof % fun % n(c) + Vof % fun % oo(c) = Vof % fun % n(c) + end do end do if(DEBUG) then diff --git a/Sources/Process/Vof_Mod/Core/Main_Vof.f90 b/Sources/Process/Vof_Mod/Core/Main_Vof.f90 index ee43b0356..20574240a 100644 --- a/Sources/Process/Vof_Mod/Core/Main_Vof.f90 +++ b/Sources/Process/Vof_Mod/Core/Main_Vof.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Main_Vof(Vof, Flow, Turb, Sol, curr_dt) + subroutine Main_Vof(Vof, Flow, Turb, Sol) !------------------------------------------------------------------------------! ! Initialize inteface tracking simulations ! !------------------------------------------------------------------------------! @@ -9,7 +9,8 @@ subroutine Main_Vof(Vof, Flow, Turb, Sol, curr_dt) type(Field_Type), target :: Flow type(Turb_Type), target :: Turb type(Solver_Type) :: Sol - integer, intent(in) :: curr_dt ! time step +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Turb) !==============================================================================! if(Flow % with_interface) then @@ -24,7 +25,7 @@ subroutine Main_Vof(Vof, Flow, Turb, Sol, curr_dt) ! Advance vof function (fun) and ! ! re-create its smooth variant ! !------------------------------------! - call Vof % Compute_Vof(Sol, Flow % dt, curr_dt) + call Vof % Compute_Vof(Sol, Flow % dt) call Vof % Smooth_For_Curvature_Csf() !------------------------------------------------! diff --git a/Sources/Process/Vof_Mod/Core/Max_Courant_Number.f90 b/Sources/Process/Vof_Mod/Core/Max_Courant_Number.f90 index 09cd4d983..d8895b1a5 100644 --- a/Sources/Process/Vof_Mod/Core/Max_Courant_Number.f90 +++ b/Sources/Process/Vof_Mod/Core/Max_Courant_Number.f90 @@ -18,7 +18,7 @@ subroutine Max_Courant_Number(Vof, dt, interf, courant_max) type(Var_Type), pointer :: fun type(Face_Type), pointer :: v_flux real, contiguous, pointer :: c_d(:) - integer :: c, c1, c2, s + integer :: c, c1, c2, s, reg real :: fun_dist !==============================================================================! @@ -36,26 +36,41 @@ subroutine Max_Courant_Number(Vof, dt, interf, courant_max) if(interf == 1) then - do s = 1, Grid % n_faces + ! Interior faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) + ! For c1 fun_dist = min(max(fun % n(c1), 0.0), 1.0) fun_dist = (1.0 - fun_dist) ** 2 * fun_dist ** 2 * 16.0 c_d(c1) = c_d(c1) + fun_dist & * max(-v_flux % n(s) * dt / Grid % vol(c1), 0.0) - if(c2 > 0) then - fun_dist = min(max(fun % n(c2), 0.0), 1.0) + ! For c2 + fun_dist = min(max(fun % n(c2), 0.0), 1.0) - fun_dist = (1.0 - fun_dist) ** 2 * fun_dist ** 2 * 16.0 + fun_dist = (1.0 - fun_dist) ** 2 * fun_dist ** 2 * 16.0 - c_d(c2) = c_d(c2) + fun_dist & - * max( v_flux % n(s) * dt / Grid % vol(c2), 0.0) - end if + c_d(c2) = c_d(c2) + fun_dist & + * max( v_flux % n(s) * dt / Grid % vol(c2), 0.0) end do + ! Boundary faces + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + + ! For c1 + fun_dist = min(max(fun % n(c1), 0.0), 1.0) + fun_dist = (1.0 - fun_dist) ** 2 * fun_dist ** 2 * 16.0 + + c_d(c1) = c_d(c1) + fun_dist & + * max(-v_flux % n(s) * dt / Grid % vol(c1), 0.0) + end do ! faces + end do ! regions + ! if(Vof % phase_Change) then ! do c = 1, Grid % n_cells ! fun_dist = min(max(fun % n(c1), 0.0),1.0) @@ -70,22 +85,27 @@ subroutine Max_Courant_Number(Vof, dt, interf, courant_max) do c = 1, Grid % n_cells courant_max = max(c_d(c), courant_max) end do - call Comm_Mod_Global_Max_Real(courant_max) + call Global % Max_Real(courant_max) else ! interf = 0 - ! At boundaries - do s = 1, Grid % n_faces + ! Interior faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) c_d(c1) = c_d(c1) + max(-v_flux % n(s) * dt / Grid % vol(c1), 0.0) - - if(c2 > 0) then - c_d(c2) = c_d(c2) + max( v_flux % n(s) * dt / Grid % vol(c2), 0.0) - end if + c_d(c2) = c_d(c2) + max( v_flux % n(s) * dt / Grid % vol(c2), 0.0) end do + ! Boundary faces + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c_d(c1) = c_d(c1) + max(-v_flux % n(s) * dt / Grid % vol(c1), 0.0) + end do ! faces + end do ! regions + ! if(Vof % phase_Change) then ! do c = 1, Grid % n_cells ! c_d(c) = c_d(c) + Vof % flux_rate(c) / Flow % density_f(s) * dt diff --git a/Sources/Process/Vof_Mod/Core/Predict_Beta.f90 b/Sources/Process/Vof_Mod/Core/Predict_Beta.f90 index 39e4e6521..fac781409 100644 --- a/Sources/Process/Vof_Mod/Core/Predict_Beta.f90 +++ b/Sources/Process/Vof_Mod/Core/Predict_Beta.f90 @@ -38,169 +38,165 @@ subroutine Predict_Beta(Vof) ! Compute beta_f ! !--------------------! - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - - beta_f(s) = 0.0 - if(abs(v_flux % n(s)) > FEMTO) then - - if(v_flux % n(s) > 0.0) then - donor = c1 - accept = c2 - signo = 1.0 - else - donor = c2 - accept = c1 - signo = - 1.0 - end if + beta_f(s) = 0.0 + if(abs(v_flux % n(s)) > FEMTO) then + + if(v_flux % n(s) > 0.0) then + donor = c1 + accept = c2 + signo = 1.0 + else + donor = c2 + accept = c1 + signo = - 1.0 + end if - alfa_d = fun % n(donor) - alfa_a = fun % n(accept) + alfa_d = fun % n(donor) + alfa_a = fun % n(accept) - dotprod = signo * ( fun % x(donor) * Grid % dx(s) & - + fun % y(donor) * Grid % dy(s) & - + fun % z(donor) * Grid % dz(s)) + dotprod = signo * ( fun % x(donor) * Grid % dx(s) & + + fun % y(donor) * Grid % dy(s) & + + fun % z(donor) * Grid % dz(s)) - alfa_u = min(max(alfa_a - 2.0 * dotprod, 0.0), 1.0) ! old way + alfa_u = min(max(alfa_a - 2.0 * dotprod, 0.0), 1.0) ! old way -! call Multiphase_Mod_Vof_Find_Upstream_Phi(fun, & -! fun % x, & -! fun % y, & -! fun % z, & -! s, donor, accept, alfa_u) - ! Face is inside the domain - if(abs(alfa_u - alfa_a) > FEMTO) then +! call Multiphase_Mod_Vof_Find_Upstream_Phi(fun, & +! fun % x, & +! fun % y, & +! fun % z, & +! s, donor, accept, alfa_u) + ! Face is inside the domain + if(abs(alfa_u - alfa_a) > FEMTO) then - alfa_d_til = (alfa_d - alfa_u) / (alfa_a - alfa_u) + alfa_d_til = (alfa_d - alfa_u) / (alfa_a - alfa_u) - cod = min(1.0, c_d(donor)) + cod = min(1.0, c_d(donor)) - ! Compute alfa_cbc - if(alfa_d_til >= 0.0 .and. alfa_d_til <= 1.0) then - alfa_cbc = min(1.0, alfa_d_til / max(cod, FEMTO)) - else - alfa_cbc = alfa_d_til - end if + ! Compute alfa_cbc + if(alfa_d_til >= 0.0 .and. alfa_d_til <= 1.0) then + alfa_cbc = min(1.0, alfa_d_til / max(cod, FEMTO)) + else + alfa_cbc = alfa_d_til + end if - ! Compute alfa_uq - if(alfa_d_til >= 0.0 .and. alfa_d_til <= 1.0) then - alfa_uq = min(cod & - * alfa_d_til + (1.0 - cod) & - * (6.0 * alfa_d_til + 3.0) & - / 8.0, alfa_cbc) - else - alfa_uq = alfa_d_til - end if + ! Compute alfa_uq + if(alfa_d_til >= 0.0 .and. alfa_d_til <= 1.0) then + alfa_uq = min(cod & + * alfa_d_til + (1.0 - cod) & + * (6.0 * alfa_d_til + 3.0) & + / 8.0, alfa_cbc) + else + alfa_uq = alfa_d_til + end if - ! Compute angle: - prodmag = sqrt( fun % x(donor) ** 2 & - + fun % y(donor) ** 2 & - + fun % z(donor) ** 2) & - * Grid % d(s) + ! Compute angle: + prodmag = sqrt( fun % x(donor) ** 2 & + + fun % y(donor) ** 2 & + + fun % z(donor) ** 2) & + * Grid % d(s) - if(prodmag > FEMTO) then - ang = dotprod / prodmag - else - ang = 1.0 / FEMTO - end if + if(prodmag > FEMTO) then + ang = dotprod / prodmag + else + ang = 1.0 / FEMTO + end if - gamma_f = min(ang ** 2, 1.0) + gamma_f = min(ang ** 2, 1.0) - alfa_f_til = gamma_f * alfa_cbc + (1.0 - gamma_f) * alfa_uq + alfa_f_til = gamma_f * alfa_cbc + (1.0 - gamma_f) * alfa_uq - if(abs(1.0 - alfa_d_til) > FEMTO) then + if(abs(1.0 - alfa_d_til) > FEMTO) then - beta_f(s) = min(max((alfa_f_til - alfa_d_til) & - / (1.0 - alfa_d_til) + beta_c(s), 0.0), 1.0) + beta_f(s) = min(max((alfa_f_til - alfa_d_til) & + / (1.0 - alfa_d_til) + beta_c(s), 0.0), 1.0) - end if end if end if - end if ! c2 > 0 - end do ! do s = 1, ... + end if ! abs(v_flux % n(s)) > FEMTO + end do ! faces else if(fun % adv_scheme .eq. STACS) then - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then + beta_f(s) = 0.0 + if(abs(v_flux % n(s)) > FEMTO) then + + if(v_flux % n(s) > 0.0) then + donor = c1 + accept = c2 + signo = 1.0 + else + donor = c2 + accept = c1 + signo = - 1.0 + end if - beta_f(s) = 0.0 - if(abs(v_flux % n(s)) > FEMTO) then + alfa_d = fun % n(donor) + alfa_a = fun % n(accept) - if(v_flux % n(s) > 0.0) then - donor = c1 - accept = c2 - signo = 1.0 - else - donor = c2 - accept = c1 - signo = - 1.0 - end if + dotprod = signo * ( fun % x(donor) * Grid % dx(s) & + + fun % y(donor) * Grid % dy(s) & + + fun % z(donor) * Grid % dz(s)) - alfa_d = fun % n(donor) - alfa_a = fun % n(accept) + ! Face is inside the domain + alfa_u = min(max(alfa_a - 2.0 * dotprod, 0.0), 1.0) - dotprod = signo * ( fun % x(donor) * Grid % dx(s) & - + fun % y(donor) * Grid % dy(s) & - + fun % z(donor) * Grid % dz(s)) + if(abs(alfa_u - alfa_a) > FEMTO) then - ! Face is inside the domain - alfa_u = min(max(alfa_a - 2.0 * dotprod, 0.0), 1.0) + alfa_d_til = (alfa_d - alfa_u) / (alfa_a - alfa_u) - if(abs(alfa_u - alfa_a) > FEMTO) then + ! Compute alfa_SUBERBEE + if(alfa_d_til > 0.0 .and. alfa_d_til < 1.0) then + alfa_superbee = 1.0 + else + alfa_superbee = alfa_d_til + end if - alfa_d_til = (alfa_d - alfa_u) / (alfa_a - alfa_u) + if(alfa_d_til > 0.0 .and. alfa_d_til <= 0.5) then + alfa_stoic = 0.5 + 0.5 * alfa_d_til + else if(alfa_d_til > 0.5 .and. alfa_d_til <= 5.0 / 6.0) then + alfa_stoic = 3.0 / 8.0 + 3.0 / 4.0 * alfa_d_til + else if(alfa_d_til > 5.0 / 6.0 .and. alfa_d_til <= 1.0) then + alfa_stoic = 1.0 + else + alfa_stoic = alfa_d_til + end if - ! Compute alfa_SUBERBEE - if(alfa_d_til > 0.0 .and. alfa_d_til < 1.0) then - alfa_superbee = 1.0 - else - alfa_superbee = alfa_d_til - end if + ! Compute angle: + prodmag = sqrt( fun % x(donor) ** 2 & + + fun % y(donor) ** 2 & + + fun % z(donor) ** 2) & + * Grid % d(s) - if(alfa_d_til > 0.0 .and. alfa_d_til <= 0.5) then - alfa_stoic = 0.5 + 0.5 * alfa_d_til - else if(alfa_d_til > 0.5 .and. alfa_d_til <= 5.0 / 6.0) then - alfa_stoic = 3.0 / 8.0 + 3.0 / 4.0 * alfa_d_til - else if(alfa_d_til > 5.0 / 6.0 .and. alfa_d_til <= 1.0) then - alfa_stoic = 1.0 - else - alfa_stoic = alfa_d_til - end if + if(prodmag > FEMTO) then + ang = dotprod / prodmag + else + ang = 1.0 / FEMTO + end if - ! Compute angle: - prodmag = sqrt( fun % x(donor) ** 2 & - + fun % y(donor) ** 2 & - + fun % z(donor) ** 2) & - * Grid % d(s) + gamma_f = min(ang ** 4, 1.0) - if(prodmag > FEMTO) then - ang = dotprod / prodmag - else - ang = 1.0 / FEMTO - end if + alfa_f_til = gamma_f * alfa_superbee + (1.0 - gamma_f) * alfa_stoic - gamma_f = min(ang ** 4, 1.0) + if(abs(1.0 - alfa_d_til) > FEMTO) then - alfa_f_til = gamma_f * alfa_superbee + (1.0 - gamma_f) * alfa_stoic + beta_f(s) = min(max((alfa_f_til - alfa_d_til) & + / (1.0 - alfa_d_til) + beta_c(s), 0.0), 1.0) - if(abs(1.0 - alfa_d_til) > FEMTO) then + end if - beta_f(s) = min(max((alfa_f_til - alfa_d_til) & - / (1.0 - alfa_d_til) + beta_c(s), 0.0), 1.0) + end if - end if + end if ! abs(v_flux % n(s)) > FEMTO + end do ! faces - end if - end if - end if ! c2 > 0 - end do ! do s = 1, ... - end if + end if ! STACS end subroutine diff --git a/Sources/Process/Vof_Mod/Core/Solve_System.f90 b/Sources/Process/Vof_Mod/Core/Solve_System.f90 index 40c44a836..b6bf0ef31 100644 --- a/Sources/Process/Vof_Mod/Core/Solve_System.f90 +++ b/Sources/Process/Vof_Mod/Core/Solve_System.f90 @@ -12,7 +12,6 @@ subroutine Solve_System(Vof, Sol, b) type(Var_Type), pointer :: fun type(Field_Type), pointer :: Flow type(Matrix_Type), pointer :: A - character(SL) :: solver !==============================================================================! ! Take aliases @@ -20,10 +19,7 @@ subroutine Solve_System(Vof, Sol, b) Flow => Vof % pnt_flow A => Sol % Nat % A - ! Get solver - call Control_Mod_Solver_For_Vof(solver) - - call Profiler % Start('Linear_Solver_For_Vof') + call Profiler % Start(String % First_Upper(fun % solver)//' (solver for VOF)') ! Call linear solver to solve the equations call Sol % Run(fun % solver, & @@ -37,12 +33,12 @@ subroutine Solve_System(Vof, Sol, b) fun % tol, & fun % res) - call Profiler % Stop('Linear_Solver_For_Vof') + call Profiler % Stop(String % First_Upper(fun % solver)//' (solver for VOF)') if(.not. Flow % heat_transfer) then - call Info_Mod_Iter_Fill_At(1, 6, fun % name, fun % eniter, fun % res) + call Info % Iter_Fill_At(1, 6, fun % name, fun % res, fun % eniter) else - call Info_Mod_Iter_Fill_At(2, 1, fun % name, fun % eniter, fun % res) + call Info % Iter_Fill_At(2, 1, fun % name, fun % res, fun % eniter) end if end subroutine diff --git a/Sources/Process/Vof_Mod/Curvature/Curvature_Csf.f90 b/Sources/Process/Vof_Mod/Curvature/Curvature_Csf.f90 index b091f452e..7212d6f08 100644 --- a/Sources/Process/Vof_Mod/Curvature/Curvature_Csf.f90 +++ b/Sources/Process/Vof_Mod/Curvature/Curvature_Csf.f90 @@ -11,9 +11,11 @@ subroutine Curvature_Csf(Vof) type(Field_Type), pointer :: Flow type(Var_Type), pointer :: fun type(Var_Type), pointer :: smooth - integer :: c, c1, c2, s, nb, nc + integer :: c, c1, c2, s, nb, nc, reg real :: v1(3), v2(3), v3(3), v4(3) - real :: norm_grad, dotprod + real :: norm_grad, dotprod, mag_ntan, theta + real :: nwallx, nwally, nwallz + real :: nintx, ninty, nintz, ntanx, ntany, ntanz real, contiguous, pointer :: div_x(:), div_y(:), div_z(:) !==============================================================================! @@ -32,7 +34,7 @@ subroutine Curvature_Csf(Vof) !-------------------------------! ! Normalize vector at cells ! !-------------------------------! - do c = 1, Grid % n_cells + do c = Cells_In_Domain() norm_grad = sqrt( smooth % x(c) ** 2 & + smooth % y(c) ** 2 & + smooth % z(c) ** 2) @@ -46,7 +48,6 @@ subroutine Curvature_Csf(Vof) Vof % nz(c) = 0.0 end if end do - call Grid % Exchange_Cells_Real(Vof % nx(-nb:nc)) call Grid % Exchange_Cells_Real(Vof % ny(-nb:nc)) call Grid % Exchange_Cells_Real(Vof % nz(-nb:nc)) @@ -54,13 +55,11 @@ subroutine Curvature_Csf(Vof) !---------------------------------------! ! Tangent vector to walls/symmetries ! !---------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL .or. & - Grid % Bnd_Cond_Type(c2) .eq. SYMMETRY) then + do reg = Boundary_Regions() + if( Grid % region % type(reg) .eq. SYMMETRY) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) norm_grad = sqrt( Vof % nx(c1)**2 & + Vof % ny(c1)**2 & @@ -85,25 +84,29 @@ subroutine Curvature_Csf(Vof) Vof % nz(c2) = v4(3) / norm_grad end if end if - else + end do ! faces + else ! other boundaries + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + Vof % nx(c2) = Vof % nx(c1) Vof % ny(c2) = Vof % ny(c1) Vof % nz(c2) = Vof % nz(c1) - end if - - end if ! c2 < 0 - end do + end do ! faces + end if ! boundary condition + end do ! regions !----------------------------------------! ! Correct for contact angle at walls ! !----------------------------------------! - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) + do reg = Boundary_Regions() + if( Grid % region % type(reg) .eq. WALL & + .or. Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) - if(c2 < 0) then - if(Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) ! Accumulate values of faces norm_grad = sqrt( Vof % nx(c1)**2 & @@ -112,31 +115,38 @@ subroutine Curvature_Csf(Vof) if(norm_grad > FEMTO) then - dotprod = Grid % dx(s) * Grid % sx(s) & - + Grid % dy(s) * Grid % sy(s) & - + Grid % dz(s) * Grid % sz(s) - - Vof % nx(c1) = Grid % dx(s) / dotprod * Grid % s(s) & - * cos(fun % q(c2) * PI /180.0) & - + Vof % nx(c2) * sin(fun % q(c2) * PI /180.0) + ! unit normal vector of interface + nintx = Vof % nx(c1) + ninty = Vof % ny(c1) + nintz = Vof % nz(c1) + + ! unit wall normal vector directed into wall + nwallx = Grid % sx(s)/Grid %s(s) + nwally = Grid % sy(s)/Grid %s(s) + nwallz = Grid % sz(s)/Grid %s(s) + + ! ntan vector lies in wall and is normal to contact line, see Brackbill's paper + ! ntan = (nint - (nint.nwall) nwall) / abs(nint - (nint.nwall) nwall) + dotprod = nintx * nwallx + ninty * nwally + nintz * nwallz + ntanx = nintx - dotprod * nwallx + ntany = ninty - dotprod * nwally + ntanz = nintz - dotprod * nwallz + ! normalize + mag_ntan = sqrt( ntanx**2.0 + ntany**2.0 + ntanz**2.0 + FEMTO) + ntanx = ntanx/mag_ntan + ntany = ntany/mag_ntan + ntanz = ntanz/mag_ntan + + theta = fun % q(c2) * PI /180.0 + Vof % nx(c2) = nwallx * cos(theta) + ntanx * sin(theta) + Vof % ny(c2) = nwally * cos(theta) + ntany * sin(theta) + Vof % nz(c2) = nwallz * cos(theta) + ntanz * sin(theta) - Vof % ny(c1) = Grid % dy(s) / dotprod * Grid % s(s) & - * cos(fun % q(c2) * PI /180.0) & - + Vof % ny(c2) * sin(fun % q(c2) * PI /180.0) - - Vof % nz(c1) = Grid % dz(s) / dotprod * Grid % s(s) & - * cos(fun % q(c2) * PI /180.0) & - + Vof % nz(c2) * sin(fun % q(c2) * PI /180.0) - - Vof % nx(c2) = Vof % nx(c1) - Vof % ny(c2) = Vof % ny(c1) - Vof % nz(c2) = Vof % nz(c1) end if - end if ! if WALL - end if ! c2 < 0 - - end do + end do ! faces + end if ! regions are walls + end do ! regions call Grid % Exchange_Cells_Real(Vof % nx(-nb:nc)) call Grid % Exchange_Cells_Real(Vof % ny(-nb:nc)) @@ -151,12 +161,14 @@ subroutine Curvature_Csf(Vof) call Flow % Grad_Component(Vof % ny(-nb:nc), 2, div_y(-nb:nc)) call Flow % Grad_Component(Vof % nz(-nb:nc), 3, div_z(-nb:nc)) - do c = -nb, nc - Vof % curv(c) = Vof % curv(c) - div_x(c) - Vof % curv(c) = Vof % curv(c) - div_y(c) - Vof % curv(c) = Vof % curv(c) - div_z(c) + ! It might be an overkill to browse boundary cells here + do reg = Boundary_And_Inside_Regions() + do c = Cells_In_Region(reg) + Vof % curv(c) = Vof % curv(c) - div_x(c) + Vof % curv(c) = Vof % curv(c) - div_y(c) + Vof % curv(c) = Vof % curv(c) - div_z(c) + end do end do - call Grid % Exchange_Cells_Real(Vof % curv) ! call Grid % Save_Debug_Vtu('curv_sharp',scalar_cell=Vof % curv, & @@ -167,9 +179,10 @@ subroutine Curvature_Csf(Vof) ! call Grid% Save_Debug_Vtu('curv_smooth',scalar_cell=Vof % curv, & ! scalar_name='curv_smooth') - do c = 1, Grid % n_cells + do c = Cells_In_Domain() if(smooth % n(c) < 0.01 .or. smooth % n(c) > 0.99) Vof % curv(c) = 0.0 end do + call Grid % Exchange_Cells_Real(Vof % curv(-nb:nc)) call Work % Disconnect_Real_Cell(div_x, div_y, div_z) diff --git a/Sources/Process/Vof_Mod/Curvature/Smooth_Curvature.f90 b/Sources/Process/Vof_Mod/Curvature/Smooth_Curvature.f90 index 9928baabd..792c80219 100644 --- a/Sources/Process/Vof_Mod/Curvature/Smooth_Curvature.f90 +++ b/Sources/Process/Vof_Mod/Curvature/Smooth_Curvature.f90 @@ -49,50 +49,45 @@ subroutine Smooth_Curvature(Vof) gradk_y(-nb:nc) = 0.0 gradk_z(-nb:nc) = 0.0 - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - fs = Grid % f(s) - curvf = fs * Vof % curv(c1) + (1.0 - fs) * Vof % curv(c2) - gradk_x(c1) = gradk_x(c1) + curvf * Grid % sx(s) / Grid % vol(c1) - gradk_y(c1) = gradk_y(c1) + curvf * Grid % sy(s) / Grid % vol(c1) - gradk_z(c1) = gradk_z(c1) + curvf * Grid % sz(s) / Grid % vol(c1) - gradk_x(c2) = gradk_x(c2) - curvf * Grid % sx(s) / Grid % vol(c2) - gradk_y(c2) = gradk_y(c2) - curvf * Grid % sy(s) / Grid % vol(c2) - gradk_z(c2) = gradk_z(c2) - curvf * Grid % sz(s) / Grid % vol(c2) - end if ! c2 > 0 - end do + fs = Grid % f(s) + curvf = fs * Vof % curv(c1) + (1.0 - fs) * Vof % curv(c2) + gradk_x(c1) = gradk_x(c1) + curvf * Grid % sx(s) / Grid % vol(c1) + gradk_y(c1) = gradk_y(c1) + curvf * Grid % sy(s) / Grid % vol(c1) + gradk_z(c1) = gradk_z(c1) + curvf * Grid % sz(s) / Grid % vol(c1) + gradk_x(c2) = gradk_x(c2) - curvf * Grid % sx(s) / Grid % vol(c2) + gradk_y(c2) = gradk_y(c2) - curvf * Grid % sy(s) / Grid % vol(c2) + gradk_z(c2) = gradk_z(c2) - curvf * Grid % sz(s) / Grid % vol(c2) + end do ! faces call Grid % Exchange_Cells_Real(gradk_x(-nb:nc)) call Grid % Exchange_Cells_Real(gradk_y(-nb:nc)) call Grid % Exchange_Cells_Real(gradk_z(-nb:nc)) ! Interior faces - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - w_v1 = (1.0 - 2.0 * abs(0.5 - col % n(c1))) ** weight_s - w_v2 = (1.0 - 2.0 * abs(0.5 - col % n(c2))) ** weight_s - sum_k_weight(c1) = sum_k_weight(c1) + Vof % curv(c2) * w_v2 - sum_weight(c1) = sum_weight(c1) + w_v2 - - sum_k_weight(c2) = sum_k_weight(c2) + Vof % curv(c1) * w_v1 - sum_weight(c2) = sum_weight(c2) + w_v1 - end if - end do + w_v1 = (1.0 - 2.0 * abs(0.5 - col % n(c1))) ** weight_s + w_v2 = (1.0 - 2.0 * abs(0.5 - col % n(c2))) ** weight_s + sum_k_weight(c1) = sum_k_weight(c1) + Vof % curv(c2) * w_v2 + sum_weight(c1) = sum_weight(c1) + w_v2 + + sum_k_weight(c2) = sum_k_weight(c2) + Vof % curv(c1) * w_v1 + sum_weight(c2) = sum_weight(c2) + w_v1 + end do ! faces call Grid % Exchange_Cells_Real(sum_k_weight(-nb:nc)) call Grid % Exchange_Cells_Real(sum_weight (-nb:nc)) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() w_v1 = (1.0 - 2.0 * abs(0.5 - col % n(c))) ** weight_s k_star(c) = (w_v1 * Vof % curv(c) + sum_k_weight(c)) & / (w_v1 + sum_weight(c) + FEMTO) end do - call Grid % Exchange_Cells_Real(k_star(-nb:nc)) !-------------------------------------------------------------------------! @@ -107,54 +102,49 @@ subroutine Smooth_Curvature(Vof) gradk_y(-nb:nc) = 0.0 gradk_z(-nb:nc) = 0.0 - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - fs = Grid % f(s) - curvf = fs * k_star(c1) + (1.0 - fs) * k_star(c2) - gradk_x(c1) = gradk_x(c1) + curvf * Grid % sx(s) / Grid % vol(c1) - gradk_y(c1) = gradk_y(c1) + curvf * Grid % sy(s) / Grid % vol(c1) - gradk_z(c1) = gradk_z(c1) + curvf * Grid % sz(s) / Grid % vol(c1) - gradk_x(c2) = gradk_x(c2) - curvf * Grid % sx(s) / Grid % vol(c2) - gradk_y(c2) = gradk_y(c2) - curvf * Grid % sy(s) / Grid % vol(c2) - gradk_z(c2) = gradk_z(c2) - curvf * Grid % sz(s) / Grid % vol(c2) - end if ! c2 > 0 - end do + fs = Grid % f(s) + curvf = fs * k_star(c1) + (1.0 - fs) * k_star(c2) + gradk_x(c1) = gradk_x(c1) + curvf * Grid % sx(s) / Grid % vol(c1) + gradk_y(c1) = gradk_y(c1) + curvf * Grid % sy(s) / Grid % vol(c1) + gradk_z(c1) = gradk_z(c1) + curvf * Grid % sz(s) / Grid % vol(c1) + gradk_x(c2) = gradk_x(c2) - curvf * Grid % sx(s) / Grid % vol(c2) + gradk_y(c2) = gradk_y(c2) - curvf * Grid % sy(s) / Grid % vol(c2) + gradk_z(c2) = gradk_z(c2) - curvf * Grid % sz(s) / Grid % vol(c2) + end do call Grid % Exchange_Cells_Real(gradk_x(-nb:nc)) call Grid % Exchange_Cells_Real(gradk_y(-nb:nc)) call Grid % Exchange_Cells_Real(gradk_z(-nb:nc)) ! Interior faces - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - w_v1 = (1.0 - 2.0 * abs(0.5 - col % n(c1))) ** weight_n - w_v2 = (1.0 - 2.0 * abs(0.5 - col % n(c2))) ** weight_n + w_v1 = (1.0 - 2.0 * abs(0.5 - col % n(c1))) ** weight_n + w_v2 = (1.0 - 2.0 * abs(0.5 - col % n(c2))) ** weight_n - w_m1 = abs(dot_product((/Vof % nx(c1), Vof % ny(c1), Vof % nz(c1)/), & - (/Grid % dx(s), Grid % dy(s), Grid % dz(s)/) & - / Grid % d(s))) ** weight_n + w_m1 = abs(dot_product((/Vof % nx(c1), Vof % ny(c1), Vof % nz(c1)/), & + (/Grid % dx(s), Grid % dy(s), Grid % dz(s)/) & + / Grid % d(s))) ** weight_n - w_m2 = abs(dot_product((/Vof % nx(c2), Vof % ny(c2), Vof % nz(c2)/), & - (/Grid % dx(s), Grid % dy(s), Grid % dz(s)/) & - / (-Grid % d(s)))) ** weight_n + w_m2 = abs(dot_product((/Vof % nx(c2), Vof % ny(c2), Vof % nz(c2)/), & + (/Grid % dx(s), Grid % dy(s), Grid % dz(s)/) & + / (-Grid % d(s)))) ** weight_n - sum_k_weight(c1) = sum_k_weight(c1) + k_star(c2) * w_v2 * w_m2 - sum_weight(c1) = sum_weight(c1) + w_v2 * w_m2 + sum_k_weight(c1) = sum_k_weight(c1) + k_star(c2) * w_v2 * w_m2 + sum_weight(c1) = sum_weight(c1) + w_v2 * w_m2 - sum_k_weight(c2) = sum_k_weight(c2) + k_star(c1) * w_v1 * w_m1 - sum_weight(c2) = sum_weight(c2) + w_v1 * w_m1 - end if ! c2 > 0 + sum_k_weight(c2) = sum_k_weight(c2) + k_star(c1) * w_v1 * w_m1 + sum_weight(c2) = sum_weight(c2) + w_v1 * w_m1 end do - call Grid % Exchange_Cells_Real(sum_k_weight(-nb:nc)) call Grid % Exchange_Cells_Real(sum_weight (-nb:nc)) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() w_v1 = (1.0 - 2.0 * abs(0.5 - col % n(c))) ** weight_n Vof % curv(c) = (w_v1 * k_star(c) + sum_k_weight(c)) & / (w_v1 + sum_weight(c) + FEMTO) diff --git a/Sources/Process/Vof_Mod/Curvature/Smooth_Scalar.f90 b/Sources/Process/Vof_Mod/Curvature/Smooth_Scalar.f90 index e1d08bbb2..57b8c7453 100644 --- a/Sources/Process/Vof_Mod/Curvature/Smooth_Scalar.f90 +++ b/Sources/Process/Vof_Mod/Curvature/Smooth_Scalar.f90 @@ -7,7 +7,7 @@ subroutine Smooth_Scalar(Vof, Grid, var, smooth_var, n_conv) !---------------------------------[Arguments]----------------------------------! class(Vof_Type), target :: Vof type(Grid_Type) :: Grid - integer :: n_conv, nb, nc + integer :: n_conv, nb, nc, reg real :: var(-Grid % n_bnd_cells: Grid % n_cells) real :: smooth_var(-Grid % n_bnd_cells & : Grid % n_cells) @@ -15,6 +15,8 @@ subroutine Smooth_Scalar(Vof, Grid, var, smooth_var, n_conv) integer :: s, c, c1, c2, c_iter real :: fs, vol_face real, contiguous, pointer :: sum_vol_area(:), sum_area(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Vof) !==============================================================================! call Work % Connect_Real_Cell(sum_vol_area, sum_area) @@ -34,41 +36,41 @@ subroutine Smooth_Scalar(Vof, Grid, var, smooth_var, n_conv) !-------------------------------! ! Extrapolate to boundaries ! !-------------------------------! - - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) smooth_var(c2) = smooth_var(c1) + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + smooth_var(c2) = smooth_var(c1) + end do end do ! At boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + sum_vol_area(c1) = sum_vol_area(c1) + smooth_var(c1) * Grid % s(s) sum_area(c1) = sum_area(c1) + Grid % s(s) - end if + end do end do - do s = 1, Grid % n_faces + do s = Faces_In_Domain() c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 > 0) then - fs = Grid % f(s) - vol_face = fs * smooth_var(c1) + (1.0 - fs) * smooth_var(c2) - sum_vol_area(c1) = sum_vol_area(c1) + vol_face * Grid % s(s) - sum_vol_area(c2) = sum_vol_area(c2) + vol_face * Grid % s(s) - sum_area(c1) = sum_area(c1) + Grid % s(s) - sum_area(c2) = sum_area(c2) + Grid % s(s) - end if + fs = Grid % f(s) + vol_face = fs * smooth_var(c1) + (1.0-fs) * smooth_var(c2) + sum_vol_area(c1) = sum_vol_area(c1) + vol_face * Grid % s(s) + sum_vol_area(c2) = sum_vol_area(c2) + vol_face * Grid % s(s) + sum_area(c1) = sum_area(c1) + Grid % s(s) + sum_area(c2) = sum_area(c2) + Grid % s(s) end do call Grid % Exchange_Cells_Real(sum_vol_area(-nb:nc)) call Grid % Exchange_Cells_Real(sum_area (-nb:nc)) - do c = 1, Grid % n_cells + do c = Cells_In_Domain() smooth_var(c) = max(min(sum_vol_area(c) / sum_area(c), 1.0), 0.0) smooth_var(c) = sum_vol_area(c) / sum_area(c) end do @@ -77,13 +79,14 @@ subroutine Smooth_Scalar(Vof, Grid, var, smooth_var, n_conv) end do ! At boundaries - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) smooth_var(c2) = smooth_var(c1) + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + smooth_var(c2) = smooth_var(c1) + end do end do - - call Grid % Exchange_Cells_Real(smooth_var) + call Grid % Exchange_Cells_Real(smooth_var(-nb:nc)) call Work % Disconnect_Real_Cell(sum_vol_area, sum_area) diff --git a/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Added_Volume.f90 b/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Added_Volume.f90 index 0c40db66f..b43f54db6 100644 --- a/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Added_Volume.f90 +++ b/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Added_Volume.f90 @@ -41,6 +41,6 @@ subroutine Mass_Transfer_Added_Volume(Vof, added_vol) end do ! Take global summ - call Comm_Mod_Global_Sum_Real(added_vol) + call Global % Sum_Real(added_vol) end subroutine diff --git a/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Estimate.f90 b/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Estimate.f90 index 22258b0a9..e59779242 100644 --- a/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Estimate.f90 +++ b/Sources/Process/Vof_Mod/Utilities/Mass_Transfer_Estimate.f90 @@ -72,14 +72,14 @@ subroutine Mass_Transfer_Estimate(Vof) ! be adjusted accordingly. ! Units: W/(mK) * K/m * m^2 = W Vof % q_int(1,s) = Vof % q_int(1,s) & - + cond_1 * ( t % x(c1) * Vof % Front % elem(e) % sx & - + t % y(c1) * Vof % Front % elem(e) % sy & - + t % z(c1) * Vof % Front % elem(e) % sz) + + cond_1 * ( t % x(c1) * Vof % Front % Elem(e) % sx & + + t % y(c1) * Vof % Front % Elem(e) % sy & + + t % z(c1) * Vof % Front % Elem(e) % sz) Vof % q_int(2,s) = Vof % q_int(2,s) & - + cond_2 * ( t % x(c2) * Vof % Front % elem(e) % sx & - + t % y(c2) * Vof % Front % elem(e) % sy & - + t % z(c2) * Vof % Front % elem(e) % sz) + + cond_2 * ( t % x(c2) * Vof % Front % Elem(e) % sx & + + t % y(c2) * Vof % Front % Elem(e) % sy & + + t % z(c2) * Vof % Front % Elem(e) % sz) end if ! e .ne. 0 end do ! i_ele diff --git a/Sources/Process/makefile b/Sources/Process/makefile index db261c0cb..f61e6b863 100644 --- a/Sources/Process/makefile +++ b/Sources/Process/makefile @@ -8,22 +8,21 @@ # Default options for compilation #------------------------------------- FORTRAN ?= gnu -DEBUG ?= no ASSERT ?= yes +DEBUG ?= no +PROF ?= no REAL ?= double MPI ?= no -OPENMP ?= yes +OMP ?= no # Directories for objects and modules. (No need to change.) DIR_BINARY = ../../Binaries DIR_SHARED = ../Shared DIR_MODULE = .Modules DIR_OBJECT = .Objects -DIR_TURBUL = Turb_Mod -DIR_SWARM = Swarm_Mod DIR_USER = User_Mod DIR_CASE = no -VPATH = $(DIR_SHARED):$(DIR_TURBUL):$(DIR_SWARM):. +VPATH = $(DIR_SHARED):. # Program name (This should hardly change) PROGRAM_NAME = Process @@ -36,20 +35,33 @@ PROGRAM_FILE = $(DIR_BINARY)/$(PROGRAM_NAME) # It later adds T_FLOWS_MPI and T_FLOWS_PETSC #---------------------------------------------------------- PASS_ON = -DT_FLOWS_COMPILATION=1 + +#---------------------------------------------------------- +# Add T_FLOWS_PROGRAM, T_FLOWS_ASSERT and T_FLOWS_DEBUG +# and later on it add also T_FLOWS_MPI and T_FLOWS_PETSC +#---------------------------------------------------------- +PASS_ON += -DT_FLOWS_PROGRAM=4 + ifeq ($(ASSERT), yes) PASS_ON += -DT_FLOWS_ASSERT=1 else PASS_ON += -DT_FLOWS_ASSERT=0 endif +ifeq ($(DEBUG), yes) + PASS_ON += -DT_FLOWS_DEBUG=1 +else + PASS_ON += -DT_FLOWS_DEBUG=0 +endif + $(info #=======================================================================) $(info # Compiling $(PROGRAM_NAME) with $(FORTRAN) compiler ) $(info #-----------------------------------------------------------------------) $(info # Usage: ) $(info # make ) $(info # ) +$(info # ) $(info # ) -$(info # ) $(info # ) $(info # Notes: ) $(info # 1. The first item, for each of the options above, is the default. ) @@ -74,11 +86,17 @@ ifeq ($(REAL), single) endif #------------------------------------------------------------------------- +# # Compiler and linker options +# #------------------------------------------------------------------------- # Note: Changes only when support to a new Fortran compiler is added. #------------------------------------------------------------------------- +#----------- +# Intel +#----------- + # Fortran == intel ifeq ($(FORTRAN), intel) ifeq ($(FCOMP),) @@ -86,17 +104,30 @@ ifeq ($(FORTRAN), intel) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g -traceback -cpp + OPT_F_COMP += -O0 -g -traceback else - OPT_F_COMP = -module $(DIR_MODULE) -O3 -cpp + OPT_F_COMP += -O2 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -g -O2 -shared-intel -debug inline-debug-info \ + -D TBB_USE_THREADING_TOOLS endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -qopenmp + ifeq ($(PROF), yes) + OPT_F_COMP += -qopenmp-link dynamic -parallel-source-info=2 + endif endif + OPT_F_COMP_USER = $(OPT_F_COMP) + +#------------ +# Nvidia +#------------ # Fortran == nvidia else ifeq ($(FORTRAN), nvidia) @@ -105,17 +136,23 @@ else ifeq ($(FORTRAN), nvidia) else FC = $(FCOMP) endif + OPT_F_COMP = -module $(DIR_MODULE) -cpp -Mbackslash ifeq ($(DEBUG), yes) - OPT_F_COMP = -module $(DIR_MODULE) -O0 -g + OPT_F_COMP += -O0 -g else - OPT_F_COMP = -module $(DIR_MODULE) -O3 + OPT_F_COMP += -O3 endif ifeq ($(REAL), double) OPT_F_COMP += -r8 endif - ifeq ($(OPENMP), yes) + ifeq ($(OMP), yes) OPT_F_COMP += -mp endif + OPT_F_COMP_USER = $(OPT_F_COMP) + +#--------- +# Gnu +#--------- # Fortran == gnu else @@ -124,23 +161,25 @@ else else FC = $(FCOMP) endif + OPT_F_COMP = -J $(DIR_MODULE) -cpp -ffree-line-length-none ifeq ($(DEBUG), yes) - OPT_F_COMP = -J $(DIR_MODULE) -O0 -g -cpp \ - -ffree-line-length-none -fcheck=all -fwhole-file -fbacktrace \ - -ffpe-trap=invalid,zero,overflow -fimplicit-none \ - -Wall -Wextra -Waliasing -Wampersand -Warray-temporaries \ - -Wc-binding-type -Wcharacter-truncation -Wline-truncation \ - -Wconversion -finit-real=nan -Wintrinsics-std \ - -Wreal-q-constant -Wsurprising -Wtabs -Wunderflow \ - -Wintrinsic-shadow -Wunused-parameter -Walign-commons \ - -Wfunction-elimination -Wrealloc-lhs -Wrealloc-lhs-all \ - -Wtarget-lifetime -Wpedantic -fstack-check + OPT_F_COMP += -O0 -g -fcheck=all -Wall -Wno-integer-division else - OPT_F_COMP = -J $(DIR_MODULE) -O3 -cpp -ffree-line-length-none + OPT_F_COMP += -O3 + endif + ifeq ($(PROF), yes) + OPT_F_COMP += -pg -g endif ifeq ($(REAL), double) OPT_F_COMP += -fdefault-real-8 endif + ifeq ($(OMP), yes) + OPT_F_COMP += -fopenmp + endif + OPT_F_COMP_USER = $(OPT_F_COMP) + OPT_F_COMP_USER += -Wno-unused-dummy-argument + OPT_F_COMP_USER += -Wno-unused-variable + endif # Set initial options for C compiler - this is probably not needed @@ -195,8 +234,6 @@ endif #------------------------------------------------------ # Modules' order must obey their dependency # This list should therefore be written "by hand". -# Note: Modules written in lower case -# letters are candidates for deletion. #------------------------------------------------------ #-------------------- @@ -238,19 +275,20 @@ endif # Modules in shared directory SRC_F_MOD = Const_Mod.f90 \ + Region_Mod.f90 \ String_Mod.f90 \ Comm_Mod.f90 \ Assert_Mod.f90 \ Tokenizer_Mod.f90 \ Message_Mod.f90 \ - Profiler_Mod.f90 \ + Vect_Mod.f90 \ Math_Mod.f90 \ Swap_Mod.f90 \ Sort_Mod.f90 \ File_Mod.f90 \ Control_Mod.f90 \ + Profiler_Mod.f90 \ Vtk_Mod.f90 \ - Boundary_Mod.f90 \ Metis_Mod.f90 \ Grid_Mod.f90 \ Work_Mod.f90 \ @@ -272,8 +310,10 @@ SRC_F_MOD += Point_Mod.f90 \ Native_Mod.f90 \ Petsc_Mod.f90 \ Solver_Mod.f90 \ + Time_Mod.f90 \ Numerics_Mod.f90 \ Field_Mod.f90 \ + Iter_Mod.f90 \ Front_Mod.f90 \ Surf_Mod.f90 \ Info_Mod.f90 \ @@ -314,26 +354,13 @@ OBJ_F_FUN = $(SRC_F_FUN:%.f90=$(DIR_OBJECT)/%.o) OBJ_C_FUN = $(SRC_C_FUN:%.c=$(DIR_OBJECT)/%.o) OBJ = $(OBJ_F_MOD) $(OBJ_F_FUN) $(OBJ_C_FUN) -#------------------------------------------------------- -# List of modules currently used for target "clean" -#------------------------------------------------------- -# Note: This doesn't need editing. -#------------------------------------------------------- -SRC_F_MOD_LOW = $(shell echo $(SRC_F_MOD) | tr A-Z a-z) -MOD = $(SRC_F_MOD_LOW:%.f90=$(DIR_MODULE)/%.mod) - #--------------------------------------------------------- # Default rule to build Fortran modules and functions #--------------------------------------------------------- # Note: This doesn't need editing. #--------------------------------------------------------- -# Fortran modules -$(DIR_OBJECT)/%.o: %.f90 %/*.f90 - @echo $(FC) $< - @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< - -# Fortran functions +# Fortran sources $(DIR_OBJECT)/%.o: %.f90 @echo $(FC) $< @$(FC) $(OPT_F_COMP) $(PASS_ON) -c -o $@ $< @@ -343,6 +370,13 @@ $(DIR_OBJECT)/%.o: %.c @echo $(CC) $< @$(CC) $(OPT_C_COMP) $(PASS_ON) -c -o $@ $< +# Special rule to build User_Mod.f90. +# Note: If you don't write it as User%Mod.o, makefile will think that it +# is the final target and would not proceed further to build the Program +$(DIR_OBJECT)/User%Mod.o: User%Mod.f90 + @echo $(FC) $< + @$(FC) $(OPT_F_COMP_USER) $(PASS_ON) -c -o $@ $< + #----------------------------------- # Rule to build main program #----------------------------------- diff --git a/Sources/Process/makefile_explicit_dependencies b/Sources/Process/makefile_explicit_dependencies index dcf79ac87..26f470a52 100644 --- a/Sources/Process/makefile_explicit_dependencies +++ b/Sources/Process/makefile_explicit_dependencies @@ -1,50 +1,35 @@ #--------------------------------------------------- -# Dependencies for: ./Turb_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Turb_Mod.o:\ -Turb_Mod/*.f90 \ -$(DIR_OBJECT)/Info_Mod.o \ -Info_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Front_Mod.f90 +# Dependencies for: ./Eddies_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Front_Mod.o:\ -$(DIR_OBJECT)/Vert_Mod.o \ -Vert_Mod/*.f90 \ -$(DIR_OBJECT)/Side_Mod.o \ -$(DIR_SHARED)/Isoap_Mod/readme \ -$(DIR_OBJECT)/Isoap_Mod.o \ -$(DIR_SHARED)/Isoap_Mod/*.f90 \ -$(DIR_SHARED)/Isoap_Mod/Dim_Polyhedron.h \ -Front_Mod/readme \ -Front_Mod/*.f90 \ +$(DIR_OBJECT)/Eddies_Mod.o:\ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Field_Mod.o \ Field_Mod/*/*.f90 \ -$(DIR_OBJECT)/Elem_Mod.o \ -Elem_Mod/*.f90 +Eddies_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Backup_Mod.f90 +# Dependencies for: ./Iter_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Backup_Mod.o:\ -$(DIR_OBJECT)/User_Mod.o \ -User_Mod/*.f90 \ -Backup_Mod/*.f90 +$(DIR_OBJECT)/Iter_Mod.o:\ +Iter_Mod/*.f90 \ +$(DIR_OBJECT)/Field_Mod.o \ +Field_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Face_Mod.f90 +# Dependencies for: ./Time_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Face_Mod.o:\ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -Face_Mod/*.f90 +$(DIR_OBJECT)/Time_Mod.o:\ +Time_Mod/*.f90 \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Field_Mod.f90 #--------------------------------------------------- $(DIR_OBJECT)/Field_Mod.o:\ +$(DIR_OBJECT)/Time_Mod.o \ +Time_Mod/*.f90 \ $(DIR_OBJECT)/Solver_Mod.o \ Solver_Mod/*.f90 \ $(DIR_OBJECT)/Numerics_Mod.o \ @@ -56,20 +41,12 @@ $(DIR_OBJECT)/Bulk_Mod.o \ Bulk_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Native_Mod.f90 +# Dependencies for: ./Solver_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Native_Mod.o:\ -$(DIR_OBJECT)/Work_Mod.o \ -$(DIR_SHARED)/Work_Mod/*/*.f90 \ -$(DIR_SHARED)/Work_Mod/*.f90 \ -$(DIR_OBJECT)/Vector_Mod.o \ -Vector_Mod/*.f90 \ -Native_Mod/*.f90 \ -$(DIR_OBJECT)/Matrix_Mod.o \ -Matrix_Mod/*.f90 \ -$(DIR_OBJECT)/Control_Mod.o \ -$(DIR_SHARED)/Control_Mod/*/*.f90 \ -$(DIR_SHARED)/Control_Mod/*.f90 +$(DIR_OBJECT)/Solver_Mod.o:\ +Solver_Mod/*.f90 \ +$(DIR_OBJECT)/Petsc_Mod.o \ +Petsc_Mod/*/*.f90 #--------------------------------------------------- # Dependencies for: ./Process_Mod.f90 @@ -83,8 +60,6 @@ $(DIR_OBJECT)/Turb_Mod.o \ Turb_Mod/*.f90 \ $(DIR_OBJECT)/Swarm_Mod.o \ Swarm_Mod/*.f90 \ -$(DIR_OBJECT)/Solver_Mod.o \ -Solver_Mod/*.f90 \ $(DIR_OBJECT)/Results_Mod.o \ Results_Mod/*.f90 \ $(DIR_OBJECT)/Read_Controls_Mod.o \ @@ -111,20 +86,37 @@ $(DIR_OBJECT)/Bulk_Mod.o \ Bulk_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Vert_Mod.f90 +# Dependencies for: ./Main_Pro.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Vert_Mod.o:\ -Vert_Mod/*.f90 \ -$(DIR_OBJECT)/Point_Mod.o \ -Point_Mod/*.f90 +$(DIR_OBJECT)/Main_Pro.o:\ +$(DIR_OBJECT)/Process_Mod.o \ +Process_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Monitor_Mod.f90 +# Dependencies for: ./Native_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Monitor_Mod.o:\ -Monitor_Mod/*.f90 \ -$(DIR_OBJECT)/Field_Mod.o \ -Field_Mod/*/*.f90 +$(DIR_OBJECT)/Native_Mod.o:\ +$(DIR_OBJECT)/Work_Mod.o \ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ +$(DIR_OBJECT)/Vector_Mod.o \ +Vector_Mod/*.f90 \ +Native_Mod/*.f90 \ +$(DIR_OBJECT)/Matrix_Mod.o \ +Matrix_Mod/*.f90 \ +$(DIR_OBJECT)/Control_Mod.o \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Surf_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Surf_Mod.o:\ +Surf_Mod/readme \ +Surf_Mod/*.f90 \ +Front_Mod/readme \ +$(DIR_OBJECT)/Front_Mod.o \ +Front_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Var_Mod.f90 @@ -136,104 +128,34 @@ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Vof_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Vof_Mod.o:\ -Vof_Mod/*/*.f90 \ -$(DIR_OBJECT)/Turb_Mod.o \ -Turb_Mod/*.f90 \ -Surf_Mod/readme \ -$(DIR_OBJECT)/Surf_Mod.o \ -Surf_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Info_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Info_Mod.o:\ -Info_Mod/*.f90 \ -$(DIR_OBJECT)/Field_Mod.o \ -Field_Mod/*/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Surf_Mod/Place_Surf_At_Value.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Place_Surf_At_Value.o: - -#--------------------------------------------------- -# Dependencies for: ./Swarm_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Swarm_Mod.o:\ -Swarm_Mod/*.f90 \ -$(DIR_OBJECT)/Particle_Mod.o \ -Particle_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./User_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/User_Mod.o:\ -User_Mod/*.f90 \ -$(DIR_OBJECT)/Swarm_Mod.o \ -Swarm_Mod/*.f90 \ -$(DIR_OBJECT)/Porosity_Mod.o \ -Porosity_Mod/*.f90 \ -$(DIR_OBJECT)/Interface_Mod.o \ -Interface_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Main_Pro.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Main_Pro.o:\ -$(DIR_OBJECT)/Process_Mod.o \ -Process_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Particle_Mod.f90 +# Dependencies for: ./Vert_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Particle_Mod.o:\ -$(DIR_OBJECT)/Vof_Mod.o \ -Vof_Mod/*/*.f90 \ -Particle_Mod/*.f90 +$(DIR_OBJECT)/Vert_Mod.o:\ +Vert_Mod/*.f90 \ +$(DIR_OBJECT)/Point_Mod.o \ +Point_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Porosity_Mod.f90 +# Dependencies for: ./Interface_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Porosity_Mod.o:\ -$(DIR_OBJECT)/Work_Mod.o \ -$(DIR_SHARED)/Work_Mod/*/*.f90 \ -$(DIR_SHARED)/Work_Mod/*.f90 \ -$(DIR_OBJECT)/Stl_Mod.o \ -$(DIR_SHARED)/Stl_Mod/*.f90 \ -Porosity_Mod/*.f90 \ +$(DIR_OBJECT)/Interface_Mod.o:\ +$(DIR_OBJECT)/Turb_Mod.o \ +Turb_Mod/*.f90 \ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +Interface_Mod/*.f90 \ $(DIR_OBJECT)/Control_Mod.o \ $(DIR_SHARED)/Control_Mod/*/*.f90 \ $(DIR_SHARED)/Control_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Petsc_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Petsc_Mod.o:\ -Petsc_Mod/*/*.f90 \ -$(DIR_OBJECT)/Native_Mod.o \ -Native_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Eddies_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Eddies_Mod.o:\ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Field_Mod.o \ -Field_Mod/*/*.f90 \ -Eddies_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Bulk_Mod.f90 +# Dependencies for: ./Face_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Bulk_Mod.o:\ +$(DIR_OBJECT)/Face_Mod.o:\ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ -Bulk_Mod/*.f90 +Face_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Results_Mod.f90 @@ -244,32 +166,12 @@ $(DIR_OBJECT)/Backup_Mod.o \ Backup_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Vector_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Vector_Mod.o:\ -Vector_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Matrix_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Matrix_Mod.o:\ -Matrix_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Read_Controls_Mod.f90 +# Dependencies for: ./Backup_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Read_Controls_Mod.o:\ -$(DIR_OBJECT)/Swarm_Mod.o \ -Swarm_Mod/*.f90 \ -Read_Controls_Mod/*.f90 \ -$(DIR_OBJECT)/Eddies_Mod.o \ -Eddies_Mod/*.f90 +$(DIR_OBJECT)/Backup_Mod.o:\ +$(DIR_OBJECT)/User_Mod.o \ +User_Mod/*.f90 \ +Backup_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Process_Mod/Initialize_Variables.f90 @@ -301,14 +203,6 @@ $(DIR_SHARED)/Comm_Mod/*/*.f90 \ $(DIR_OBJECT)/Bulk_Mod.o \ Bulk_Mod/*.f90 -#--------------------------------------------------- -# Dependencies for: ./Process_Mod/Logo_Pro.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Logo_Pro.o:\ -$(DIR_OBJECT)/Solver_Mod.o \ -Solver_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o - #--------------------------------------------------- # Dependencies for: ./Process_Mod/Update_Boundary_Values.f90 #--------------------------------------------------- @@ -330,41 +224,40 @@ $(DIR_OBJECT)/Comm_Mod.o \ $(DIR_SHARED)/Comm_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Interface_Mod.f90 +# Dependencies for: ./Point_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Interface_Mod.o:\ -$(DIR_OBJECT)/Turb_Mod.o \ -Turb_Mod/*.f90 \ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -Interface_Mod/*.f90 \ -$(DIR_OBJECT)/Control_Mod.o \ -$(DIR_SHARED)/Control_Mod/*/*.f90 \ -$(DIR_SHARED)/Control_Mod/*.f90 +$(DIR_OBJECT)/Point_Mod.o:\ +Point_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Solver_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Solver_Mod.o:\ -Solver_Mod/*.f90 \ -$(DIR_OBJECT)/Petsc_Mod.o \ -Petsc_Mod/*/*.f90 - +# Dependencies for: ./User_Mod.f90 #--------------------------------------------------- -# Dependencies for: ./Surf_Mod.f90 +$(DIR_OBJECT)/User_Mod.o:\ +User_Mod/*.f90 \ +$(DIR_OBJECT)/Swarm_Mod.o \ +Swarm_Mod/*.f90 \ +$(DIR_OBJECT)/Porosity_Mod.o \ +Porosity_Mod/*.f90 \ +$(DIR_OBJECT)/Interface_Mod.o \ +Interface_Mod/*.f90 + #--------------------------------------------------- -$(DIR_OBJECT)/Surf_Mod.o:\ -Surf_Mod/readme \ -Surf_Mod/*.f90 \ -Front_Mod/readme \ -$(DIR_OBJECT)/Front_Mod.o \ -Front_Mod/*.f90 +# Dependencies for: ./Matrix_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Matrix_Mod.o:\ +Matrix_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Point_Mod.f90 +# Dependencies for: ./Vector_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Point_Mod.o:\ -Point_Mod/*.f90 \ +$(DIR_OBJECT)/Vector_Mod.o:\ +Vector_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 @@ -376,133 +269,177 @@ $(DIR_OBJECT)/Elem_Mod.o:\ Elem_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Numerics_Mod.f90 +# Dependencies for: ./Monitor_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Numerics_Mod.o:\ -$(DIR_OBJECT)/Work_Mod.o \ -$(DIR_SHARED)/Work_Mod/*/*.f90 \ -$(DIR_SHARED)/Work_Mod/*.f90 \ -$(DIR_OBJECT)/Var_Mod.o \ -Var_Mod/*.f90 \ -Numerics_Mod/*.f90 \ -$(DIR_OBJECT)/Matrix_Mod.o \ -Matrix_Mod/*.f90 +$(DIR_OBJECT)/Monitor_Mod.o:\ +Monitor_Mod/*.f90 \ +$(DIR_OBJECT)/Field_Mod.o \ +Field_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Stl_Mod.f90 +# Dependencies for: ./Read_Controls_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Stl_Mod.o:\ +$(DIR_OBJECT)/Read_Controls_Mod.o:\ +$(DIR_OBJECT)/Swarm_Mod.o \ +Swarm_Mod/*.f90 \ +Read_Controls_Mod/*.f90 \ +$(DIR_OBJECT)/Eddies_Mod.o \ +Eddies_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Porosity_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Porosity_Mod.o:\ +$(DIR_OBJECT)/Work_Mod.o \ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ +$(DIR_OBJECT)/Stl_Mod.o \ $(DIR_SHARED)/Stl_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 +Porosity_Mod/*.f90 \ +$(DIR_OBJECT)/Control_Mod.o \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_1d_Cells_Nodes.f90 +# Dependencies for: ./Bulk_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Cells_Nodes.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Bulk_Mod.o:\ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 +Bulk_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Grid_Mod.f90 +# Dependencies for: ./Info_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Grid_Mod.o:\ -$(DIR_OBJECT)/Vtk_Mod.o \ -$(DIR_SHARED)/Vtk_Mod/*.f90 \ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ -$(DIR_OBJECT)/Profiler_Mod.o \ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Metis_Mod.o \ -$(DIR_SHARED)/Metis_Mod/*.f90 \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Boundary_Mod.o \ -$(DIR_OBJECT)/Assert_Mod.o \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_OBJECT)/Info_Mod.o:\ +Info_Mod/*.f90 \ +$(DIR_OBJECT)/Field_Mod.o \ +Field_Mod/*/*.f90 #--------------------------------------------------- -# Dependencies for: ./Boundary_Mod.f90 +# Dependencies for: ./Turb_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Boundary_Mod.o:\ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Turb_Mod.o:\ +Turb_Mod/*.f90 \ +$(DIR_OBJECT)/Iter_Mod.o \ +Iter_Mod/*.f90 \ +$(DIR_OBJECT)/Info_Mod.o \ +Info_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Polyhedron_Mod.f90 +# Dependencies for: ./Petsc_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Polyhedron_Mod.o:\ +$(DIR_OBJECT)/Petsc_Mod.o:\ +Petsc_Mod/*/*.f90 \ +$(DIR_OBJECT)/Native_Mod.o \ +Native_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Surf_Mod/Place_Surf_At_Value.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Place_Surf_At_Value.o: + +#--------------------------------------------------- +# Dependencies for: ./Vof_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Vof_Mod.o:\ +Vof_Mod/*/*.f90 \ +$(DIR_OBJECT)/Turb_Mod.o \ +Turb_Mod/*.f90 \ +Surf_Mod/readme \ +$(DIR_OBJECT)/Surf_Mod.o \ +Surf_Mod/*.f90 \ +$(DIR_OBJECT)/Stl_Mod.o \ +$(DIR_SHARED)/Stl_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Swarm_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Swarm_Mod.o:\ +Swarm_Mod/*.f90 \ +$(DIR_OBJECT)/Particle_Mod.o \ +Particle_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Numerics_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Numerics_Mod.o:\ $(DIR_OBJECT)/Work_Mod.o \ $(DIR_SHARED)/Work_Mod/*/*.f90 \ $(DIR_SHARED)/Work_Mod/*.f90 \ -$(DIR_SHARED)/Polyhedron_Mod/*.f90 +$(DIR_OBJECT)/Var_Mod.o \ +Var_Mod/*.f90 \ +Numerics_Mod/*.f90 \ +$(DIR_OBJECT)/Matrix_Mod.o \ +Matrix_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Profiler_Mod.f90 +# Dependencies for: ./Front_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Profiler_Mod.o:\ -$(DIR_SHARED)/Profiler_Mod/*.f90 \ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 +$(DIR_OBJECT)/Front_Mod.o:\ +$(DIR_OBJECT)/Vert_Mod.o \ +Vert_Mod/*.f90 \ +$(DIR_OBJECT)/Side_Mod.o \ +$(DIR_SHARED)/Isoap_Mod/readme \ +$(DIR_OBJECT)/Isoap_Mod.o \ +$(DIR_SHARED)/Isoap_Mod/*.f90 \ +Front_Mod/readme \ +Front_Mod/*.f90 \ +$(DIR_OBJECT)/Field_Mod.o \ +Field_Mod/*/*.f90 \ +$(DIR_OBJECT)/Elem_Mod.o \ +Elem_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Metis_Mod.f90 +# Dependencies for: ./Particle_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Metis_Mod.o:\ -$(DIR_SHARED)/Metis_Mod/*.f90 \ -$(DIR_OBJECT)/Assert_Mod.o \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_OBJECT)/Particle_Mod.o:\ +$(DIR_OBJECT)/Vof_Mod.o \ +Vof_Mod/*/*.f90 \ +Particle_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Isoap_Mod.f90 +# Dependencies for: ./Iso_Polygons_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Isoap_Mod.o:\ -$(DIR_OBJECT)/Polyhedron_Mod.o \ -$(DIR_SHARED)/Polyhedron_Mod/*.f90 \ -$(DIR_OBJECT)/Iso_Polygons_Mod.o \ -$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 \ -$(DIR_SHARED)/Isoap_Mod/readme \ -$(DIR_SHARED)/Isoap_Mod/*.f90 \ -$(DIR_SHARED)/Isoap_Mod/Dim_Polyhedron.h +$(DIR_OBJECT)/Iso_Polygons_Mod.o:\ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_1d_Nodes.f90 +# Dependencies for: ./Probe_1d_Cells.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Nodes.o:\ -$(DIR_OBJECT)/Sort_Mod.o \ -$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Probe_1d_Cells.o:\ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 +$(DIR_SHARED)/File_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./String_Mod.f90 +# Dependencies for: ./Probe_2d.f90 #--------------------------------------------------- -$(DIR_OBJECT)/String_Mod.o:\ -$(DIR_SHARED)/String_Mod/*.f90 +$(DIR_OBJECT)/Probe_2d.o:\ +$(DIR_OBJECT)/Math_Mod.o \ +$(DIR_SHARED)/Math_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Iso_Polygons_Mod.f90 +# Dependencies for: ./Message_Mod/Thick_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Iso_Polygons_Mod.o:\ -$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 +$(DIR_OBJECT)/Thick_Line.o:\ +$(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thick_Line.f90 +# Dependencies for: ./Message_Mod/Thin_Line.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thick_Line.o:\ +$(DIR_OBJECT)/Thin_Line.o:\ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- @@ -512,21 +449,20 @@ $(DIR_OBJECT)/Dashed_Line.o:\ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Message_Mod/Thin_Line.f90 +# Dependencies for: ./Math_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Thin_Line.o:\ +$(DIR_OBJECT)/Math_Mod.o:\ +$(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Message_Mod.f90 +# Dependencies for: ./Polyhedron_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Message_Mod.o:\ -$(DIR_OBJECT)/Tokenizer_Mod.o \ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ -$(DIR_SHARED)/Message_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o \ -$(DIR_OBJECT)/Assert_Mod.o \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_OBJECT)/Polyhedron_Mod.o:\ +$(DIR_OBJECT)/Work_Mod.o \ +$(DIR_SHARED)/Work_Mod/*/*.f90 \ +$(DIR_SHARED)/Work_Mod/*.f90 \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Control_Mod.f90 @@ -540,26 +476,20 @@ $(DIR_SHARED)/Control_Mod/*/*.f90 \ $(DIR_SHARED)/Control_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_2d.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Probe_2d.o:\ -$(DIR_OBJECT)/Math_Mod.o \ -$(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Grid_Mod.o \ -$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ -$(DIR_SHARED)/Grid_Mod/*.f90 \ -$(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Isoap_Mod/Main_Isoap.f90 +# Dependencies for: ./Tokenizer_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Main_Isoap.o: +$(DIR_OBJECT)/Tokenizer_Mod.o:\ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Isoap_Mod/Isopol.f90 +# Dependencies for: ./Assert_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Isopol.o: +$(DIR_OBJECT)/Assert_Mod.o:\ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 \ +$(DIR_SHARED)/Assert_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Vtk_Mod.f90 @@ -569,18 +499,10 @@ $(DIR_SHARED)/Vtk_Mod/*.f90 \ $(DIR_OBJECT)/Const_Mod.o #--------------------------------------------------- -# Dependencies for: ./Gen_Mod.f90 -#--------------------------------------------------- -$(DIR_OBJECT)/Gen_Mod.o:\ -$(DIR_SHARED)/Gen_Mod/*.f90 - -#--------------------------------------------------- -# Dependencies for: ./Assert_Mod.f90 +# Dependencies for: ./String_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Assert_Mod.o:\ -$(DIR_OBJECT)/Comm_Mod.o \ -$(DIR_SHARED)/Comm_Mod/*/*.f90 \ -$(DIR_SHARED)/Assert_Mod/*.f90 +$(DIR_OBJECT)/String_Mod.o:\ +$(DIR_SHARED)/String_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./File_Mod.f90 @@ -593,17 +515,24 @@ $(DIR_SHARED)/Message_Mod/*.f90 \ $(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Swap_Mod.f90 +# Dependencies for: ./Stl_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Swap_Mod.o:\ -$(DIR_SHARED)/Swap_Mod/*.f90 +$(DIR_OBJECT)/Stl_Mod.o:\ +$(DIR_SHARED)/Stl_Mod/*.f90 \ +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Tokenizer_Mod.f90 +# Dependencies for: ./Isoap_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Tokenizer_Mod.o:\ -$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Isoap_Mod.o:\ +$(DIR_OBJECT)/Polyhedron_Mod.o \ +$(DIR_SHARED)/Polyhedron_Mod/*.f90 \ +$(DIR_OBJECT)/Iso_Polygons_Mod.o \ +$(DIR_SHARED)/Iso_Polygons_Mod/*.f90 \ +$(DIR_SHARED)/Isoap_Mod/readme \ +$(DIR_SHARED)/Isoap_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Comm_Mod.f90 @@ -612,6 +541,23 @@ $(DIR_OBJECT)/Comm_Mod.o:\ $(DIR_OBJECT)/Const_Mod.o \ $(DIR_SHARED)/Comm_Mod/*/*.f90 +#--------------------------------------------------- +# Dependencies for: ./Region_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Region_Mod.o:\ +$(DIR_OBJECT)/Const_Mod.o + +#--------------------------------------------------- +# Dependencies for: ./Profiler_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Profiler_Mod.o:\ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Control_Mod.o \ +$(DIR_SHARED)/Control_Mod/*/*.f90 \ +$(DIR_SHARED)/Control_Mod/*.f90 \ +$(DIR_OBJECT)/Comm_Mod.o \ +$(DIR_SHARED)/Comm_Mod/*/*.f90 + #--------------------------------------------------- # Dependencies for: ./Sort_Mod.f90 #--------------------------------------------------- @@ -623,11 +569,18 @@ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Math_Mod.f90 +# Dependencies for: ./Probe_1d_Cells_Nodes.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Math_Mod.o:\ +$(DIR_OBJECT)/Probe_1d_Cells_Nodes.o:\ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_OBJECT)/Grid_Mod.o \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 #--------------------------------------------------- # Dependencies for: ./Work_Mod.f90 @@ -640,15 +593,76 @@ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 #--------------------------------------------------- -# Dependencies for: ./Probe_1d_Cells.f90 +# Dependencies for: ./Grid_Mod.f90 #--------------------------------------------------- -$(DIR_OBJECT)/Probe_1d_Cells.o:\ +$(DIR_OBJECT)/Grid_Mod.o:\ +$(DIR_OBJECT)/Vtk_Mod.o \ +$(DIR_SHARED)/Vtk_Mod/*.f90 \ +$(DIR_OBJECT)/Vect_Mod.o \ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Profiler_Mod.o \ +$(DIR_SHARED)/Profiler_Mod/*.f90 \ +$(DIR_OBJECT)/Metis_Mod.o \ +$(DIR_SHARED)/Metis_Mod/*.f90 \ +$(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ +$(DIR_SHARED)/Grid_Mod/*.f90 \ +$(DIR_OBJECT)/File_Mod.o \ +$(DIR_SHARED)/File_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Gen_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Gen_Mod.o:\ +$(DIR_SHARED)/Gen_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Metis_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Metis_Mod.o:\ +$(DIR_SHARED)/Metis_Mod/*.f90 \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Probe_1d_Nodes.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Probe_1d_Nodes.o:\ +$(DIR_OBJECT)/Sort_Mod.o \ +$(DIR_SHARED)/Sort_Mod/*.f90 \ $(DIR_OBJECT)/Math_Mod.o \ $(DIR_SHARED)/Math_Mod/*.f90 \ $(DIR_OBJECT)/Grid_Mod.o \ $(DIR_SHARED)/Grid_Mod/Metis_Partgraphrecursive.h90 \ $(DIR_SHARED)/Grid_Mod/*.f90 \ $(DIR_OBJECT)/File_Mod.o \ -$(DIR_SHARED)/File_Mod/*.f90 \ -$(DIR_OBJECT)/Const_Mod.o +$(DIR_SHARED)/File_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Message_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Message_Mod.o:\ +$(DIR_OBJECT)/Tokenizer_Mod.o \ +$(DIR_SHARED)/Tokenizer_Mod/*.f90 \ +$(DIR_SHARED)/Message_Mod/*.f90 \ +$(DIR_OBJECT)/Const_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Vect_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Vect_Mod.o:\ +$(DIR_SHARED)/Vect_Mod/*.f90 \ +$(DIR_OBJECT)/Region_Mod.o \ +$(DIR_OBJECT)/Assert_Mod.o \ +$(DIR_SHARED)/Assert_Mod/*.f90 + +#--------------------------------------------------- +# Dependencies for: ./Swap_Mod.f90 +#--------------------------------------------------- +$(DIR_OBJECT)/Swap_Mod.o:\ +$(DIR_SHARED)/Swap_Mod/*.f90 diff --git a/Sources/Shared/Assert_Mod/Handle_Assert.f90 b/Sources/Shared/Assert_Mod/Handle_Assert.f90 index c89404156..051dd5d45 100644 --- a/Sources/Shared/Assert_Mod/Handle_Assert.f90 +++ b/Sources/Shared/Assert_Mod/Handle_Assert.f90 @@ -8,17 +8,35 @@ subroutine Handle_Assert(fail, text, file, line) character(*) :: file integer :: line !-----------------------------------[Locals]-----------------------------------! - character(16) :: numb + character(16) :: numb, proc !==============================================================================! - if(fail) then - write(numb, '(i16)') line - print '(7a)', ' Assert(', text, & - ') failed in file ', file, & - ' at line ', trim(adjustl(numb)), & - '.' - call Comm_Mod_End - stop + ! Sequential run + if(Sequential_Run()) then + if(fail) then + write(numb, '(i16)') line + print '(7a)', ' Assert(', text, & + ') failed in file ', file, & + ' at line ', trim(adjustl(numb)), & + '.' + call Global % End_Parallel + stop + end if + + ! Parallel run + else + if(fail) then + write(numb, '(i16)') line + write(proc, '(i16)') This_Proc() + print '(9a)', ' Assert(', text, & + ') failed in file ', file, & + ' at line ', trim(adjustl(numb)), & + ' in processor ', trim(adjustl(proc)), & + '.' + call Global % End_Parallel + stop + end if + end if end subroutine diff --git a/Sources/Shared/Boundary_Mod.f90 b/Sources/Shared/Boundary_Mod.f90 deleted file mode 100644 index f4b864821..000000000 --- a/Sources/Shared/Boundary_Mod.f90 +++ /dev/null @@ -1,44 +0,0 @@ -!==============================================================================! - module Boundary_Mod -!------------------------------------------------------------------------------! -! This is used to store boundary conditions within a Grid_Type ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Const_Mod -!------------------------------------------------------------------------------! - implicit none -!==============================================================================! - - !---------------------------------------------------------! - ! Constants for identification of boundary conditions ! - !---------------------------------------------------------! - integer, parameter :: INFLOW = 10007 - integer, parameter :: WALL = 10009 - integer, parameter :: OUTFLOW = 10037 - integer, parameter :: SYMMETRY = 10039 - integer, parameter :: CONVECT = 10061 - integer, parameter :: WALLFL = 10067 - integer, parameter :: PRESSURE = 10069 - - !-------------------! - ! Boundary type ! - !-------------------! - type Boundary_Type - - ! Name of the boundary conditions specified in grid generation - ! It ranges through number of boundary conditions (aka colors) - character(SL), allocatable :: name(:) - - ! Boundary types, ranging through all colors - integer, allocatable :: type(:) - - ! Boundary condition color ranging through boundary cells. - ! Values start from one, zero is internal cell - ! (Follows nomenclature from "../Shared/Comm_Mod_Par.f90") - integer, allocatable :: color(:) - integer, allocatable :: color_s_cell(:) ! start bnd cell for color - integer, allocatable :: color_e_cell(:) ! end bnd cell for color - - end type - - end module diff --git a/Sources/Shared/Browse.h90 b/Sources/Shared/Browse.h90 new file mode 100644 index 000000000..7506370c1 --- /dev/null +++ b/Sources/Shared/Browse.h90 @@ -0,0 +1,39 @@ +!==============================================================================! +! Definition of browsing macros in T-Flows. ! +!------------------------------------------------------------------------------! + +# define Boundary_Regions() \ + 1, Grid % n_bnd_regions + +# define Boundary_And_Inside_Regions() \ + 1, Grid % n_regions + +# define Boundary_Inside_And_Buffer_Regions() \ + 1, Grid % n_regions + 1 + +# define All_Regions() \ + 1, Grid % n_bnd_regions + 5 + +# define Faces_In_Region(reg) \ + Grid % region % f_face(reg), \ + Grid % region % l_face(reg) + +# define Faces_In_Domain() \ + Grid % region % f_face(Grid % n_regions), \ + Grid % region % l_face(Grid % n_regions) + +# define Cells_In_Region(reg) \ + Grid % region % f_cell(reg), \ + Grid % region % l_cell(reg) + +# define Cells_In_Domain() \ + Grid % region % f_cell(Grid % n_regions), \ + Grid % region % l_cell(Grid % n_regions) + +# define Cells_In_Domain_And_Buffers() \ + Grid % region % f_cell(Grid % n_regions), \ + Grid % region % l_cell(Grid % n_regions + 1) + +# define Cells_In_Buffers() \ + Grid % region % f_cell(Grid % n_regions + 1), \ + Grid % region % l_cell(Grid % n_regions + 1) diff --git a/Sources/Shared/Comm_Mod.f90 b/Sources/Shared/Comm_Mod.f90 index 56d9a31e5..ae1ed0d88 100644 --- a/Sources/Shared/Comm_Mod.f90 +++ b/Sources/Shared/Comm_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Unused.h90" + !==============================================================================! module Comm_Mod !------------------------------------------------------------------------------! @@ -36,8 +38,8 @@ module Comm_Mod integer, allocatable :: cell_proc(:) ! Global cell and node numbers - integer, contiguous, pointer :: cell_glo(:) - integer, contiguous, pointer :: node_glo(:) + integer, allocatable :: cell_glo(:) + integer, allocatable :: node_glo(:) ! Variables which follow are for backup saving to single file integer :: nc_sub ! number of cells in subdomain @@ -63,6 +65,9 @@ module Comm_Mod type(Buffer_Type), allocatable :: cells_send(:) type(Buffer_Type), allocatable :: cells_recv(:) + integer, private :: n_processors ! number of processors + integer, private :: this_processor ! current processor + contains ! File management @@ -97,10 +102,27 @@ module Comm_Mod procedure :: Sendrecv_Log_Arrays procedure :: Sendrecv_Real_Arrays + ! Global + procedure :: End_Parallel + procedure :: Lor_Log + procedure :: Lor_Log_Array + procedure :: Max_Int + procedure :: Max_Real + procedure :: Min_Int + procedure :: Min_Real + procedure :: Start_Parallel + procedure :: Sum_Int + procedure :: Sum_Int_Array + procedure :: Sum_Real + procedure :: Sum_Real_Array + procedure :: Wait end type - integer :: this_proc ! processor i.d. - integer :: n_proc ! number of processors + !------------------------------------------------------------------------! + ! A big global communicator, introduced essentiall to give access to ! + ! private variables n_processors and this_processor to other objects ! + !------------------------------------------------------------------------! + type(Comm_Type) :: Global ! These communication types will depend on precision #if T_FLOWS_MPI == 1 @@ -115,11 +137,17 @@ module Comm_Mod contains + ! Shared pure function +# include "Comm_Mod/Shared/First_Proc.f90" +# include "Comm_Mod/Shared/N_Procs.f90" +# include "Comm_Mod/Shared/Parallel_Run.f90" +# include "Comm_Mod/Shared/Sequential_Run.f90" +# include "Comm_Mod/Shared/This_Proc.f90" + # if T_FLOWS_MPI == 1 - ! Three basic ones are non-member -# include "Comm_Mod/Parallel/Start.f90" +# include "Comm_Mod/Parallel/Start_Parallel.f90" # include "Comm_Mod/Parallel/Wait.f90" -# include "Comm_Mod/Parallel/End.f90" +# include "Comm_Mod/Parallel/End_Parallel.f90" ! File management # include "Comm_Mod/Parallel/Close_File.f90" @@ -165,10 +193,9 @@ module Comm_Mod # include "Comm_Mod/Parallel/Sendrecv_Log_Arrays.f90" # include "Comm_Mod/Parallel/Sendrecv_Real_Arrays.f90" # else - ! Three basic ones are non-member -# include "Comm_Mod/Sequential/Start.f90" +# include "Comm_Mod/Sequential/Start_Parallel.f90" # include "Comm_Mod/Sequential/Wait.f90" -# include "Comm_Mod/Sequential/End.f90" +# include "Comm_Mod/Sequential/End_Parallel.f90" ! File management # include "Comm_Mod/Sequential/Close_File.f90" diff --git a/Sources/Shared/Comm_Mod/Parallel/Close_File.f90 b/Sources/Shared/Comm_Mod/Parallel/Close_File.f90 index b5527ed38..622be8ffb 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Close_File.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Close_File.f90 @@ -5,10 +5,12 @@ subroutine Close_File(Comm, fh) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(inout) :: fh ! file handle !-----------------------------------[Locals]-----------------------------------! integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Close the file diff --git a/Sources/Shared/Comm_Mod/Parallel/Create_New_Types.f90 b/Sources/Shared/Comm_Mod/Parallel/Create_New_Types.f90 index 3a6fe14fa..186029253 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Create_New_Types.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Create_New_Types.f90 @@ -5,7 +5,7 @@ subroutine Create_New_Types(Comm) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm + class(Comm_Type), intent(inout) :: Comm !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 !==============================================================================! diff --git a/Sources/Shared/Comm_Mod/Parallel/End.f90 b/Sources/Shared/Comm_Mod/Parallel/End_Parallel.f90 similarity index 71% rename from Sources/Shared/Comm_Mod/Parallel/End.f90 rename to Sources/Shared/Comm_Mod/Parallel/End_Parallel.f90 index e22bfb7c9..b1f7e09e1 100644 --- a/Sources/Shared/Comm_Mod/Parallel/End.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/End_Parallel.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_End + subroutine End_Parallel(Global) !------------------------------------------------------------------------------! ! Ends parallel execution of the program ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Comm_Type) :: Global !-----------------------------------[Locals]-----------------------------------! integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! call Mpi_Barrier(MPI_COMM_WORLD, error) diff --git a/Sources/Shared/Comm_Mod/Parallel/Exchange_Int_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Exchange_Int_Array.f90 index 1ed1b2887..f2f2729c9 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Exchange_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Exchange_Int_Array.f90 @@ -7,18 +7,20 @@ subroutine Exchange_Int_Array(Comm, length, phi, dest) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: length - integer :: phi(length) - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: length + integer, intent(inout) :: phi(length) + integer, intent(in) :: dest ! destination processor !-----------------------------------[Locals]-----------------------------------! - integer :: rtag, stag, error + integer :: rtag, stag, error ! receive and send tags, error type(Mpi_Status) :: status +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Form send and receive tags - stag = (n_proc) * this_proc + dest ! tag for sending - rtag = (n_proc) * dest + this_proc ! tag for receiving + stag = Global % n_processors * Global % this_processor + dest + rtag = Global % n_processors * dest + Global % this_processor call Mpi_Sendrecv_Replace(phi(1), & ! buffer length, & ! length diff --git a/Sources/Shared/Comm_Mod/Parallel/Exchange_Log_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Exchange_Log_Array.f90 index 825c1b6a3..9cbe75607 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Exchange_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Exchange_Log_Array.f90 @@ -7,18 +7,20 @@ subroutine Exchange_Log_Array(Comm, length, phi, dest) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: length - logical :: phi(length) - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: length + logical, intent(inout) :: phi(length) + integer, intent(in) :: dest ! destination processor !-----------------------------------[Locals]-----------------------------------! - integer :: rtag, stag, error + integer :: rtag, stag, error ! receive and send tags, error type(Mpi_Status) :: status +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Form send and receive tags - stag = (n_proc) * this_proc + dest ! tag for sending - rtag = (n_proc) * dest + this_proc ! tag for receiving + stag = Global % n_processors * Global % this_processor + dest + rtag = Global % n_processors * dest + Global % this_processor call Mpi_Sendrecv_Replace(phi(1), & ! buffer length, & ! length diff --git a/Sources/Shared/Comm_Mod/Parallel/Exchange_Real_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Exchange_Real_Array.f90 index f8c2defd2..86f3a885f 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Exchange_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Exchange_Real_Array.f90 @@ -7,28 +7,30 @@ subroutine Exchange_Real_Array(Comm, length, phi, dest) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: length - real :: phi(length) - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: length + real, intent(inout) :: phi(length) + integer, intent(in) :: dest ! destination processor !-----------------------------------[Locals]-----------------------------------! - integer :: rtag, stag, error + integer :: rtag, stag, error ! receive and send tags, error type(Mpi_Status) :: status +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Form send and receive tags - stag = (n_proc) * this_proc + dest ! tag for sending - rtag = (n_proc) * dest + this_proc ! tag for receiving + stag = Global % n_processors * Global % this_processor + dest + rtag = Global % n_processors * dest + Global % this_processor - call Mpi_Sendrecv_Replace(phi(1), & ! buffer - length, & ! length - comm_type_real, & ! datatype - (dest-1), & ! dest, - stag, & ! sendtag, - (dest-1), & ! source, - rtag, & ! recvtag, - MPI_COMM_WORLD, & - status, & + call Mpi_Sendrecv_Replace(phi(1), & ! buffer + length, & ! length + comm_type_real, & ! datatype + (dest-1), & ! dest, + stag, & ! sendtag, + (dest-1), & ! source, + rtag, & ! recvtag, + MPI_COMM_WORLD, & + status, & error) end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log.f90 index f543d4413..984b4425d 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log.f90 @@ -1,14 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Lor_Log(phi) + subroutine Lor_Log(Global, phi) !------------------------------------------------------------------------------! ! Estimates logical or over all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical :: phi + class(Comm_Type), intent(in) :: Global + logical, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! logical :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! call Mpi_Allreduce(phi, & ! send buffer diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log_Array.f90 index 1e4a9e115..843870372 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Lor_Log_Array.f90 @@ -1,27 +1,25 @@ !==============================================================================! - subroutine Comm_Mod_Global_Lor_Log_Array(n, phi) + subroutine Lor_Log_Array(Global, n, phi) !------------------------------------------------------------------------------! ! Estimates logical or over all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n - logical :: phi(n) + class(Comm_Type), intent(in) :: Global + integer, intent(in) :: n + logical, intent(inout) :: phi(n) !-----------------------------------[Locals]-----------------------------------! - logical, allocatable :: phi_res(:) - integer :: error + integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! - allocate(phi_res(n)) - - call Mpi_Allreduce(phi, & ! send buffer - phi_res, & ! recv buffer + call Mpi_Allreduce(MPI_IN_PLACE, & ! indicate that send and recv are same + phi, & ! send and recv buffer n, & ! length comm_type_log, & ! datatype MPI_LOR, & ! operation MPI_COMM_WORLD, & error) - phi(1:n) = phi_res(1:n) - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Max_Int.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Max_Int.f90 index 788e54872..61d4fde5c 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Max_Int.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Max_Int.f90 @@ -1,14 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Max_Int(phi) + subroutine Max_Int(Global, phi) !------------------------------------------------------------------------------! ! Estimates global max among all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: phi + class(Comm_Type), intent(in) :: Global + integer, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! integer :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! call Mpi_Allreduce(phi, & ! send buffer diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Max_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Max_Real.f90 index e6b1a73e6..6c40a85d5 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Max_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Max_Real.f90 @@ -1,22 +1,25 @@ !==============================================================================! - subroutine Comm_Mod_Global_Max_Real(phi) + subroutine Max_Real(Global, phi) !------------------------------------------------------------------------------! ! Estimates global maximum among all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: phi + class(Comm_Type), intent(in) :: Global + real, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! real :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! - call Mpi_Allreduce(phi, & ! send buffer - phi_new, & ! recv buffer - 1, & ! length - comm_type_real, & ! datatype - MPI_MAX, & ! operation - MPI_COMM_WORLD, & + call Mpi_Allreduce(phi, & ! send buffer + phi_new, & ! recv buffer + 1, & ! length + comm_type_real, & ! datatype + MPI_MAX, & ! operation + MPI_COMM_WORLD, & error) phi = phi_new diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Min_Int.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Min_Int.f90 index 34ad9ea93..ecad6b00c 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Min_Int.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Min_Int.f90 @@ -1,14 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Min_Int(phi) + subroutine Min_Int(Global, phi) !------------------------------------------------------------------------------! ! Estimates global min among all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: phi + class(Comm_Type), intent(in) :: Global + integer, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! integer :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! call Mpi_Allreduce(phi, & ! send buffer diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Min_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Min_Real.f90 index f3fbdca09..6d90dfc3d 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Min_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Min_Real.f90 @@ -1,22 +1,25 @@ !==============================================================================! - subroutine Comm_Mod_Global_Min_Real(phi) + subroutine Min_Real(Global, phi) !------------------------------------------------------------------------------! ! Estimates global minimum among all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: phi + class(Comm_Type), intent(in) :: Global + real, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! real :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! - call Mpi_Allreduce(phi, & ! send buffer - phi_new, & ! recv buffer - 1, & ! length - comm_type_real, & ! datatype - MPI_MIN, & ! operation - MPI_COMM_WORLD, & + call Mpi_Allreduce(phi, & ! send buffer + phi_new, & ! recv buffer + 1, & ! length + comm_type_real, & ! datatype + MPI_MIN, & ! operation + MPI_COMM_WORLD, & error) phi = phi_new diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int.f90 index c8fec3db9..bcfb7deee 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int.f90 @@ -1,14 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Int(phi) + subroutine Sum_Int(Global, phi) !------------------------------------------------------------------------------! ! Estimates global summ among all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: phi + class(Comm_Type), intent(in) :: Global + integer, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! integer :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! call Mpi_Allreduce(phi, & ! send buffer diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int_Array.f90 index 35ff59400..b743315d8 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Int_Array.f90 @@ -1,27 +1,25 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Int_Array(n, phi) + subroutine Sum_Int_Array(Global, n, phi) !------------------------------------------------------------------------------! ! Estimates global sum over all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n - integer :: phi(n) + class(Comm_Type), intent(in) :: Global + integer, intent(in) :: n + integer, intent(inout) :: phi(n) !-----------------------------------[Locals]-----------------------------------! - integer, allocatable :: phi_res(:) - integer :: error + integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! - allocate(phi_res(n)) - - call Mpi_Allreduce(phi, & ! send buffer - phi_res, & ! recv buffer + call Mpi_Allreduce(MPI_IN_PLACE, & ! indicate that send and recv are same + phi, & ! send and recv buffer n, & ! length comm_type_int, & ! datatype MPI_SUM, & ! operation MPI_COMM_WORLD, & error) - phi(1:n) = phi_res(1:n) - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real.f90 index b457ee061..7988be619 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real.f90 @@ -1,22 +1,25 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Real(phi) + subroutine Sum_Real(Global, phi) !------------------------------------------------------------------------------! ! Estimates global sum over all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: phi + class(Comm_Type), intent(in) :: Global + real, intent(inout) :: phi !-----------------------------------[Locals]-----------------------------------! real :: phi_new integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! - call Mpi_Allreduce(phi, & ! send buffer - phi_new, & ! recv buffer - 1, & ! length - comm_type_real, & ! datatype - MPI_SUM, & ! operation - MPI_COMM_WORLD, & + call Mpi_Allreduce(phi, & ! send buffer + phi_new, & ! recv buffer + 1, & ! length + comm_type_real, & ! datatype + MPI_SUM, & ! operation + MPI_COMM_WORLD, & error) phi = phi_new diff --git a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real_Array.f90 index 91f80e652..a3497565d 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Global_Sum_Real_Array.f90 @@ -1,27 +1,25 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Real_Array(n, phi) + subroutine Sum_Real_Array(Global, n, phi) !------------------------------------------------------------------------------! ! Estimates global sum over all processors. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n - real :: phi(n) + class(Comm_Type), intent(in) :: Global + integer, intent(in) :: n + real, intent(inout) :: phi(n) !-----------------------------------[Locals]-----------------------------------! - real, allocatable :: phi_res(:) - integer :: error + integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! - allocate(phi_res(n)) - - call Mpi_Allreduce(phi, & ! send buffer - phi_res, & ! recv buffer - n, & ! length - comm_type_real, & ! datatype - MPI_SUM, & ! operation - MPI_COMM_WORLD, & + call Mpi_Allreduce(MPI_IN_PLACE, & ! indicate that send and recv are same + phi, & ! send and recv buffer + n, & ! length + comm_type_real, & ! datatype + MPI_SUM, & ! operation + MPI_COMM_WORLD, & error) - phi(1:n) = phi_res(1:n) - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Open_File_Read.f90 b/Sources/Shared/Comm_Mod/Parallel/Open_File_Read.f90 index 476a7ae45..8237ae907 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Open_File_Read.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Open_File_Read.f90 @@ -10,6 +10,8 @@ subroutine Open_File_Read(Comm, fh, file_name) character :: file_name*(*) ! file name !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Open file with MPI diff --git a/Sources/Shared/Comm_Mod/Parallel/Open_File_Write.f90 b/Sources/Shared/Comm_Mod/Parallel/Open_File_Write.f90 index ebb826b0f..111faced5 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Open_File_Write.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Open_File_Write.f90 @@ -10,12 +10,14 @@ subroutine Open_File_Write(Comm, fh, file_name) character :: file_name*(*) ! file name !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Open file with MPI call Mpi_File_Open(MPI_COMM_WORLD, & file_name, & - MPI_MODE_WRONLY + MPI_MODE_CREATE, & + MPI_MODE_WRONLY + MPI_MODE_CREATE, & MPI_INFO_NULL, & fh, & error) diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Bnd_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Bnd_Real.f90 index 3fd3059ce..9a7c9126a 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Bnd_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Bnd_Real.f90 @@ -5,10 +5,10 @@ subroutine Read_Bnd_Real(Comm, fh, array, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - real :: array(:) - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + real, intent(out) :: array(:) + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 !==============================================================================! diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Cell_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Cell_Real.f90 index 644086b96..e55edfe0e 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Cell_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Cell_Real.f90 @@ -5,10 +5,10 @@ subroutine Read_Cell_Real(Comm, fh, array, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - real :: array(:) - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + real, dimension(:), intent(out) :: array(:) ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 !==============================================================================! diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Int.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Int.f90 index 05d410d21..cb6ea48e8 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Int.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Int.f90 @@ -5,12 +5,14 @@ subroutine Read_Int(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - integer :: num ! number to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + integer, intent(out) :: num ! number to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Set it at position disp (same as in Write counterpart) diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Int_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Int_Array.f90 index 60cf83fdd..a4a22a363 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Int_Array.f90 @@ -5,13 +5,15 @@ subroutine Read_Int_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - integer, dimension(:) :: arr ! array to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + integer, dimension(:), intent(out) :: arr ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Log.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Log.f90 index 2d2ee80a9..8cd64fee8 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Log.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Log.f90 @@ -5,12 +5,14 @@ subroutine Read_Log(Comm, fh, var, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - logical :: var ! variable to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + logical, intent(out) :: var ! variable to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Set it at position disp (same as in Write counterpart) diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Log_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Log_Array.f90 index c6f4c089f..3d536afbc 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Log_Array.f90 @@ -5,13 +5,15 @@ subroutine Read_Log_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - logical, dimension(:) :: arr ! array to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + logical, dimension(:), intent(out) :: arr ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Real.f90 index d2b806479..280b745df 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Real.f90 @@ -5,12 +5,14 @@ subroutine Read_Real(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - real :: num ! number to write out - integer(DP) :: disp ! diplacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + real, intent(out) :: num ! number to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Set it at position disp (same as in Write counterpart) diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Real_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Real_Array.f90 index 098fb86e0..f49c982ff 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Real_Array.f90 @@ -5,13 +5,15 @@ subroutine Read_Real_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - real, dimension(:) :: arr ! array to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + real, dimension(:), intent(out) :: arr ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Parallel/Read_Text.f90 b/Sources/Shared/Comm_Mod/Parallel/Read_Text.f90 index bf94d07d0..2276b9459 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Read_Text.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Read_Text.f90 @@ -5,13 +5,15 @@ subroutine Read_Text(Comm, fh, text_in, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - character :: text_in*(*) ! text to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + character, intent(out) :: text_in*(*) ! text to read in + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: leng integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! leng = len(text_in) diff --git a/Sources/Shared/Comm_Mod/Parallel/Recv_Int_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Recv_Int_Array.f90 deleted file mode 100644 index a3ca2649b..000000000 --- a/Sources/Shared/Comm_Mod/Parallel/Recv_Int_Array.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!==============================================================================! - subroutine Recv_Int_Array(Comm, len_r, phi_r, dest) -!------------------------------------------------------------------------------! -! Receives an integer array from processor dest. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_r ! receive length - integer :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor -!-----------------------------------[Locals]-----------------------------------! - integer :: rtag, error - integer :: status(MPI_STATUS_SIZE) -!==============================================================================! - - ! Form Receive tags - rtag = (n_proc) * dest + this_proc ! tag for receiving - - call Mpi_Recv(phi_r(1), & ! receive buffer - len_r, & ! receive length - comm_type_int, & ! datatype - (dest-1), & ! source, - rtag, & ! recvtag, - MPI_COMM_WORLD, & - status, & - error) - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Recv_Log_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Recv_Log_Array.f90 deleted file mode 100644 index 667c11116..000000000 --- a/Sources/Shared/Comm_Mod/Parallel/Recv_Log_Array.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!==============================================================================! - subroutine Recv_Log_Array(Comm, len_r, phi_r, dest) -!------------------------------------------------------------------------------! -! Receives a logical array from processor dest. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_r ! receive length - logical :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor -!-----------------------------------[Locals]-----------------------------------! - integer :: rtag, error - integer :: status(MPI_STATUS_SIZE) -!==============================================================================! - - ! Form Receive tags - rtag = (n_proc) * dest + this_proc ! tag for receiving - - call Mpi_Recv(phi_r(1), & ! receive buffer - len_r, & ! receive length - comm_type_log, & ! datatype - (dest-1), & ! source, - rtag, & ! recvtag, - MPI_COMM_WORLD, & - status, & - error) - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Recv_Real_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Recv_Real_Array.f90 deleted file mode 100644 index 3da8874aa..000000000 --- a/Sources/Shared/Comm_Mod/Parallel/Recv_Real_Array.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!==============================================================================! - subroutine Recv_Real_Array(Comm, len_r, phi_r, dest) -!------------------------------------------------------------------------------! -! Receives a real array from processor dest. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_r ! receive length - real :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor -!-----------------------------------[Locals]-----------------------------------! - integer :: rtag, error - integer :: status(MPI_STATUS_SIZE) -!==============================================================================! - - ! Form Receive tags - rtag = (n_proc) * dest + this_proc ! tag for receiving - - call Mpi_Recv(phi_r(1), & ! receive buffer - len_r, & ! receive length - comm_type_real, & ! datatype - (dest-1), & ! source, - rtag, & ! recvtag, - MPI_COMM_WORLD, & - status, & - error) - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Send_Int_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Send_Int_Array.f90 deleted file mode 100644 index 69a7a532e..000000000 --- a/Sources/Shared/Comm_Mod/Parallel/Send_Int_Array.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!==============================================================================! - subroutine Send_Int_Array(Comm, len_s, phi_s, dest) -!------------------------------------------------------------------------------! -! Sends an integer array to processor dest. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - integer :: phi_s(len_s) ! send buffer - integer :: dest ! destination processor -!-----------------------------------[Locals]-----------------------------------! - integer :: stag, error - integer :: status(MPI_STATUS_SIZE) -!==============================================================================! - - ! Form send tag - stag = (n_proc) * this_proc + dest ! tag for sending - - call Mpi_Send(phi_s(1), & ! send buffer - len_s, & ! send length - comm_type_int, & ! datatype - (dest-1), & ! dest, - stag, & ! sendtag, - MPI_COMM_WORLD, & - status, & - error) - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Send_Log_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Send_Log_Array.f90 deleted file mode 100644 index f587a184f..000000000 --- a/Sources/Shared/Comm_Mod/Parallel/Send_Log_Array.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!==============================================================================! - subroutine Send_Log_Array(Comm, len_s, phi_s, dest) -!------------------------------------------------------------------------------! -! Sends a logical array to processor dest. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - logical :: phi_s(len_s) ! send buffer - integer :: dest ! destination processor -!-----------------------------------[Locals]-----------------------------------! - integer :: stag, error - integer :: status(MPI_STATUS_SIZE) -!==============================================================================! - - ! Form send tag - stag = (n_proc) * this_proc + dest ! tag for sending - - call Mpi_Send(phi_s(1), & ! send buffer - len_s, & ! send length - comm_type_log, & ! datatype - (dest-1), & ! dest, - stag, & ! sendtag, - MPI_COMM_WORLD, & - status, & - error) - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Send_Real_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Send_Real_Array.f90 deleted file mode 100644 index aa34b00a3..000000000 --- a/Sources/Shared/Comm_Mod/Parallel/Send_Real_Array.f90 +++ /dev/null @@ -1,29 +0,0 @@ -!==============================================================================! - subroutine Send_Real_Array(Comm, len_s, phi_s, dest) -!------------------------------------------------------------------------------! -! Sends a real array to processor dest. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - real :: phi_s(len_s) ! send buffer - integer :: dest ! destination processor -!-----------------------------------[Locals]-----------------------------------! - integer :: stag, error - integer :: status(MPI_STATUS_SIZE) -!==============================================================================! - - ! Form send tag - stag = (n_proc) * this_proc + dest ! tag for sending - - call Mpi_Send(phi_s(1), & ! send buffer - len_s, & ! send length - comm_type_real, & ! datatype - (dest-1), & ! dest, - stag, & ! sendtag, - MPI_COMM_WORLD, & - status, & - error) - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Int_Arrays.f90 b/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Int_Arrays.f90 index 6163443bf..4ed25f549 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Int_Arrays.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Int_Arrays.f90 @@ -6,20 +6,22 @@ subroutine Sendrecv_Int_Arrays(Comm, len_s, phi_s, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - integer :: phi_s(len_s) ! send buffer - integer :: len_r ! receive length - integer :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: len_s ! send length + integer, intent(in) :: phi_s(len_s) ! send buffer + integer, intent(in) :: len_r ! receive length + integer, intent(out) :: phi_r(len_r) ! receive buffer + integer, intent(in) :: dest ! destination processor !-----------------------------------[Locals]-----------------------------------! - integer :: rtag, stag, error + integer :: rtag, stag, error ! tags to send and receive, error type(Mpi_Status) :: status +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Form send and receive tags - stag = (n_proc) * this_proc + dest ! tag for sending - rtag = (n_proc) * dest + this_proc ! tag for receiving + stag = Global % n_processors * Global % this_processor + dest + rtag = Global % n_processors * dest + Global % this_processor call Mpi_Sendrecv(phi_s(1), & ! send buffer len_s, & ! send length diff --git a/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Log_Arrays.f90 b/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Log_Arrays.f90 index 2ecac5e0d..40ff81d7e 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Log_Arrays.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Log_Arrays.f90 @@ -6,20 +6,22 @@ subroutine Sendrecv_Log_Arrays(Comm, len_s, phi_s, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - logical :: phi_s(len_s) ! send buffer - integer :: len_r ! receive length - logical :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: len_s ! send length + logical, intent(in) :: phi_s(len_s) ! send buffer + integer, intent(in) :: len_r ! receive length + logical, intent(out) :: phi_r(len_r) ! receive buffer + integer, intent(in) :: dest ! destination processor !-----------------------------------[Locals]-----------------------------------! - integer :: rtag, stag, error + integer :: rtag, stag, error ! tags to send and receive, error type(Mpi_Status) :: status +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Form send and receive tags - stag = (n_proc) * this_proc + dest ! tag for sending - rtag = (n_proc) * dest + this_proc ! tag for receiving + stag = Global % n_processors * Global % this_processor + dest + rtag = Global % n_processors * dest + Global % this_processor call Mpi_Sendrecv(phi_s(1), & ! send buffer len_s, & ! send length diff --git a/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Real_Arrays.f90 b/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Real_Arrays.f90 index cadc3acdb..1ae563f36 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Real_Arrays.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Sendrecv_Real_Arrays.f90 @@ -6,20 +6,22 @@ subroutine Sendrecv_Real_Arrays(Comm, len_s, phi_s, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - real :: phi_s(len_s) ! send buffer - integer :: len_r ! receive length - real :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: len_s ! send length + real, intent(in) :: phi_s(len_s) ! send buffer + integer, intent(in) :: len_r ! receive length + real, intent(out) :: phi_r(len_r) ! receive buffer + integer, intent(in) :: dest ! destination processor !-----------------------------------[Locals]-----------------------------------! - integer :: rtag, stag, error + integer :: rtag, stag, error ! tags to send and receive, error type(Mpi_Status) :: status +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Form send and receive tags - stag = (n_proc) * this_proc + dest ! tag for sending - rtag = (n_proc) * dest + this_proc ! tag for receiving + stag = Global % n_processors * Global % this_processor + dest + rtag = Global % n_processors * dest + Global % this_processor call Mpi_Sendrecv(phi_s(1), & ! send buffer len_s, & ! send length diff --git a/Sources/Shared/Comm_Mod/Parallel/Start.f90 b/Sources/Shared/Comm_Mod/Parallel/Start_Parallel.f90 similarity index 73% rename from Sources/Shared/Comm_Mod/Parallel/Start.f90 rename to Sources/Shared/Comm_Mod/Parallel/Start_Parallel.f90 index 9244e7a81..bce6f67a0 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Start.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Start_Parallel.f90 @@ -1,9 +1,11 @@ !==============================================================================! - subroutine Comm_Mod_Start + subroutine Start_Parallel(Global) !------------------------------------------------------------------------------! ! Initializes parallel execution. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Comm_Type) :: Global !-----------------------------------[Locals]-----------------------------------! integer :: error integer :: n @@ -13,18 +15,18 @@ subroutine Comm_Mod_Start call Mpi_Init(error) ! Get number of processors - call Mpi_Comm_Size(MPI_COMM_WORLD, n_proc, error) + call Mpi_Comm_Size(MPI_COMM_WORLD, Global % n_processors, error) ! Get current processor number - call Mpi_Comm_Rank(MPI_COMM_WORLD, this_proc, error) + call Mpi_Comm_Rank(MPI_COMM_WORLD, Global % this_processor, error) ! Use Fortran counting - from 1 - this_proc = this_proc + 1 + Global % this_processor = Global % this_processor + 1 ! But if run is sequential, set the only processor to zero - if(n_proc .eq. 1) then - n_proc = 0 - this_proc = 0 + if(Global % n_processors .eq. 1) then + Global % n_processors = 0 + Global % this_processor = 0 endif ! Set proper types for communication @@ -37,10 +39,10 @@ subroutine Comm_Mod_Start ! Make sure that integers are 32-bit if(IP .eq. DP) then - if(this_proc < 2) then + if(Global % this_processor < 2) then print *, '# Error - 64 bit integers are not supported!' print *, '# This error is critical, exiting!' - call Comm_Mod_End + call Global % End_Parallel stop end if end if diff --git a/Sources/Shared/Comm_Mod/Parallel/Wait.f90 b/Sources/Shared/Comm_Mod/Parallel/Wait.f90 index a410dc72e..4d49d95ec 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Wait.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Wait.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Wait + subroutine Wait(Global) !------------------------------------------------------------------------------! ! Puts barrier for parallel execution. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Comm_Type) :: Global !-----------------------------------[Locals]-----------------------------------! integer :: error +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! call Mpi_Barrier(MPI_COMM_WORLD, error) diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Int.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Int.f90 index f504ac2a2..765c7d10b 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Int.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Int.f90 @@ -5,12 +5,14 @@ subroutine Write_Int(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - integer :: num ! number to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + integer, intent(in) :: num ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Set it at position disp (same as in Read counterpart) diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Int_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Int_Array.f90 index b9aca58aa..73b59be27 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Int_Array.f90 @@ -5,13 +5,15 @@ subroutine Write_Int_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - integer, dimension(:) :: arr ! array to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + integer, dimension(:), intent(in) :: arr ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Log.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Log.f90 index 373648268..daacdb85a 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Log.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Log.f90 @@ -5,12 +5,14 @@ subroutine Write_Log(Comm, fh, var, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - logical :: var ! variable to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + logical, intent(in) :: var ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Set it at position disp (same as in Read counterpart) diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Log_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Log_Array.f90 index a965a59d9..89a575f0a 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Log_Array.f90 @@ -5,13 +5,15 @@ subroutine Write_Log_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - logical, dimension(:) :: arr ! array to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + logical, dimension(:), intent(in) :: arr ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Real.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Real.f90 index fe2e6901a..4e16b835a 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Real.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Real.f90 @@ -5,12 +5,14 @@ subroutine Write_Real(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - real :: num ! number to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + real, intent(in) :: num ! number to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Set it at position disp (same as in Read counterpart) diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Real_Array.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Real_Array.f90 index 709d23965..d9975f3d8 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Real_Array.f90 @@ -5,13 +5,15 @@ subroutine Write_Real_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - real, dimension(:) :: arr ! array to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + real, dimension(:), intent(in) :: arr ! array to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Parallel/Write_Text.f90 b/Sources/Shared/Comm_Mod/Parallel/Write_Text.f90 index 0ae374dfc..6ca453c57 100644 --- a/Sources/Shared/Comm_Mod/Parallel/Write_Text.f90 +++ b/Sources/Shared/Comm_Mod/Parallel/Write_Text.f90 @@ -5,13 +5,15 @@ subroutine Write_Text(Comm, fh, text_out, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - type(Mpi_File) :: fh ! file handle - character :: text_out*(*) ! text to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + type(Mpi_File), intent(in) :: fh ! file handle + character, intent(in) :: text_out*(*) ! text to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: leng integer :: error = 0 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! leng = len(text_out) diff --git a/Sources/Shared/Comm_Mod/Sequential/Close_File.f90 b/Sources/Shared/Comm_Mod/Sequential/Close_File.f90 index c1dc27cd3..ee7106724 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Close_File.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Close_File.f90 @@ -5,8 +5,10 @@ subroutine Close_File(Comm, fh) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle + class(Comm_Type), intent(in) :: Comm + integer, intent(inout) :: fh ! file handle +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! close(fh) diff --git a/Sources/Shared/Comm_Mod/Sequential/Create_New_Types.f90 b/Sources/Shared/Comm_Mod/Sequential/Create_New_Types.f90 index d487947c8..7c17ac020 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Create_New_Types.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Create_New_Types.f90 @@ -5,7 +5,9 @@ subroutine Create_New_Types(Comm) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm + class(Comm_Type), intent(inout) :: Comm +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/End.f90 b/Sources/Shared/Comm_Mod/Sequential/End_Parallel.f90 similarity index 64% rename from Sources/Shared/Comm_Mod/Sequential/End.f90 rename to Sources/Shared/Comm_Mod/Sequential/End_Parallel.f90 index 3beaed718..05e785d4f 100644 --- a/Sources/Shared/Comm_Mod/Sequential/End.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/End_Parallel.f90 @@ -1,9 +1,13 @@ !==============================================================================! - subroutine Comm_Mod_End + subroutine End_Parallel(Global) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Comm_Type) :: Global +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Exchange_Int_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Exchange_Int_Array.f90 index 117a6311e..72af9ec31 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Exchange_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Exchange_Int_Array.f90 @@ -5,10 +5,15 @@ subroutine Exchange_Int_Array(Comm, length, phi, dest) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: length - integer :: phi(length) - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: length + integer, intent(inout) :: phi(length) + integer, intent(in) :: dest ! destination processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) + Unused(length) + Unused(phi) + Unused(dest) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Exchange_Log_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Exchange_Log_Array.f90 index f9adf2460..91e91fe13 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Exchange_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Exchange_Log_Array.f90 @@ -5,10 +5,15 @@ subroutine Exchange_Log_Array(Comm, length, phi, dest) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: length - logical :: phi(length) - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: length + logical, intent(inout) :: phi(length) + integer, intent(in) :: dest ! destination processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) + Unused(length) + Unused(phi) + Unused(dest) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Exchange_Real_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Exchange_Real_Array.f90 index 7be3aa257..a71bc66b1 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Exchange_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Exchange_Real_Array.f90 @@ -5,10 +5,15 @@ subroutine Exchange_Real_Array(Comm, length, phi, dest) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: length - real :: phi(length) - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: length + real, intent(inout) :: phi(length) + integer, intent(in) :: dest ! destination processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) + Unused(length) + Unused(phi) + Unused(dest) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log.f90 index 9dfbd9785..7857c02e8 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Lor_Log(phi) + subroutine Lor_Log(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential compilation. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical :: phi + class(Comm_Type), intent(in) :: Global + logical, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log_Array.f90 index b380c8e03..88b8b3942 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Lor_Log_Array.f90 @@ -1,12 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Lor_Log_Array(n, phi) + subroutine Lor_Log_Array(Global, n, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n - logical :: phi(n) + class(Comm_Type), intent(in) :: Global + integer, intent(in) :: n + logical, intent(inout) :: phi(n) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(n) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Max_Int.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Max_Int.f90 index fcece6c92..b3dd5e89d 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Max_Int.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Max_Int.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Max_Int(phi) + subroutine Max_Int(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential compilation. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: phi + class(Comm_Type), intent(in) :: Global + integer, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Max_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Max_Real.f90 index 4185c093b..e84a24f0f 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Max_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Max_Real.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Max_Real(phi) + subroutine Max_Real(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: phi + class(Comm_Type), intent(in) :: Global + real, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Min_Int.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Min_Int.f90 index bed63d458..77bfc5a3c 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Min_Int.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Min_Int.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Min_Int(phi) + subroutine Min_Int(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential compilation. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: phi + class(Comm_Type), intent(in) :: Global + integer, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Min_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Min_Real.f90 index 602437cc5..4643f109d 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Min_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Min_Real.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Min_Real(phi) + subroutine Min_Real(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: phi + class(Comm_Type), intent(in) :: Global + real, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int.f90 index 471ca3909..55ac0b279 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Int(phi) + subroutine Sum_Int(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: phi + class(Comm_Type), intent(in) :: Global + integer, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int_Array.f90 index ee6b61f51..bc84532cb 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Int_Array.f90 @@ -1,12 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Int_Array(n, phi) + subroutine Sum_Int_Array(Global, n, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n - integer :: phi(n) + class(Comm_Type), intent(in) :: Global + integer, intent(in) :: n + integer, intent(inout) :: phi(n) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(n) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real.f90 index 46258d894..109d1efa1 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real.f90 @@ -1,11 +1,15 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Real(phi) + subroutine Sum_Real(Global, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: phi + class(Comm_Type), intent(in) :: Global + real, intent(inout) :: phi +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real_Array.f90 index e15dadbdd..d24dfc061 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Global_Sum_Real_Array.f90 @@ -1,12 +1,17 @@ !==============================================================================! - subroutine Comm_Mod_Global_Sum_Real_Array(n, phi) + subroutine Sum_Real_Array(Global, n, phi) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: n - real :: phi(n) + class(Comm_Type), intent(in) :: Global + integer, intent(in) :: n + real, intent(inout) :: phi(n) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) + Unused(n) + Unused(phi) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Open_File_Read.f90 b/Sources/Shared/Comm_Mod/Sequential/Open_File_Read.f90 index 4ed3e8615..fe4416189 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Open_File_Read.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Open_File_Read.f90 @@ -8,6 +8,8 @@ subroutine Open_File_Read(Comm, fh, file_name) class(Comm_Type) :: Comm integer :: fh ! file handle character :: file_name*(*) ! file name +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! fh = 9 diff --git a/Sources/Shared/Comm_Mod/Sequential/Open_File_Write.f90 b/Sources/Shared/Comm_Mod/Sequential/Open_File_Write.f90 index ac8f624cd..4ab5839fa 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Open_File_Write.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Open_File_Write.f90 @@ -8,6 +8,8 @@ subroutine Open_File_Write(Comm, fh, file_name) class(Comm_Type) :: Comm integer :: fh ! file handle character :: file_name*(*) ! file name +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! fh = 9 diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Bnd_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Bnd_Real.f90 index 8b93b1317..828530165 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Bnd_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Bnd_Real.f90 @@ -5,10 +5,10 @@ subroutine Read_Bnd_Real(Comm, fh, array, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - real :: array(:) - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + real, intent(out) :: array(:) + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: c !==============================================================================! diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Cell_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Cell_Real.f90 index 8d132a353..2bf170b3f 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Cell_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Cell_Real.f90 @@ -5,10 +5,10 @@ subroutine Read_Cell_Real(Comm, fh, array, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - real :: array(:) - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + real, dimension(:), intent(out) :: array(:) ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: c !==============================================================================! diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Int.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Int.f90 index 64ec7f47a..b6c908f11 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Int.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Int.f90 @@ -5,10 +5,12 @@ subroutine Read_Int(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - integer :: num ! number to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + integer, intent(out) :: num ! number to read + integer(DP), intent(inout) :: disp ! displacement in bytes +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Position yourself at the right place inside the file diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Int_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Int_Array.f90 index de19d6ed4..699506080 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Int_Array.f90 @@ -5,12 +5,14 @@ subroutine Read_Int_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - integer, dimension(:) :: arr ! array to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + integer, dimension(:), intent(out) :: arr ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! length = size(arr) diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Log.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Log.f90 index 4342631af..5495158ee 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Log.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Log.f90 @@ -5,10 +5,12 @@ subroutine Read_Log(Comm, fh, var, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - logical :: var ! variable to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + logical, intent(out) :: var ! variable to read + integer(DP), intent(inout) :: disp ! displacement in bytes +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Position yourself at the right place inside the file diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Log_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Log_Array.f90 index d3b3378b0..69ceafd96 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Log_Array.f90 @@ -5,12 +5,14 @@ subroutine Read_Log_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - logical, dimension(:) :: arr ! array to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + logical, dimension(:), intent(out) :: arr ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! length = size(arr) diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Real.f90 index 2bf3cb513..ef4cd9d1a 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Real.f90 @@ -5,10 +5,12 @@ subroutine Read_Real(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - real :: num ! number to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + real, intent(out) :: num ! number to write out + integer(DP), intent(inout) :: disp ! displacement in bytes +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Position yourself at the right place inside the file diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Real_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Real_Array.f90 index 42f3842d9..dc54bd159 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Real_Array.f90 @@ -5,12 +5,14 @@ subroutine Read_Real_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - real, dimension(:) :: arr ! array to read - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + real, dimension(:), intent(out) :: arr ! array to read + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! length = size(arr) diff --git a/Sources/Shared/Comm_Mod/Sequential/Read_Text.f90 b/Sources/Shared/Comm_Mod/Sequential/Read_Text.f90 index 0be485f06..9afbea360 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Read_Text.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Read_Text.f90 @@ -5,12 +5,14 @@ subroutine Read_Text(Comm, fh, text_in, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - character :: text_in*(*) ! text to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + character, intent(out) :: text_in*(*) ! text to read in + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: leng +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! leng = len(text_in) diff --git a/Sources/Shared/Comm_Mod/Sequential/Recv_Int_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Recv_Int_Array.f90 deleted file mode 100644 index 2ef1abe15..000000000 --- a/Sources/Shared/Comm_Mod/Sequential/Recv_Int_Array.f90 +++ /dev/null @@ -1,14 +0,0 @@ -!==============================================================================! - subroutine Recv_Int_Array(Comm, len_r, phi_r, dest) -!------------------------------------------------------------------------------! -! Dummy function for sequential compilation. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_r ! receive length - integer :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor -!==============================================================================! - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Recv_Log_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Recv_Log_Array.f90 deleted file mode 100644 index 871926c52..000000000 --- a/Sources/Shared/Comm_Mod/Sequential/Recv_Log_Array.f90 +++ /dev/null @@ -1,14 +0,0 @@ -!==============================================================================! - subroutine Recv_Log_Array(Comm, len_r, phi_r, dest) -!------------------------------------------------------------------------------! -! Dummy function for sequential compilation. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_r ! receive length - logical :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor -!==============================================================================! - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Recv_Real_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Recv_Real_Array.f90 deleted file mode 100644 index c1ffad399..000000000 --- a/Sources/Shared/Comm_Mod/Sequential/Recv_Real_Array.f90 +++ /dev/null @@ -1,14 +0,0 @@ -!==============================================================================! - subroutine Recv_Real_Array(Comm, len_r, phi_r, dest) -!------------------------------------------------------------------------------! -! Dummy function for sequential compilation. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_r ! receive length - real :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor -!==============================================================================! - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Send_Int_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Send_Int_Array.f90 deleted file mode 100644 index 5d5fe7b05..000000000 --- a/Sources/Shared/Comm_Mod/Sequential/Send_Int_Array.f90 +++ /dev/null @@ -1,14 +0,0 @@ -!==============================================================================! - subroutine Send_Int_Array(Comm, len_s, phi_s, dest) -!------------------------------------------------------------------------------! -! Dummy function for sequential compilation. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - integer :: phi_s(len_s) ! send buffer - integer :: dest ! destination processor -!==============================================================================! - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Send_Real_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Send_Real_Array.f90 deleted file mode 100644 index 42889616c..000000000 --- a/Sources/Shared/Comm_Mod/Sequential/Send_Real_Array.f90 +++ /dev/null @@ -1,14 +0,0 @@ -!==============================================================================! - subroutine Send_Real_Array(Comm, len_s, phi_s, dest) -!------------------------------------------------------------------------------! -! Dummy function for sequential compilation. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - real :: phi_s(len_s) ! send buffer - integer :: dest ! destination processor -!==============================================================================! - - end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Int_Arrays.f90 b/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Int_Arrays.f90 index d124c1e29..c5da80619 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Int_Arrays.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Int_Arrays.f90 @@ -6,12 +6,19 @@ subroutine Sendrecv_Int_Arrays(Comm, len_s, phi_s, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - integer :: phi_s(len_s) ! send buffer - integer :: len_r ! receive length - integer :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: len_s ! send length + integer, intent(in) :: phi_s(len_s) ! send buffer + integer, intent(in) :: len_r ! receive length + integer, intent(in) :: phi_r(len_r) ! receive buffer + integer, intent(in) :: dest ! destination processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) + Unused(len_s) + Unused(phi_s) + Unused(len_r) + Unused(phi_r) + Unused(dest) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Log_Arrays.f90 b/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Log_Arrays.f90 index 241cd49e7..a51af0546 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Log_Arrays.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Log_Arrays.f90 @@ -6,12 +6,19 @@ subroutine Sendrecv_Log_Arrays(Comm, len_s, phi_s, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - logical :: phi_s(len_s) ! send buffer - integer :: len_r ! receive length - logical :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: len_s ! send length + logical, intent(in) :: phi_s(len_s) ! send buffer + integer, intent(in) :: len_r ! receive length + logical, intent(in) :: phi_r(len_r) ! receive buffer + integer, intent(in) :: dest ! destination processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) + Unused(len_s) + Unused(phi_s) + Unused(len_r) + Unused(phi_r) + Unused(dest) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Real_Arrays.f90 b/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Real_Arrays.f90 index 6e6a71251..2905c88dc 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Real_Arrays.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Sendrecv_Real_Arrays.f90 @@ -6,12 +6,19 @@ subroutine Sendrecv_Real_Arrays(Comm, len_s, phi_s, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - real :: phi_s(len_s) ! send buffer - integer :: len_r ! receive length - real :: phi_r(len_r) ! receive buffer - integer :: dest ! destination processor + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: len_s ! send length + real, intent(in) :: phi_s(len_s) ! send buffer + integer, intent(in) :: len_r ! receive length + real, intent(in) :: phi_r(len_r) ! receive buffer + integer, intent(in) :: dest ! destination processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) + Unused(len_s) + Unused(phi_s) + Unused(len_r) + Unused(phi_r) + Unused(dest) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Start.f90 b/Sources/Shared/Comm_Mod/Sequential/Start_Parallel.f90 similarity index 76% rename from Sources/Shared/Comm_Mod/Sequential/Start.f90 rename to Sources/Shared/Comm_Mod/Sequential/Start_Parallel.f90 index 447436bb4..03c65e1fa 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Start.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Start_Parallel.f90 @@ -1,16 +1,18 @@ !==============================================================================! - subroutine Comm_Mod_Start + subroutine Start_Parallel(Global) !------------------------------------------------------------------------------! ! Initializes sequential execution. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Comm_Type) :: Global !-----------------------------------[Locals]-----------------------------------! integer :: n integer, allocatable :: seeds(:) !==============================================================================! - this_proc = 0 - n_proc = 0 + Global % this_processor = 0 + Global % n_processors = 0 call random_seed(size = n) allocate(seeds(n)); seeds(:) = 12321 diff --git a/Sources/Shared/Comm_Mod/Sequential/Wait.f90 b/Sources/Shared/Comm_Mod/Sequential/Wait.f90 index ac1d51fa0..9107d6127 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Wait.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Wait.f90 @@ -1,9 +1,13 @@ !==============================================================================! - subroutine Comm_Mod_Wait + subroutine Wait(Global) !------------------------------------------------------------------------------! ! Dummy function for sequential runs. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Comm_Type) :: Global +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Global) !==============================================================================! end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Int.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Int.f90 index 301f2ee72..406f98483 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Int.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Int.f90 @@ -5,10 +5,12 @@ subroutine Write_Int(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - integer :: num ! number to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + integer, intent(in) :: num ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! write(fh) num diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Int_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Int_Array.f90 index 83350fb0f..97f2eb514 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Int_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Int_Array.f90 @@ -5,12 +5,14 @@ subroutine Write_Int_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - integer, dimension(:) :: arr ! array to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + integer, dimension(:), intent(in) :: arr ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Log.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Log.f90 index 92df05fb2..c8b3a98ae 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Log.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Log.f90 @@ -5,10 +5,12 @@ subroutine Write_Log(Comm, fh, var, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - logical :: var ! variable to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + logical, intent(in) :: var ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! write(fh) var diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Log_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Log_Array.f90 index 665a5b991..6a5b062f5 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Log_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Log_Array.f90 @@ -5,12 +5,14 @@ subroutine Write_Log_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - logical, dimension(:) :: arr ! array to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + logical, dimension(:), intent(in) :: arr ! variable to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Real.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Real.f90 index 4410768b4..f32bb4530 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Real.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Real.f90 @@ -5,10 +5,12 @@ subroutine Write_Real(Comm, fh, num, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - real :: num ! number to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + real, intent(in) :: num ! number to write out + integer(DP), intent(inout) :: disp ! displacement in bytes +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! write(fh) num diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Real_Array.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Real_Array.f90 index d2f376bf6..0a44e2699 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Real_Array.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Real_Array.f90 @@ -5,12 +5,14 @@ subroutine Write_Real_Array(Comm, fh, arr, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - real, dimension(:) :: arr ! array to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + real, dimension(:), intent(in) :: arr ! array to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: length +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! ! Get array's length diff --git a/Sources/Shared/Comm_Mod/Sequential/Write_Text.f90 b/Sources/Shared/Comm_Mod/Sequential/Write_Text.f90 index ce3896c63..bca2cba6d 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Write_Text.f90 +++ b/Sources/Shared/Comm_Mod/Sequential/Write_Text.f90 @@ -5,12 +5,14 @@ subroutine Write_Text(Comm, fh, text_out, disp) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: fh ! file handle - character :: text_out*(*) ! text to write out - integer(DP) :: disp ! displacement in bytes + class(Comm_Type), intent(in) :: Comm + integer, intent(in) :: fh ! file handle + character, intent(in) :: text_out*(*) ! text to write out + integer(DP), intent(inout) :: disp ! displacement in bytes !-----------------------------------[Locals]-----------------------------------! integer :: leng +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Comm) !==============================================================================! leng = len(text_out) diff --git a/Sources/Shared/Comm_Mod/Shared/First_Proc.f90 b/Sources/Shared/Comm_Mod/Shared/First_Proc.f90 new file mode 100644 index 000000000..ab15a5b6d --- /dev/null +++ b/Sources/Shared/Comm_Mod/Shared/First_Proc.f90 @@ -0,0 +1,9 @@ +!==============================================================================! + pure logical function First_Proc() +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + First_Proc = Global % this_processor < 2 + + end function diff --git a/Sources/Shared/Comm_Mod/Shared/N_Procs.f90 b/Sources/Shared/Comm_Mod/Shared/N_Procs.f90 new file mode 100644 index 000000000..dcba61449 --- /dev/null +++ b/Sources/Shared/Comm_Mod/Shared/N_Procs.f90 @@ -0,0 +1,9 @@ +!==============================================================================! + pure integer function N_Procs() +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + N_Procs = Global % n_processors + + end function diff --git a/Sources/Shared/Comm_Mod/Shared/Parallel_Run.f90 b/Sources/Shared/Comm_Mod/Shared/Parallel_Run.f90 new file mode 100644 index 000000000..7e1475be2 --- /dev/null +++ b/Sources/Shared/Comm_Mod/Shared/Parallel_Run.f90 @@ -0,0 +1,9 @@ +!==============================================================================! + pure logical function Parallel_Run() +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + Parallel_Run = Global % n_processors > 2 + + end function diff --git a/Sources/Shared/Comm_Mod/Shared/Sequential_Run.f90 b/Sources/Shared/Comm_Mod/Shared/Sequential_Run.f90 new file mode 100644 index 000000000..ad507371e --- /dev/null +++ b/Sources/Shared/Comm_Mod/Shared/Sequential_Run.f90 @@ -0,0 +1,9 @@ +!==============================================================================! + pure logical function Sequential_Run() +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + Sequential_Run = Global % n_processors < 2 + + end function diff --git a/Sources/Shared/Comm_Mod/Shared/This_Proc.f90 b/Sources/Shared/Comm_Mod/Shared/This_Proc.f90 new file mode 100644 index 000000000..0a5fcac3f --- /dev/null +++ b/Sources/Shared/Comm_Mod/Shared/This_Proc.f90 @@ -0,0 +1,9 @@ +!==============================================================================! + pure integer function This_Proc() +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + This_Proc = Global % this_processor + + end function diff --git a/Sources/Shared/Const_Mod.f90 b/Sources/Shared/Const_Mod.f90 index 704917676..8c626ea86 100644 --- a/Sources/Shared/Const_Mod.f90 +++ b/Sources/Shared/Const_Mod.f90 @@ -2,10 +2,24 @@ module Const_Mod !------------------------------------------------------------------------------! ! Constants definitions for all other modules. ! +! ! +! Program name (T_FLOWS_PROGRAM) is passed from makefile of each program ! !------------------------------------------------------------------------------! implicit none !==============================================================================! +# if T_FLOWS_PROGRAM == 1 + character(8), parameter :: PROGRAM_NAME = "Generate" +# elif T_FLOWS_PROGRAM == 2 + character(6), parameter :: PROGRAM_NAME = "Divide" +# elif T_FLOWS_PROGRAM == 3 + character(7), parameter :: PROGRAM_NAME = "Convert" +# elif T_FLOWS_PROGRAM == 4 + character(7), parameter :: PROGRAM_NAME = "Process" +# else + character(9), parameter :: PROGRAM_NAME = "Undefined" +# endif + ! Standard string length integer, parameter :: VL = 4 ! variable name length integer, parameter :: SL = 80 ! standard string length @@ -30,6 +44,12 @@ module Const_Mod integer, parameter :: LP = IP ! logical precision integer, parameter :: RP = sizeof(1.0) ! real number precision + ! Version of the .cfn and .dim files + ! (This number was set in April of 2023) + integer, parameter :: VERSION_CFN = 202304 + integer, parameter :: VERSION_DIM = 202304 + integer, parameter :: VERSION_BACKUP = 202304 + !----------------------------------------! ! A few handy mathematical constants ! !----------------------------------------! @@ -54,7 +74,10 @@ module Const_Mod real, parameter :: HUGE = PETA real, parameter :: TINY = FEMTO - integer, parameter :: HUGE_INT = 2147483647 + integer, parameter :: HUGE_INT = 1073741824 ! this is 2 ** 30 + + ! Euler's prime number (also the largest integer in 32 bit precision) + integer, parameter :: EULER = 2147483647 ! 2 ** 31 - 1 ! Archimedes’ constant real, parameter :: PI = 3.14159265359 diff --git a/Sources/Shared/Control_Mod.f90 b/Sources/Shared/Control_Mod.f90 index 522ab17e6..bd721f042 100644 --- a/Sources/Shared/Control_Mod.f90 +++ b/Sources/Shared/Control_Mod.f90 @@ -1,3 +1,6 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module Control_Mod !----------------------------------[Modules]-----------------------------------! @@ -7,14 +10,186 @@ module Control_Mod implicit none !==============================================================================! - ! Control file unit - integer, private :: control_file_unit ! current control file unit - integer, private :: root_control_file_unit ! root control file unit - integer, private :: dom_control_file_unit(MD) ! domain control file units + !------------------! + ! Control type ! + !------------------! + type Control_Type + + ! Control file unit + integer, private :: file_unit ! current control file unit + integer, private :: root_file_unit ! root control file unit + integer, private :: dom_file_unit(MD) ! domain control file units + + contains + + ! Basic functionality (manouvering through control file) + procedure :: Open_Domain_File + procedure :: Open_Root_File + procedure :: Position_At_One_Key + procedure :: Position_At_Two_Keys + procedure :: Position_At_Three_Keys + procedure :: Read_Char_Item + procedure :: Read_Char_Item_On + procedure :: Read_Strings_On + procedure :: Read_Int_Item + procedure :: Read_Int_Item_On + procedure :: Read_Real_Item + procedure :: Read_Real_Item_On + procedure :: Read_Real_Vector + procedure :: Read_Real_Vector_On + procedure :: Switch_To_Domain + procedure :: Switch_To_Root + + ! Input/output + procedure :: Read_Problem_Name + procedure :: Load_Backup_Name + procedure :: Save_Backup_Name + procedure :: Save_Initial_Condition + procedure :: Save_Results_At_Boundaries + procedure :: Save_Results_Units + procedure :: Wall_Time_Max_Hours + procedure :: Backup_Save_Interval + procedure :: Results_Save_Interval + procedure :: Swarm_Save_Interval + procedure :: Profiler_Info + + ! Unclassified as of yet + procedure :: Linear_Solvers + procedure :: Max_Threads + + ! Native solvers + procedure :: Max_Iterations_For_Energy_Solver + procedure :: Max_Iterations_For_Momentum_Solver + procedure :: Max_Iterations_For_Potential_Solver + procedure :: Max_Iterations_For_Pressure_Solver + procedure :: Max_Iterations_For_Scalars_Solver + procedure :: Max_Iterations_For_Turbulence_Solver + procedure :: Max_Iterations_For_Vof_Solver + procedure :: Max_Iterations_For_Wall_Distance_Solver + procedure :: Preconditioner_For_System_Matrix + procedure :: Solver_For_Energy + procedure :: Solver_For_Momentum + procedure :: Solver_For_Potential + procedure :: Solver_For_Pressure + procedure :: Solver_For_Scalars + procedure :: Solver_For_Turbulence + procedure :: Solver_For_Vof + procedure :: Solver_For_Wall_Distance + procedure :: Normalization_For_Momentum_Solver + procedure :: Normalization_For_Pressure_Solver + procedure :: Normalization_For_Energy_Solver + procedure :: Normalization_For_Scalars_Solver + procedure :: Normalization_For_Turbulence_Solver + procedure :: Tolerance_For_Momentum_Solver + procedure :: Tolerance_For_Potential_Solver + procedure :: Tolerance_For_Pressure_Solver + procedure :: Tolerance_For_Energy_Solver + procedure :: Tolerance_For_Scalars_Solver + procedure :: Tolerance_For_Turbulence_Solver + procedure :: Tolerance_For_Vof_Solver + procedure :: Tolerance_For_Wall_Distance_Solver + + ! Numerics + procedure :: Time_Step + procedure :: Number_Of_Time_Steps + procedure :: Advection_Scheme_For_Energy + procedure :: Advection_Scheme_For_Momentum + procedure :: Advection_Scheme_For_Scalars + procedure :: Advection_Scheme_For_Turbulence + procedure :: Advection_Scheme_For_Vof + procedure :: Blending_Coefficient_For_Energy + procedure :: Blending_Coefficient_For_Momentum + procedure :: Blending_Coefficient_For_Scalars + procedure :: Blending_Coefficient_For_Turbulence + procedure :: Blending_Coefficient_For_Vof + procedure :: Choi_Correction + procedure :: Gradient_Method_For_Energy + procedure :: Gradient_Method_For_Momentum + procedure :: Gradient_Method_For_Pressure + procedure :: Gradient_Method_For_Scalars + procedure :: Gradient_Method_For_Turbulence + procedure :: Gradient_Method_For_Vof + procedure :: Gradient_Method_For_Wall_Distance + procedure :: Gu_Correction + procedure :: Max_Gauss_Gradients_Iterations + procedure :: Max_Least_Squares_Gradients_Iterations + procedure :: Max_Simple_Iterations + procedure :: Min_Simple_Iterations + procedure :: Number_Of_Piso_Corrections + procedure :: Pressure_Momentum_Coupling + procedure :: Report_Volume_Balance + procedure :: Simple_Underrelaxation_For_Momentum + procedure :: Simple_Underrelaxation_For_Pressure + procedure :: Simple_Underrelaxation_For_Energy + procedure :: Simple_Underrelaxation_For_Scalars + procedure :: Simple_Underrelaxation_For_Turbulence + procedure :: Simple_Underrelaxation_For_Vof + procedure :: Time_Integration_Scheme + procedure :: Tolerance_For_Gauss_Gradients + procedure :: Tolerance_For_Simple_Algorithm + procedure :: Max_Correction_Cycles_Beta_Vof + procedure :: Max_Smoothing_Cycles_Curvature_Vof + procedure :: Max_Smoothing_Cycles_Normal_Vof + procedure :: Max_Courant_Vof + procedure :: Max_Substep_Cycles_Vof + procedure :: Skewness_Correction_Vof - ! Number of presumably misstyped keywords followed by their list - integer, private :: n_similar = 0 - character(SL), private :: similar(128) + ! Physics + procedure :: Number_Of_Domains + procedure :: Dynamic_Viscosity + procedure :: Heat_Capacity + procedure :: Latent_Heat + procedure :: Mass_Density + procedure :: Thermal_Conductivity + procedure :: Scalars_Diffusivity + procedure :: Interface_Tracking + procedure :: Particle_Tracking + procedure :: Mass_Transfer + procedure :: Heat_Transfer + procedure :: Buoyancy + procedure :: Reference_Temperature + procedure :: Saturation_Temperature + procedure :: Volume_Expansion_Coefficient + procedure :: Hybrid_Les_Rans_Switch + procedure :: Roughness_Coefficient + procedure :: Rough_Walls + procedure :: Smagorinsky_Constant + procedure :: Turbulence_Model + procedure :: Turbulence_Model_Variant + procedure :: Turbulent_Prandtl_Number + procedure :: Turbulent_Schmidt_Number + procedure :: Turbulent_Heat_Flux_Model + procedure :: Turbulent_Scalar_Flux_Model + procedure :: Angular_Velocity_Vector + procedure :: Gravitational_Vector + procedure :: Mass_Flow_Rates + procedure :: Pressure_Drops + procedure :: Point_For_Monitoring_Planes + procedure :: Potential_Initialization + procedure :: Max_Particles + procedure :: Number_Of_Phases + procedure :: Number_Of_Swarm_Sub_Steps + procedure :: Swarm_Coefficient_Of_Restitution + procedure :: Swarm_Density + procedure :: Swarm_Diameter + procedure :: Swarm_Subgrid_Scale_Model + procedure :: Phase_Capacities + procedure :: Phase_Conductivities + procedure :: Phase_Densities + procedure :: Phase_Viscosities + procedure :: Reference_Density + procedure :: Surface_Tension + procedure :: Track_Front + procedure :: Track_Surface + procedure :: Number_Of_Scalars + procedure :: Starting_Time_Step_For_Turb_Statistics + procedure :: Starting_Time_Step_For_Swarm_Computation + procedure :: Starting_Time_Step_For_Swarm_Statistics + procedure :: Extrapolate_Temperature_Exp + + end type + + type(Control_Type) :: Control contains @@ -34,9 +209,8 @@ module Control_Mod # include "Control_Mod/Basic_Functions/Read_Int_Item_On.f90" # include "Control_Mod/Basic_Functions/Read_Real_Item.f90" # include "Control_Mod/Basic_Functions/Read_Real_Item_On.f90" -# include "Control_Mod/Basic_Functions/Read_Real_Array.f90" -# include "Control_Mod/Basic_Functions/Read_Real_Array_On.f90" -# include "Control_Mod/Basic_Functions/Similar_Warning.f90" +# include "Control_Mod/Basic_Functions/Read_Real_Vector.f90" +# include "Control_Mod/Basic_Functions/Read_Real_Vector_On.f90" # include "Control_Mod/Basic_Functions/Switch_To_Domain.f90" # include "Control_Mod/Basic_Functions/Switch_To_Root.f90" @@ -50,8 +224,7 @@ module Control_Mod # include "Control_Mod/Input_Output/Save_Backup_Name.f90" # include "Control_Mod/Input_Output/Save_Initial_Condition.f90" # include "Control_Mod/Input_Output/Save_Results_At_Boundaries.f90" -# include "Control_Mod/Input_Output/Load_Initial_Solution_Name.f90" -# include "Control_Mod/Input_Output/Save_Initial_Solution_Name.f90" +# include 'Control_Mod/Input_Output/Save_Results_Units.f90' # include "Control_Mod/Input_Output/Wall_Time_Max_Hours.f90" ! Save @@ -59,12 +232,21 @@ module Control_Mod # include "Control_Mod/Input_Output/Results_Save_Interval.f90" # include "Control_Mod/Input_Output/Swarm_Save_Interval.f90" + ! Profiler +# include "Control_Mod/Input_Output/Profiler_Info.f90" + !--------------------! ! Linear solvers ! (native (from T-Flows) or PETSc) !--------------------! # include "Control_Mod/Linear_Solvers.f90" + !-------------! + ! Threads ! + !-------------! + +# include "Control_Mod/Max_Threads.f90" + !--------------------! ! Native solvers ! !--------------------! @@ -73,7 +255,7 @@ module Control_Mod # include "Control_Mod/Native/Max_Iterations_For_Energy_Solver.f90" # include "Control_Mod/Native/Max_Iterations_For_Momentum_Solver.f90" # include "Control_Mod/Native/Max_Iterations_For_Potential_Solver.f90" -# include "Control_Mod/Native/Max_Iterations_For_Presssure_Solver.f90" +# include "Control_Mod/Native/Max_Iterations_For_Pressure_Solver.f90" # include "Control_Mod/Native/Max_Iterations_For_Scalars_Solver.f90" # include "Control_Mod/Native/Max_Iterations_For_Turbulence_Solver.f90" # include "Control_Mod/Native/Max_Iterations_For_Vof_Solver.f90" diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Open_Domain_File.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Open_Domain_File.f90 index bbf733e07..9523cee5c 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Open_Domain_File.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Open_Domain_File.f90 @@ -1,14 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Open_Domain_File(dom, file_name) + subroutine Open_Domain_File(Control, dom, file_name) !------------------------------------------------------------------------------! ! Opens control file for a domain. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: dom - character(len=*) :: file_name + class(Control_Type) :: Control + integer, intent(in) :: dom + character(len=*), intent(in) :: file_name !==============================================================================! - call File % Open_For_Reading_Ascii(file_name, dom_control_file_unit(dom)) + call File % Open_For_Reading_Ascii(file_name, & + Control % dom_file_unit(dom), & + processor = This_Proc()) end subroutine diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Open_Root_File.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Open_Root_File.f90 index 743acdbeb..afb94e409 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Open_Root_File.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Open_Root_File.f90 @@ -1,23 +1,21 @@ !==============================================================================! - subroutine Control_Mod_Open_Root_File(file_name) + subroutine Open_Root_File(Control, file_name) !------------------------------------------------------------------------------! ! It rarely gets simpler than this - just opens a file for reading. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: file_name + class(Control_Type) :: Control + character(len=*) :: file_name !==============================================================================! - ! Unused - ! control_file_name = file_name - - call File % Open_For_Reading_Ascii(file_name, root_control_file_unit) + call File % Open_For_Reading_Ascii(file_name, Control % root_file_unit, & + processor=This_Proc()) ! Make root default to begin with - control_file_unit = root_control_file_unit + Control % file_unit = Control % root_file_unit ! Set default values for domain 1 - ! dom_control_file_name(1) = control_file_name - dom_control_file_unit(1) = root_control_file_unit + Control % dom_file_unit(1) = Control % root_file_unit end subroutine diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Position_At_One_Key.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Position_At_One_Key.f90 index bc465d80f..da1bbc8e7 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Position_At_One_Key.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Position_At_One_Key.f90 @@ -1,37 +1,33 @@ !==============================================================================! - subroutine Control_Mod_Position_At_One_Key(keyword, found, verbose) + subroutine Position_At_One_Key(Control, keyword, found, verbose) !------------------------------------------------------------------------------! ! Position yourself within the file at the line specified with one key. ! ! It is intended to be used to find the initial condition specifications. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - logical :: found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + logical, intent(out) :: found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) !-----------------------------------------------------! ! Browse through command file to find one keyword ! !-----------------------------------------------------! found = .false. do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then found = .true. return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning(trim(keyword), & - trim(Line % tokens(1))) end if end do @@ -41,7 +37,7 @@ subroutine Control_Mod_Position_At_One_Key(keyword, found, verbose) !--------------------------------------------! 1 if(.not. found) then if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(3a)', ' # WARING! Could not find the line with keyword: ', & keyword, '!' end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Three_Keys.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Three_Keys.f90 index d2522c6bb..76e3aed23 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Three_Keys.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Three_Keys.f90 @@ -1,8 +1,9 @@ !==============================================================================! - subroutine Control_Mod_Position_At_Three_Keys(keyword_1, & - keyword_2, & - keyword_3, & - found, verbose) + subroutine Position_At_Three_Keys(Control, & + keyword_1, & + keyword_2, & + keyword_3, & + found, verbose) !------------------------------------------------------------------------------! ! Position yourself within the file at the line specified with three keys. ! ! It is intended to be used to find the interface condition specifications. ! @@ -11,23 +12,24 @@ subroutine Control_Mod_Position_At_Three_Keys(keyword_1, & !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword_1 - character(len=*) :: keyword_2 - character(len=*) :: keyword_3 - logical :: found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword_1 + character(len=*), intent(in) :: keyword_2 + character(len=*), intent(in) :: keyword_3 + logical, intent(out) :: found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) !------------------------------------------------------------------! ! Browse through command file to find two keywords in one file ! !------------------------------------------------------------------! found = .false. do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! First keyword is "INTERFACE_CONDITION", ... @@ -37,8 +39,8 @@ subroutine Control_Mod_Position_At_Three_Keys(keyword_1, & Line % tokens(3) .eq. trim(keyword_3)) then found = .true. return - end if + end do !--------------------------------------------! @@ -46,9 +48,9 @@ subroutine Control_Mod_Position_At_Three_Keys(keyword_1, & !--------------------------------------------! 1 if(.not. found) then if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(5a)', ' # NOTE! Could not find the line with keywords: ', & - keyword_1, ', ', trim(keyword_2), ', ', trim(keyword_3), '!' + keyword_1, ', ', trim(keyword_2), ', ', trim(keyword_3), '!' end if end if end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Two_Keys.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Two_Keys.f90 index e3dde57a8..db63aba08 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Two_Keys.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Position_At_Two_Keys.f90 @@ -1,28 +1,31 @@ !==============================================================================! - subroutine Control_Mod_Position_At_Two_Keys(keyword_1, keyword_2, & - found, verbose) + subroutine Position_At_Two_Keys(Control, & + keyword_1, & + keyword_2, & + found, verbose) !------------------------------------------------------------------------------! ! Position yourself within the file at the line specified with two keys. ! ! It is intended to be used to find the boundary condition specifications. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword_1 - character(len=*) :: keyword_2 - logical :: found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword_1 + character(len=*), intent(in) :: keyword_2 + logical, intent(out) :: found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) !------------------------------------------------------------------! ! Browse through command file to find two keywords in one file ! !------------------------------------------------------------------! found = .false. do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 call String % To_Upper_Case(Line % tokens(2)) @@ -33,15 +36,8 @@ subroutine Control_Mod_Position_At_Two_Keys(keyword_1, keyword_2, & Line % tokens(2) .eq. trim(keyword_2)) then found = .true. return - - ! Keywords not found, try to see if there is similar, maybe there was a typo - else - call Control_Mod_Similar_Warning(trim(keyword_1), & - trim(Line % tokens(1))) - call Control_Mod_Similar_Warning(trim(keyword_2), & - trim(Line % tokens(2)), & - key_type='boundary condition') end if + end do !--------------------------------------------! @@ -49,7 +45,7 @@ subroutine Control_Mod_Position_At_Two_Keys(keyword_1, keyword_2, & !--------------------------------------------! 1 if(.not. found) then if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(5a)', ' # NOTE! Could not find the line with keywords: ', & keyword_1, ', ', trim(keyword_2), '!' end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item.f90 index 24b80e5cc..dc99ca23a 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Char_Item(keyword, def, val, verbose) + subroutine Read_Char_Item(Control, keyword, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read integer value (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,15 +7,16 @@ subroutine Control_Mod_Read_Char_Item(keyword, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - character(len=*), intent(in) :: def ! default value - character(SL), intent(out) :: val ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + character(len=*), intent(in) :: def ! default value + character(SL), intent(out) :: val ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) ! Set default value val = def @@ -24,17 +25,13 @@ subroutine Control_Mod_Read_Char_Item(keyword, def, val, verbose) ! Browse through command file to see if user specificed it ! !--------------------------------------------------------------! do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then read(Line % tokens(2), *) val return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if end do @@ -43,7 +40,7 @@ subroutine Control_Mod_Read_Char_Item(keyword, def, val, verbose) ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(4a)', ' # NOTE! Could not find the keyword: ', & trim(keyword), '. Using the default: ', trim(def) end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item_On.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item_On.f90 index 2fc713d90..f4ebc89b4 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item_On.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Char_Item_On.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Char_Item_On(keyword, def, val, verbose) + subroutine Read_Char_Item_On(Control, keyword, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read strings values (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,10 +7,11 @@ subroutine Control_Mod_Read_Char_Item_On(keyword, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - character(len=*), intent(in) :: def ! default value - character(SL), intent(out) :: val ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + character(len=*), intent(in) :: def ! default value + character(SL), intent(out) :: val ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! @@ -21,24 +22,20 @@ subroutine Control_Mod_Read_Char_Item_On(keyword, def, val, verbose) !---------------------------------------------------------! ! Read one line from command file to find the keyword ! !---------------------------------------------------------! - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then read(Line % tokens(2), *) val return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if !--------------------------------------------! ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(4a)', ' # NOTE! Could not find the keyword: ', & trim(keyword), '. Using the default: ', trim(def) end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item.f90 index 09051c173..49463c1dd 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Int_Item(keyword, def, val, verbose) + subroutine Read_Int_Item(Control, keyword, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read integer value (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,15 +7,16 @@ subroutine Control_Mod_Read_Int_Item(keyword, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - integer, intent(in) :: def ! default value - integer, intent(out) :: val ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + integer, intent(in) :: def ! default value + integer, intent(out) :: val ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) ! Set default value val = def @@ -24,25 +25,22 @@ subroutine Control_Mod_Read_Int_Item(keyword, def, val, verbose) ! Browse through command file to find the keyword ! !-----------------------------------------------------! do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then read(Line % tokens(2), *) val return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if + end do !--------------------------------------------! ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then if(def .eq. HUGE_INT) then print '(3a,i9)', ' # NOTE! Could not find the keyword: ', & trim(keyword), '. Using the default HUGE_INT value' diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item_On.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item_On.f90 index be64e210c..fba6f9b6b 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item_On.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Int_Item_On.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Int_Item_On(keyword, def, val, verbose) + subroutine Read_Int_Item_On(Control, keyword, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read integer value (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,10 +7,11 @@ subroutine Control_Mod_Read_Int_Item_On(keyword, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - integer, intent(in) :: def ! default value - integer, intent(out) :: val ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + integer, intent(in) :: def ! default value + integer, intent(out) :: val ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! @@ -21,24 +22,20 @@ subroutine Control_Mod_Read_Int_Item_On(keyword, def, val, verbose) !-----------------------------------------------------! ! Browse through command file to find the keyword ! !-----------------------------------------------------! - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then read(Line % tokens(2), *) val return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if !--------------------------------------------! ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then if(def .eq. HUGE_INT) then print '(3a,i9)', ' # NOTE! Could not find the keyword: ', & trim(keyword), '. Using the default HUGE_INT value' diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item.f90 index 02cba9a4f..e447f47d1 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Real_Item(keyword, def, val, verbose) + subroutine Read_Real_Item(Control, keyword, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read integer value (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,15 +7,16 @@ subroutine Control_Mod_Read_Real_Item(keyword, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - real, intent(in) :: def ! default value - real, intent(out) :: val ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + real, intent(in) :: def ! default value + real, intent(out) :: val ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) ! Set default value val = def @@ -24,17 +25,13 @@ subroutine Control_Mod_Read_Real_Item(keyword, def, val, verbose) ! Browse through command file to find the keyword ! !-----------------------------------------------------! do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then read(Line % tokens(2), *) val return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if end do @@ -42,9 +39,9 @@ subroutine Control_Mod_Read_Real_Item(keyword, def, val, verbose) ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then - print '(3a,1pe9.3)', ' # NOTE! Could not find the keyword: ', & - trim(keyword), '. Using the default: ', def + if(verbose .and. First_Proc()) then + print '(3a,1pe10.3)', ' # NOTE! Could not find the keyword: ', & + trim(keyword), '. Using the default: ', def end if end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item_On.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item_On.f90 index e129d92ce..0f1b9d63f 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item_On.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Item_On.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Real_Item_On(keyword, def, val, verbose) + subroutine Read_Real_Item_On(Control, keyword, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read real values (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,10 +7,11 @@ subroutine Control_Mod_Read_Real_Item_On(keyword, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - real, intent(in) :: def ! default value - real, intent(out) :: val ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + real, intent(in) :: def ! default value + real, intent(out) :: val ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end !==============================================================================! @@ -21,26 +22,22 @@ subroutine Control_Mod_Read_Real_Item_On(keyword, def, val, verbose) !-----------------------------------------------------! ! Browse through command file to find the keyword ! !-----------------------------------------------------! - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword if(Line % tokens(1) .eq. trim(keyword)) then read(Line % tokens(2), *) val return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if !--------------------------------------------! ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then - print '(3a,1pe9.3)', ' # NOTE! Could not find the keyword: ', & - trim(keyword), '. Using the default: ', def + if(verbose .and. First_Proc()) then + print '(3a,1pe10.3)', ' # NOTE! Could not find the keyword: ', & + trim(keyword), '. Using the default: ', def end if end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Array.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Vector.f90 similarity index 65% rename from Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Array.f90 rename to Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Vector.f90 index f5c56b99a..6a434b5ab 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Array.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Vector.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Real_Array(keyword, n, def, val, verbose) + subroutine Read_Real_Vector(Control, keyword, n, def, val, verbose) !------------------------------------------------------------------------------! ! Working horse function to read integer value (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,17 +7,18 @@ subroutine Control_Mod_Read_Real_Array(keyword, n, def, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - integer :: n ! size of array (typically small) - real :: def(n) ! default value - real :: val(n) ! spefified value, if found - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + integer, intent(in) :: n ! size of array (typically small) + real, intent(in) :: def(n) ! default value + real, intent(out) :: val(n) ! spefified value, if found + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! logical :: reached_end integer :: i !==============================================================================! - rewind(control_file_unit) + rewind(Control % file_unit) ! Set default values val = def @@ -26,7 +27,7 @@ subroutine Control_Mod_Read_Real_Array(keyword, n, def, val, verbose) ! Browse through command file to find the keyword ! !-----------------------------------------------------! do - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword @@ -35,10 +36,6 @@ subroutine Control_Mod_Read_Real_Array(keyword, n, def, val, verbose) read(Line % tokens(i+1), *) val(i) end do return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if end do @@ -47,9 +44,9 @@ subroutine Control_Mod_Read_Real_Array(keyword, n, def, val, verbose) ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then - print '(3a,1pe9.3)', ' # NOTE! Could not find the keyword: ', & - trim(keyword), '. Using the default: ', def(1) + if(verbose .and. First_Proc()) then + print '(3a,1pe10.3)', ' # NOTE! Could not find the keyword: ', & + trim(keyword), '. Using the default: ', def(1) end if end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Array_On.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Vector_On.f90 similarity index 75% rename from Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Array_On.f90 rename to Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Vector_On.f90 index 8ae83da99..c052c2df4 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Array_On.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Real_Vector_On.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Read_Real_Array_On(keyword, values, n, verbose) + subroutine Read_Real_Vector_On(Control, keyword, values, n, verbose) !------------------------------------------------------------------------------! ! Working horse function to read integer value (argument "val") behind a ! ! keyword (argument "keyword") in control file. If not found, a default ! @@ -7,10 +7,11 @@ subroutine Control_Mod_Read_Real_Array_On(keyword, values, n, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - real :: values(128) ! spefified value, if found - integer :: n ! number of items - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + real, intent(out) :: values(128) ! spefified value, if found + integer, intent(out) :: n ! number of items + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! integer :: i logical :: reached_end @@ -22,7 +23,7 @@ subroutine Control_Mod_Read_Real_Array_On(keyword, values, n, verbose) !---------------------------------------------------------! ! Read one line from command file to find the keyword ! !---------------------------------------------------------! - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword @@ -34,16 +35,13 @@ subroutine Control_Mod_Read_Real_Array_On(keyword, values, n, verbose) n = Line % n_tokens - 1 return - ! Keyword not found, try to see if there is similar, maybe it was a typo - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) end if !--------------------------------------------! ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(2a)', ' # NOTE! Could not find the keyword: ', & trim(keyword) end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Read_Strings_On.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Read_Strings_On.f90 index 6c913c343..7e82a5b66 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Read_Strings_On.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Read_Strings_On.f90 @@ -1,14 +1,15 @@ !==============================================================================! - subroutine Control_Mod_Read_Strings_On(keyword, values, n, verbose) + subroutine Read_Strings_On(Control, keyword, values, n, verbose) !------------------------------------------------------------------------------! ! Used to read variable names in bnd. and initial condition specificaton ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(len=*) :: keyword - character(SL) :: values(MSI) ! spefified value, if found - integer :: n ! number of items - logical, optional :: verbose + class(Control_Type) :: Control + character(len=*), intent(in) :: keyword + character(SL), intent(out) :: values(MSI) ! spefified value, if found + integer, intent(out) :: n ! number of items + logical, optional, intent(in) :: verbose !-----------------------------------[Locals]-----------------------------------! integer :: i logical :: reached_end @@ -20,7 +21,7 @@ subroutine Control_Mod_Read_Strings_On(keyword, values, n, verbose) !---------------------------------------------------------! ! Read one line from command file to find the keyword ! !---------------------------------------------------------! - call File % Read_Line(control_file_unit, reached_end) + call File % Read_Line(Control % file_unit, reached_end) if(reached_end) goto 1 ! Found the correct keyword @@ -30,19 +31,14 @@ subroutine Control_Mod_Read_Strings_On(keyword, values, n, verbose) read(Line % tokens(i), *) values(i-1) end do n = Line % n_tokens - 1 - return - - ! Keyword not found, try to see if there is similar, maybe it was a typo - ! (Tokens 2 and on hold variable names, they are too short to be checked) - else - call Control_Mod_Similar_Warning( keyword, trim(Line % tokens(1)) ) + return end if !--------------------------------------------! ! Keyword was not found; issue a warning ! !--------------------------------------------! 1 if(present(verbose)) then - if(verbose .and. this_proc < 2) then + if(verbose .and. First_Proc()) then print '(a,a,a)', ' # NOTE! Could not find the keyword: ', keyword, '.' end if end if diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Similar_Warning.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Similar_Warning.f90 index cb771e908..e77d5f068 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Similar_Warning.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Similar_Warning.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Similar_Warning(keyword, item, verbose, key_type) + subroutine Control_Mod_Similar_Warning(keyword, item, key_type) !------------------------------------------------------------------------------! ! Checks if item in the argument list is similar to a keyword. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(len=*) :: keyword character(len=*) :: item - logical, optional :: verbose character(len=*), optional :: key_type !-----------------------------------[Locals]-----------------------------------! integer :: n @@ -37,7 +37,7 @@ subroutine Control_Mod_Similar_Warning(keyword, item, verbose, key_type) if( Math % Approx_String(keyword, item, 1) ) then ! Print a warning message - if(this_proc < 2) then + if(First_Proc()) then print *, '#============================================='// & '=============================================' if(.not. present(key_type)) then diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Domain.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Domain.f90 index e1d54b86d..ceb783433 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Domain.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Domain.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Switch_To_Domain(dom) + subroutine Switch_To_Domain(Control, dom) !------------------------------------------------------------------------------! ! Switch the control file to the specified domain. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: dom + class(Control_Type) :: Control + integer, intent(in) :: dom !==============================================================================! - control_file_unit = dom_control_file_unit(dom) + Control % file_unit = Control % dom_file_unit(dom) end subroutine diff --git a/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Root.f90 b/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Root.f90 index 280a42644..b14c83d94 100644 --- a/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Root.f90 +++ b/Sources/Shared/Control_Mod/Basic_Functions/Switch_To_Root.f90 @@ -1,11 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Switch_To_Root() + subroutine Switch_To_Root(Control) !------------------------------------------------------------------------------! ! Switch the control file to root. ! !------------------------------------------------------------------------------! implicit none +!---------------------------------[Arguments]----------------------------------! + class(Control_Type), intent(inout) :: Control !==============================================================================! - control_file_unit = root_control_file_unit + Control % file_unit = Control % root_file_unit end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Backup_Save_Interval.f90 b/Sources/Shared/Control_Mod/Input_Output/Backup_Save_Interval.f90 index 79e9f59f6..4e66dec4e 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Backup_Save_Interval.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Backup_Save_Interval.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Backup_Save_Interval(val, verbose) + subroutine Backup_Save_Interval(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: val - logical, optional :: verbose + class(Control_Type) :: Control + integer :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('BACKUP_SAVE_INTERVAL', 120, & - val, verbose) + call Control % Read_Int_Item('BACKUP_SAVE_INTERVAL', 120, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Load_Backup_Name.f90 b/Sources/Shared/Control_Mod/Input_Output/Load_Backup_Name.f90 index bc8d8f83f..2907ad57c 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Load_Backup_Name.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Load_Backup_Name.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Load_Backup_Name(val, verbose) + subroutine Load_Backup_Name(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: val - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('LOAD_BACKUP_NAME', 'skip', & - val, verbose) + call Control % Read_Char_Item('LOAD_BACKUP_NAME', 'skip', val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Load_Initial_Solution_Name.f90 b/Sources/Shared/Control_Mod/Input_Output/Load_Initial_Solution_Name.f90 index 0cfb9d9de..a979843b9 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Load_Initial_Solution_Name.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Load_Initial_Solution_Name.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Load_Initial_Solution_Name(val, verbose) + subroutine Load_Initial_Solution_Name(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: val - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('LOAD_INITIAL_SOLUTION_NAME', 'skip', & - val, verbose) + call Control % Read_Char_Item('LOAD_INITIAL_SOLUTION_NAME', 'skip', & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Problem_Name.f90 b/Sources/Shared/Control_Mod/Input_Output/Problem_Name.f90 index e4038a687..3cd9490fd 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Problem_Name.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Problem_Name.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Problem_Name(val, verbose) + subroutine Read_Problem_Name(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: val - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('PROBLEM_NAME', 'unknown', & - val, verbose) + call Control % Read_Char_Item('PROBLEM_NAME', 'unknown', val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Profiler_Info.f90 b/Sources/Shared/Control_Mod/Input_Output/Profiler_Info.f90 new file mode 100644 index 000000000..d31c57c48 --- /dev/null +++ b/Sources/Shared/Control_Mod/Input_Output/Profiler_Info.f90 @@ -0,0 +1,14 @@ +!==============================================================================! + subroutine Profiler_Info(Control, val, verbose) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control + character(SL), intent(out) :: val + logical, optional, intent(in) :: verbose +!==============================================================================! + + call Control % Read_Char_Item('PROFILER_INFO', 'percents', val, verbose) + call String % To_Upper_Case(val) + + end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Results_Save_Interval.f90 b/Sources/Shared/Control_Mod/Input_Output/Results_Save_Interval.f90 index 6d6e5790f..a7f80ccdc 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Results_Save_Interval.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Results_Save_Interval.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Results_Save_Interval(val, verbose) + subroutine Results_Save_Interval(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: val - logical, optional :: verbose + class(Control_Type) :: Control + integer :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('RESULTS_SAVE_INTERVAL', 12, & - val, verbose) + call Control % Read_Int_Item('RESULTS_SAVE_INTERVAL', 12, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Save_Backup_Name.f90 b/Sources/Shared/Control_Mod/Input_Output/Save_Backup_Name.f90 index 9ffb49535..6b551468a 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Save_Backup_Name.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Save_Backup_Name.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Save_Backup_Name(val, verbose) + subroutine Save_Backup_Name(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: val - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SAVE_BACKUP_NAME', 'skip', & - val, verbose) + call Control % Read_Char_Item('SAVE_BACKUP_NAME', 'skip', val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Condition.f90 b/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Condition.f90 index d1e0f2f43..998d0c9da 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Condition.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Condition.f90 @@ -1,16 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Save_Initial_Condition(save_init_cond, verbose) + subroutine Save_Initial_Condition(Control, save_init_cond, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical :: save_init_cond - logical, optional :: verbose + class(Control_Type) :: Control + logical :: save_init_cond + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('SAVE_INITIAL_CONDITION', 'yes', & - val, verbose) + call Control % Read_Char_Item('SAVE_INITIAL_CONDITION', 'yes', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -20,12 +20,10 @@ subroutine Control_Mod_Save_Initial_Condition(save_init_cond, verbose) save_init_cond = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for save_init_cond: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for save initial condition: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Solution_Name.f90 b/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Solution_Name.f90 index eef8d8758..dcb402e73 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Solution_Name.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Save_Initial_Solution_Name.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Save_Initial_Solution_Name(val, verbose) + subroutine Save_Initial_Solution_Name(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: val - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SAVE_INITIAL_SOLUTION_NAME', 'skip', & - val, verbose) + call Control % Read_Char_Item('SAVE_INITIAL_SOLUTION_NAME', 'skip', & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Save_Results_At_Boundaries.f90 b/Sources/Shared/Control_Mod/Input_Output/Save_Results_At_Boundaries.f90 index b7f735223..2338e74f5 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Save_Results_At_Boundaries.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Save_Results_At_Boundaries.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Save_Results_At_Boundaries(save_results_bnd, verbose) + subroutine Save_Results_At_Boundaries(Control, save_results_bnd, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical :: save_results_bnd - logical, optional :: verbose + class(Control_Type) :: Control + logical :: save_results_bnd + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('SAVE_RESULTS_AT_BOUNDARIES', 'yes', & - val, verbose) + call Control % Read_Char_Item('SAVE_RESULTS_AT_BOUNDARIES', 'yes', & + val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -20,12 +21,10 @@ subroutine Control_Mod_Save_Results_At_Boundaries(save_results_bnd, verbose) save_results_bnd = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for save_results_bnd: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for save results at boundaries: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Save_Results_Units.f90 b/Sources/Shared/Control_Mod/Input_Output/Save_Results_Units.f90 new file mode 100644 index 000000000..2363b5717 --- /dev/null +++ b/Sources/Shared/Control_Mod/Input_Output/Save_Results_Units.f90 @@ -0,0 +1,30 @@ +!==============================================================================! + subroutine Save_Results_Units(Control, save_results_uni, verbose) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control + logical :: save_results_uni + logical, optional :: verbose +!-----------------------------------[Locals]-----------------------------------! + character(SL) :: val +!==============================================================================! + + call Control % Read_Char_Item('SAVE_RESULTS_UNITS', 'yes', & + val, verbose) + call String % To_Upper_Case(val) + + if( val .eq. 'YES' ) then + save_results_uni = .true. + + else if( val .eq. 'NO' ) then + save_results_uni = .false. + + else + call Message % Error(72, & + 'Unknown state for save results units: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) + end if + + end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Swarm_Save_Interval.f90 b/Sources/Shared/Control_Mod/Input_Output/Swarm_Save_Interval.f90 index 29096cdbc..a6635b82e 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Swarm_Save_Interval.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Swarm_Save_Interval.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Swarm_Save_Interval(val, verbose) + subroutine Swarm_Save_Interval(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - integer :: val - logical, optional :: verbose + class(Control_Type) :: Control + integer :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('SWARM_SAVE_INTERVAL', 60, & - val, verbose) + call Control % Read_Int_Item('SWARM_SAVE_INTERVAL', 60, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Input_Output/Wall_Time_Max_Hours.f90 b/Sources/Shared/Control_Mod/Input_Output/Wall_Time_Max_Hours.f90 index f61bb50e7..c38c7a82a 100644 --- a/Sources/Shared/Control_Mod/Input_Output/Wall_Time_Max_Hours.f90 +++ b/Sources/Shared/Control_Mod/Input_Output/Wall_Time_Max_Hours.f90 @@ -1,14 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Wall_Time_Max_Hours(val, verbose) + subroutine Wall_Time_Max_Hours(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val - logical, optional :: verbose + class(Control_Type) :: Control + real :: val + logical, optional :: verbose !==============================================================================! ! 168 hours is one week - call Control_Mod_Read_Real_Item('WALL_TIME_MAX_HOURS', 168.0, & - val, verbose) + call Control % Read_Real_Item('WALL_TIME_MAX_HOURS', 168.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Linear_Solvers.f90 b/Sources/Shared/Control_Mod/Linear_Solvers.f90 index bb1c981ca..2d34f369a 100644 --- a/Sources/Shared/Control_Mod/Linear_Solvers.f90 +++ b/Sources/Shared/Control_Mod/Linear_Solvers.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Linear_Solvers(name, verbose) + subroutine Linear_Solvers(Control, name, verbose) !------------------------------------------------------------------------------! ! Reading linear solvers (native or PETSc) from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: name ! name of the pressure-momentum coupling algorithm - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: name + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('LINEAR_SOLVERS', & - 'native', name, verbose = .true.) + call Control % Read_Char_Item('LINEAR_SOLVERS', & + 'native', name, verbose=verbose) call String % To_Upper_Case(name) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Presssure_Solver.f90 b/Sources/Shared/Control_Mod/Max_Threads.f90 similarity index 65% rename from Sources/Shared/Control_Mod/Native/Max_Iterations_For_Presssure_Solver.f90 rename to Sources/Shared/Control_Mod/Max_Threads.f90 index 7a2129a56..d00e2d4be 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Presssure_Solver.f90 +++ b/Sources/Shared/Control_Mod/Max_Threads.f90 @@ -1,13 +1,19 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Pressure_Solver(val, verbose) + subroutine Max_Threads(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_PRESSURE_SOLVER', & - 120, val, verbose) +# ifdef _OPENMP + call Control % Read_Int_Item('MAX_THREADS', 2, val, verbose) +# else + val = 1 + Unused(Control) + Unused(verbose) +# endif end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Energy_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Energy_Solver.f90 index d9150a1ac..b80ecedac 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Energy_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Energy_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Energy_Solver(val, verbose) + subroutine Max_Iterations_For_Energy_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_ENERGY_SOLVER', & - 5, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_ENERGY_SOLVER', & + 5, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Momentum_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Momentum_Solver.f90 index 2573a33cf..806a12a4f 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Momentum_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Momentum_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Momentum_Solver(val, verbose) + subroutine Max_Iterations_For_Momentum_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_MOMENTUM_SOLVER', & - 5, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_MOMENTUM_SOLVER', & + 5, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Potential_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Potential_Solver.f90 index b362b47a8..13d07b6e7 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Potential_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Potential_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Potential_Solver(val, verbose) + subroutine Max_Iterations_For_Potential_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_POTENTIAL_SOLVER', & - 120, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_POTENTIAL_SOLVER', & + 120, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Pressure_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Pressure_Solver.f90 new file mode 100644 index 000000000..eb13a9e19 --- /dev/null +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Pressure_Solver.f90 @@ -0,0 +1,14 @@ +!==============================================================================! + subroutine Max_Iterations_For_Pressure_Solver(Control, val, verbose) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control + integer, intent(out) :: val + logical, optional :: verbose +!==============================================================================! + + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_PRESSURE_SOLVER', & + 120, val, verbose) + + end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Scalars_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Scalars_Solver.f90 index 59fd1aa72..d31d2b79e 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Scalars_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Scalars_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Scalars_Solver(val, verbose) + subroutine Max_Iterations_For_Scalars_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_SCALARS_SOLVER', & - 6, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_SCALARS_SOLVER', & + 6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Turbulence_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Turbulence_Solver.f90 index e818d0be6..7648b71e7 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Turbulence_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Turbulence_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Turbulence_Solver(val, verbose) + subroutine Max_Iterations_For_Turbulence_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_TURBULENCE_SOLVER', & - 6, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_TURBULENCE_SOLVER', & + 6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Vof_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Vof_Solver.f90 index fe7fe8ecc..6ab4945b8 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Vof_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Vof_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Vof_Solver(val, verbose) + subroutine Max_Iterations_For_Vof_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_VOF_SOLVER', & - 6, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_VOF_SOLVER', & + 6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Wall_Distance_Solver.f90 b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Wall_Distance_Solver.f90 index d4d12e48c..bd552ca3c 100644 --- a/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Wall_Distance_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Max_Iterations_For_Wall_Distance_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Iterations_For_Wall_Distance_Solver(val, verbose) + subroutine Max_Iterations_For_Wall_Distance_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER', & - 120, val, verbose) + call Control % Read_Int_Item('MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER', & + 120, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Normalization_For_Energy_Solver.f90 b/Sources/Shared/Control_Mod/Native/Normalization_For_Energy_Solver.f90 index 514e694d0..f7a1839dd 100644 --- a/Sources/Shared/Control_Mod/Native/Normalization_For_Energy_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Normalization_For_Energy_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Normalization_For_Energy_Solver(val, verbose) + subroutine Normalization_For_Energy_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val - logical, optional :: verbose + class(Control_Type) :: Control + real :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('NORMALIZATION_FOR_ENERGY_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('NORMALIZATION_FOR_ENERGY_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Normalization_For_Momentum_Solver.f90 b/Sources/Shared/Control_Mod/Native/Normalization_For_Momentum_Solver.f90 index 8062387aa..e5bca4592 100644 --- a/Sources/Shared/Control_Mod/Native/Normalization_For_Momentum_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Normalization_For_Momentum_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Normalization_For_Momentum_Solver(val, verbose) + subroutine Normalization_For_Momentum_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val - logical, optional :: verbose + class(Control_Type) :: Control + real :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('NORMALIZATION_FOR_MOMENTUM_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('NORMALIZATION_FOR_MOMENTUM_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Normalization_For_Pressure_Solver.f90 b/Sources/Shared/Control_Mod/Native/Normalization_For_Pressure_Solver.f90 index 215a639d5..5a0cec0bc 100644 --- a/Sources/Shared/Control_Mod/Native/Normalization_For_Pressure_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Normalization_For_Pressure_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Normalization_For_Pressure_Solver(val, verbose) + subroutine Normalization_For_Pressure_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val - logical, optional :: verbose + class(Control_Type) :: Control + real :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('NORMALIZATION_FOR_PRESSURE_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('NORMALIZATION_FOR_PRESSURE_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Normalization_For_Scalars_Solver.f90 b/Sources/Shared/Control_Mod/Native/Normalization_For_Scalars_Solver.f90 index 6fceaa0df..0f616fab3 100644 --- a/Sources/Shared/Control_Mod/Native/Normalization_For_Scalars_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Normalization_For_Scalars_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Normalization_For_Scalars_Solver(val, verbose) + subroutine Normalization_For_Scalars_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val - logical, optional :: verbose + class(Control_Type) :: Control + real :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('NORMALIZATION_FOR_SCALARS_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('NORMALIZATION_FOR_SCALARS_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Normalization_For_Turbulence_Solver.f90 b/Sources/Shared/Control_Mod/Native/Normalization_For_Turbulence_Solver.f90 index 3338be206..5e7f33199 100644 --- a/Sources/Shared/Control_Mod/Native/Normalization_For_Turbulence_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Normalization_For_Turbulence_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Normalization_For_Turbulence_Solver(val, verbose) + subroutine Normalization_For_Turbulence_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val - logical, optional :: verbose + class(Control_Type) :: Control + real :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('NORMALIZATION_FOR_TURBULENCE_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('NORMALIZATION_FOR_TURBULENCE_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Preconditioner_For_System_Matrix.f90 b/Sources/Shared/Control_Mod/Native/Preconditioner_For_System_Matrix.f90 index 9cd8061c2..9240d4118 100644 --- a/Sources/Shared/Control_Mod/Native/Preconditioner_For_System_Matrix.f90 +++ b/Sources/Shared/Control_Mod/Native/Preconditioner_For_System_Matrix.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Control_Mod_Preconditioner_For_System_Matrix(val, verbose) + subroutine Preconditioner_For_System_Matrix(Control, val, verbose) !------------------------------------------------------------------------------! ! These are preconditioners for the T-Flows suite of solvers. PETSc has ! ! many more, of course. For compatibillity with PETSc, these keywords have ! @@ -14,28 +14,27 @@ subroutine Control_Mod_Preconditioner_For_System_Matrix(val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - character(SL) :: val - logical, optional :: verbose + class(Control_Type) :: Control + character(SL) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('PRECONDITIONER_FOR_SYSTEM_MATRIX', & - 'incomplete_cholesky', & - val, & - verbose) + call Control % Read_Char_Item('PRECONDITIONER_FOR_SYSTEM_MATRIX', & + 'incomplete_cholesky', & + val, & + verbose) call String % To_Lower_Case(val) ! Check validity of the input - if( val.ne.'none' .and. & - val.ne.'diagonal' .and. & - val.ne.'jacobi' .and. & - val.ne.'incomplete_cholesky' .and. & - val.ne.'icc') then - if(this_proc < 2) then - print *, '# ERROR! Unknown preconditioner for the system matrix: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if( val .ne. 'none' .and. & + val .ne. 'diagonal' .and. & + val .ne. 'jacobi' .and. & + val .ne. 'incomplete_cholesky' .and. & + val .ne. 'icc') then + call Message % Error(72, & + 'Unknown preconditioner for the system matrix: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) ! Use the same names as PETSc else diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Energy.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Energy.f90 index ff4b8e153..d6f511fe8 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Energy.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Energy.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Energy(val, verbose) + subroutine Solver_For_Energy(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_ENERGY', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_ENERGY', 'bicg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for energy: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(60, & + 'Unknown linear solver for energy: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Momentum.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Momentum.f90 index bbfd3a57f..2ffffec2e 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Momentum.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Momentum.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Momentum(val, verbose) + subroutine Solver_For_Momentum(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_MOMENTUM', 'bicg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_MOMENTUM', 'bicg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for momentum: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(60, & + 'Unknown linear solver for momentum: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Potential.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Potential.f90 index 405e7e047..0d79c1f38 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Potential.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Potential.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Potential(val, verbose) + subroutine Solver_For_Potential(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_POTENTIAL', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_POTENTIAL', 'cg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for pressure: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(60, & + 'Unknown linear solver for potential: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Pressure.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Pressure.f90 index c68fd371a..216b1f381 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Pressure.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Pressure.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Pressure(val, verbose) + subroutine Solver_For_Pressure(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_PRESSURE', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_PRESSURE', 'cg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for pressure: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(60, & + 'Unknown linear solver for pressure: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Scalars.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Scalars.f90 index 5415e3242..24502eb0c 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Scalars.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Scalars.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Scalars(val, verbose) + subroutine Solver_For_Scalars(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_SCALARS', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_SCALARS', 'bicg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for user scalars: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(60, & + 'Unknown linear solver for scalars: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Turbulence.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Turbulence.f90 index 234404fc0..0e4cfd10b 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Turbulence.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Turbulence.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Turbulence(val, verbose) + subroutine Solver_For_Turbulence(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_TURBULENCE', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_TURBULENCE', 'bicg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for turbulence: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(72, & + 'Unknown linear solver for wall turbulence: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Vof.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Vof.f90 index bfcc475cf..7965ba005 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Vof.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Vof.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Vof(val, verbose) + subroutine Solver_For_Vof(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_VOF', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_VOF', 'bicg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for multiphase: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(72, & + 'Unknown linear solver for wall multiphase: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Solver_For_Wall_Distance.f90 b/Sources/Shared/Control_Mod/Native/Solver_For_Wall_Distance.f90 index 02adb5527..3277213f3 100644 --- a/Sources/Shared/Control_Mod/Native/Solver_For_Wall_Distance.f90 +++ b/Sources/Shared/Control_Mod/Native/Solver_For_Wall_Distance.f90 @@ -1,22 +1,24 @@ !==============================================================================! - subroutine Control_Mod_Solver_For_Wall_Distance(val, verbose) + subroutine Solver_For_Wall_Distance(Control, val, verbose) +!------------------------------------------------------------------------------! +! Default values in this, and her sister functions, is simply as follows: ! +! If matrix is expected to be symmetric, take 'cg', otherwise take 'bicg'. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SOLVER_FOR_WALL_DISTANCE', 'cg', & - val, verbose) + call Control % Read_Char_Item('SOLVER_FOR_WALL_DISTANCE', 'cg', val, verbose) call String % To_Lower_Case(val) - if( val.ne.'bicg' .and. val.ne.'cgs' .and. val.ne.'cg') then - if(this_proc < 2) then - print *, '# ERROR! Unknown linear solver for pressure: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End + if(val .ne. 'bicg' .and. val .ne. 'cg') then + call Message % Error(60, & + 'Unknown linear solver for wall distance: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Energy_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Energy_Solver.f90 index 7645b02e5..b7c6aac40 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Energy_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Energy_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Energy_Solver(val, verbose) + subroutine Tolerance_For_Energy_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_ENERGY_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_ENERGY_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Momentum_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Momentum_Solver.f90 index 798e221fa..eb6ac96f5 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Momentum_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Momentum_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Momentum_Solver(val, verbose) + subroutine Tolerance_For_Momentum_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_MOMENTUM_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_MOMENTUM_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Potential_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Potential_Solver.f90 index 4e29a4ab3..25474f709 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Potential_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Potential_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Potential_Solver(val, verbose) + subroutine Tolerance_For_Potential_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_POTENTIAL_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_POTENTIAL_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Pressure_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Pressure_Solver.f90 index acbf72b74..3d39391d8 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Pressure_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Pressure_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Pressure_Solver(val, verbose) + subroutine Tolerance_For_Pressure_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_PRESSURE_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_PRESSURE_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Scalars_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Scalars_Solver.f90 index 40d83a40f..1a6ff6d66 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Scalars_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Scalars_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Scalars_Solver(val, verbose) + subroutine Tolerance_For_Scalars_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_SCALARS_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_SCALARS_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Turbulence_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Turbulence_Solver.f90 index 10250c16e..c4b34267a 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Turbulence_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Turbulence_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Turbulence_Solver(val, verbose) + subroutine Tolerance_For_Turbulence_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_TURBULENCE_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_TURBULENCE_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Vof_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Vof_Solver.f90 index def106136..b3b076819 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Vof_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Vof_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Vof_Solver(val, verbose) + subroutine Tolerance_For_Vof_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_VOF_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_VOF_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Native/Tolerance_For_Wall_Distance_Solver.f90 b/Sources/Shared/Control_Mod/Native/Tolerance_For_Wall_Distance_Solver.f90 index 6fd1e34c1..507d5e7b4 100644 --- a/Sources/Shared/Control_Mod/Native/Tolerance_For_Wall_Distance_Solver.f90 +++ b/Sources/Shared/Control_Mod/Native/Tolerance_For_Wall_Distance_Solver.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Wall_Distance_Solver(val, verbose) + subroutine Tolerance_For_Wall_Distance_Solver(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_WALL_DISTANCE_SOLVER', & - 1.0e-6, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_WALL_DISTANCE_SOLVER', & + 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Energy.f90 b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Energy.f90 index 502f89bab..ba0f053af 100644 --- a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Energy.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Energy.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Advection_Scheme_For_Energy(scheme_name, verbose) + subroutine Advection_Scheme_For_Energy(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading turbulence model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('ADVECTION_SCHEME_FOR_ENERGY', 'smart', & - scheme_name, verbose) + call Control % Read_Char_Item('ADVECTION_SCHEME_FOR_ENERGY', 'smart', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Momentum.f90 b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Momentum.f90 index 0091e1af0..eb7a6c48b 100644 --- a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Momentum.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Momentum.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Advection_Scheme_For_Momentum(scheme_name, verbose) + subroutine Advection_Scheme_For_Momentum(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading turbulence model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('ADVECTION_SCHEME_FOR_MOMENTUM', 'smart', & - scheme_name, verbose) + call Control % Read_Char_Item('ADVECTION_SCHEME_FOR_MOMENTUM', 'smart', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Scalars.f90 b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Scalars.f90 index c0661d53a..b2feec1bc 100644 --- a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Scalars.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Scalars.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Advection_Scheme_For_Scalars(scheme_name, verbose) + subroutine Advection_Scheme_For_Scalars(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading turbulence model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('ADVECTION_SCHEME_FOR_SCALARS', & - 'smart', scheme_name, verbose) + call Control % Read_Char_Item('ADVECTION_SCHEME_FOR_SCALARS', & + 'smart', scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Turbulence.f90 b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Turbulence.f90 index 8f604c57d..9627e3ea7 100644 --- a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Turbulence.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Turbulence.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Advection_Scheme_For_Turbulence(scheme_name, verbose) + subroutine Advection_Scheme_For_Turbulence(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading turbulence model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('ADVECTION_SCHEME_FOR_TURBULENCE', 'smart', & - scheme_name, verbose) + call Control % Read_Char_Item('ADVECTION_SCHEME_FOR_TURBULENCE', 'smart', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Vof.f90 index f1d1bcdd7..582fc08a1 100644 --- a/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Advection_Scheme_For_Vof.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Advection_Scheme_For_Vof(scheme_name, verbose) + subroutine Advection_Scheme_For_Vof(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading advection shceme for vof from control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('ADVECTION_SCHEME_FOR_VOF', & - 'upwind', scheme_name, verbose) + call Control % Read_Char_Item('ADVECTION_SCHEME_FOR_VOF', & + 'upwind', scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Energy.f90 b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Energy.f90 index 21c9c65f6..ea5aaa40f 100644 --- a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Energy.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Energy.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Blending_Coefficient_For_Energy(val, verbose) + subroutine Blending_Coefficient_For_Energy(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('BLENDING_COEFFICIENT_FOR_ENERGY', 1.0, & - val, verbose) + call Control % Read_Real_Item('BLENDING_COEFFICIENT_FOR_ENERGY', 1.0, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Momentum.f90 b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Momentum.f90 index 0a3bf157f..d608ff21a 100644 --- a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Momentum.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Momentum.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Blending_Coefficient_For_Momentum(val, verbose) + subroutine Blending_Coefficient_For_Momentum(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('BLENDING_COEFFICIENT_FOR_MOMENTUM', 1.0, & - val, verbose) + call Control % Read_Real_Item('BLENDING_COEFFICIENT_FOR_MOMENTUM', 1.0, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Scalars.f90 b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Scalars.f90 index 1448f0a18..ba1395f9d 100644 --- a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Scalars.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Scalars.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Blending_Coefficient_For_Scalars(val, verbose) + subroutine Blending_Coefficient_For_Scalars(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('BLENDING_COEFFICIENT_FOR_SCALARS', & - 1.0, val, verbose) + call Control % Read_Real_Item('BLENDING_COEFFICIENT_FOR_SCALARS', & + 1.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Turbulence.f90 b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Turbulence.f90 index bed4fd1c9..fd9297d5d 100644 --- a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Turbulence.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Turbulence.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Blending_Coefficient_For_Turbulence(val, verbose) + subroutine Blending_Coefficient_For_Turbulence(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('BLENDING_COEFFICIENT_FOR_TURBULENCE', 1.0, & - val, verbose) + call Control % Read_Real_Item('BLENDING_COEFFICIENT_FOR_TURBULENCE', 1.0, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Vof.f90 index 1b4864e46..f9f88b10a 100644 --- a/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Blending_Coefficient_For_Vof.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Blending_Coefficient_For_Vof(val, verbose) + subroutine Blending_Coefficient_For_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('BLENDING_COEFFICIENT_FOR_VOF', & - 1.0, val, verbose) + call Control % Read_Real_Item('BLENDING_COEFFICIENT_FOR_VOF', & + 1.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Choi_Correction.f90 b/Sources/Shared/Control_Mod/Numerics/Choi_Correction.f90 index 1bd5e8e71..7c748079f 100644 --- a/Sources/Shared/Control_Mod/Numerics/Choi_Correction.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Choi_Correction.f90 @@ -1,32 +1,29 @@ !==============================================================================! - subroutine Control_Mod_Choi_Correction(choi_correction, verbose) + subroutine Choi_Correction(Control, corr, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical, intent(out) :: choi_correction + class(Control_Type) :: Control + logical, intent(out) :: corr logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('CHOI_CORRECTION', 'no', val, verbose) + call Control % Read_Char_Item('CHOI_CORRECTION', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then - choi_correction = .true. + corr = .true. else if( val .eq. 'NO' ) then - choi_correction = .false. + corr = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for Choi''s correction: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(60, & + 'Unknown state for Choi correction: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Energy.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Energy.f90 index ba0e84129..1ed5679b7 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Energy.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Energy.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Energy(scheme_name, verbose) + subroutine Gradient_Method_For_Energy(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for energy (temperature, in practice) ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_ENERGY', & - 'least_squares', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_ENERGY', & + 'least_squares', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Momentum.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Momentum.f90 index 3a97bd608..2f5109f74 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Momentum.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Momentum.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Momentum(scheme_name, verbose) + subroutine Gradient_Method_For_Momentum(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for momentum (velocities, in practice) ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_MOMENTUM', & - 'least_squares', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_MOMENTUM', & + 'least_squares', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Pressure.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Pressure.f90 index 032787129..b6aea2f78 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Pressure.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Pressure.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Pressure(scheme_name, verbose) + subroutine Gradient_Method_For_Pressure(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for pressure. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_PRESSURE', & - 'least_squares', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_PRESSURE', & + 'least_squares', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Scalars.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Scalars.f90 index e1a65e40d..eea53c16c 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Scalars.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Scalars.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Scalars(scheme_name, verbose) + subroutine Gradient_Method_For_Scalars(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for scalars. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_SCALARS', & - 'least_squares', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_SCALARS', & + 'least_squares', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Turbulence.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Turbulence.f90 index face7c40d..4e9c4ad62 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Turbulence.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Turbulence.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Turbulence(scheme_name, verbose) + subroutine Gradient_Method_For_Turbulence(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for turbulent quantities. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_TURBULENCE', & - 'least_squares', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_TURBULENCE', & + 'least_squares', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Vof.f90 index 09a81eb11..24583db74 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Vof.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Vof(scheme_name, verbose) + subroutine Gradient_Method_For_Vof(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for multiphase variables. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_VOF', & - 'least_squares', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_VOF', & + 'least_squares', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Wall_Distance.f90 b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Wall_Distance.f90 index 8ad5964ad..ce4b5a222 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Wall_Distance.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gradient_Method_For_Wall_Distance.f90 @@ -1,18 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Gradient_Method_For_Wall_Distance(scheme_name, & - verbose) + subroutine Gradient_Method_For_Wall_Distance(Control, scheme_name, verbose) !------------------------------------------------------------------------------! ! Reading gradient method for wall distance ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('GRADIENT_METHOD_FOR_WALL_DISTANCE', & - 'gauss_theorem', & - scheme_name, verbose) + call Control % Read_Char_Item('GRADIENT_METHOD_FOR_WALL_DISTANCE', & + 'gauss_theorem', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Gu_Correction.f90 b/Sources/Shared/Control_Mod/Numerics/Gu_Correction.f90 index 749df0279..d913b1911 100644 --- a/Sources/Shared/Control_Mod/Numerics/Gu_Correction.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Gu_Correction.f90 @@ -1,32 +1,29 @@ !==============================================================================! - subroutine Control_Mod_Gu_Correction(gu_correction, verbose) + subroutine Gu_Correction(Control, corr, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical, intent(out) :: gu_correction + class(Control_Type) :: Control + logical, intent(out) :: corr logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('GU_CORRECTION', 'no', val, verbose) + call Control % Read_Char_Item('GU_CORRECTION', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then - gu_correction = .true. + corr = .true. else if( val .eq. 'NO' ) then - gu_correction = .false. + corr = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for Gu''s correction: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - stop - + call Message % Error(60, & + 'Unknown state for Gu correction: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Correction_Cycles_Beta_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Correction_Cycles_Beta_Vof.f90 index 547cc0b3d..fd1a181ee 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Correction_Cycles_Beta_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Correction_Cycles_Beta_Vof.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Correction_Cycles_Beta_Vof(val, verbose) + subroutine Max_Correction_Cycles_Beta_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_CORRECTION_CYCLES_BETA_VOF', & - 2, val, verbose) + call Control % Read_Int_Item('MAX_CORRECTION_CYCLES_BETA_VOF', & + 2, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Courant_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Courant_Vof.f90 index 99d6689cb..51d3d42a1 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Courant_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Courant_Vof.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Max_Courant_Vof(val, verbose) + subroutine Max_Courant_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('MAX_COURANT_VOF', & - 0.25, val, verbose) + call Control % Read_Real_Item('MAX_COURANT_VOF', 0.25, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Gauss_Gradients_Iterations.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Gauss_Gradients_Iterations.f90 index 172bb4ae0..489d5b4a7 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Gauss_Gradients_Iterations.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Gauss_Gradients_Iterations.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Gauss_Gradients_Iterations(val, verbose) + subroutine Max_Gauss_Gradients_Iterations(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_GAUSS_GRADIENTS_ITERATIONS', 12, & - val, verbose) + call Control % Read_Int_Item('MAX_GAUSS_GRADIENTS_ITERATIONS', 12, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Least_Squares_Gradients_Iterations.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Least_Squares_Gradients_Iterations.f90 index 8cbef9a49..4d12f10dc 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Least_Squares_Gradients_Iterations.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Least_Squares_Gradients_Iterations.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Least_Squares_Gradients_Iterations(val, verbose) + subroutine Max_Least_Squares_Gradients_Iterations(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_LEAST_SQUARES_GRADIENTS_ITERATIONS', 4, & - val, verbose) + call Control % Read_Int_Item('MAX_LEAST_SQUARES_GRADIENTS_ITERATIONS', 4, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Simple_Iterations.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Simple_Iterations.f90 index 32662b556..6882cb7ea 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Simple_Iterations.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Simple_Iterations.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Simple_Iterations(val, verbose) + subroutine Max_Simple_Iterations(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_SIMPLE_ITERATIONS', 12, & - val, verbose) + call Control % Read_Int_Item('MAX_SIMPLE_ITERATIONS', 12, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Curvature_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Curvature_Vof.f90 index f8cea9b25..87753bda1 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Curvature_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Curvature_Vof.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Smoothing_Cycles_Curvature_Vof(val, verbose) + subroutine Max_Smoothing_Cycles_Curvature_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_SMOOTHING_CYCLES_CURVATURE_VOF', & - 2, val, verbose) + call Control % Read_Int_Item('MAX_SMOOTHING_CYCLES_CURVATURE_VOF', & + 2, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Normal_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Normal_Vof.f90 index 62ebdca8d..23dd022bb 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Normal_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Smoothing_Cycles_Normal_Vof.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Smoothing_Cycles_Normal_Vof(val, verbose) + subroutine Max_Smoothing_Cycles_Normal_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_SMOOTHING_CYCLES_NORMAL_VOF', & - 0, val, verbose) + call Control % Read_Int_Item('MAX_SMOOTHING_CYCLES_NORMAL_VOF', & + 0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Max_Substep_Cycles_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Max_Substep_Cycles_Vof.f90 index 0c6f4a7b5..725aafdb5 100644 --- a/Sources/Shared/Control_Mod/Numerics/Max_Substep_Cycles_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Max_Substep_Cycles_Vof.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Max_Substep_Cycles_Vof(val, verbose) + subroutine Max_Substep_Cycles_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_int_Item('MAX_SUBSTEP_CYCLES_VOF', & - 100, val, verbose) + call Control % Read_Int_Item('MAX_SUBSTEP_CYCLES_VOF', & + 100, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Min_Simple_Iterations.f90 b/Sources/Shared/Control_Mod/Numerics/Min_Simple_Iterations.f90 index f67cde185..5499ea988 100644 --- a/Sources/Shared/Control_Mod/Numerics/Min_Simple_Iterations.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Min_Simple_Iterations.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Min_Simple_Iterations(val, verbose) + subroutine Min_Simple_Iterations(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MIN_SIMPLE_ITERATIONS', 3, & - val, verbose) + call Control % Read_Int_Item('MIN_SIMPLE_ITERATIONS', 3, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Number_Of_Piso_Corrections.f90 b/Sources/Shared/Control_Mod/Numerics/Number_Of_Piso_Corrections.f90 index 74ac895b2..6411dae9c 100644 --- a/Sources/Shared/Control_Mod/Numerics/Number_Of_Piso_Corrections.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Number_Of_Piso_Corrections.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Number_Of_Piso_Corrections(val, verbose) + subroutine Number_Of_Piso_Corrections(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('NUMBER_OF_PISO_CORRECTIONS', 3, & - val, verbose) + call Control % Read_Int_Item('NUMBER_OF_PISO_CORRECTIONS', 3, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Number_Of_Time_Steps.f90 b/Sources/Shared/Control_Mod/Numerics/Number_Of_Time_Steps.f90 index e8d719951..b4b9e5d45 100644 --- a/Sources/Shared/Control_Mod/Numerics/Number_Of_Time_Steps.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Number_Of_Time_Steps.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Number_Of_Time_Steps(val, verbose) + subroutine Number_Of_Time_Steps(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('NUMBER_OF_TIME_STEPS', 1200, & - val, verbose) + call Control % Read_Int_Item('NUMBER_OF_TIME_STEPS', 1200, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Pressure_Momentum_Coupling.f90 b/Sources/Shared/Control_Mod/Numerics/Pressure_Momentum_Coupling.f90 index ec8c95e0d..23491cc89 100644 --- a/Sources/Shared/Control_Mod/Numerics/Pressure_Momentum_Coupling.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Pressure_Momentum_Coupling.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Pressure_Momentum_Coupling(name, verbose) + subroutine Pressure_Momentum_Coupling(Control, name, verbose) !------------------------------------------------------------------------------! ! Reading pressure-momentum model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: name ! simple or piso logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('PRESSURE_MOMENTUM_COUPLING', & - 'simple', name, verbose = .true.) + call Control % Read_Char_Item('PRESSURE_MOMENTUM_COUPLING', & + 'simple', name, verbose=verbose) call String % To_Upper_Case(name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Report_Volume_Balance.f90 b/Sources/Shared/Control_Mod/Numerics/Report_Volume_Balance.f90 index 8407299fe..30f8890f9 100644 --- a/Sources/Shared/Control_Mod/Numerics/Report_Volume_Balance.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Report_Volume_Balance.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Report_Volume_Balance(vol_bal, verbose) + subroutine Report_Volume_Balance(Control, vol_bal, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: vol_bal logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('REPORT_VOLUME_BALANCE', & - 'no', val, verbose) + call Control % Read_Char_Item('REPORT_VOLUME_BALANCE', & + 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -20,13 +21,10 @@ subroutine Control_Mod_Report_Volume_Balance(vol_bal, verbose) vol_bal = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for reporting volume balance: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for reporting volume balance: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Energy.f90 b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Energy.f90 index 8bbb0e594..2c5dadad1 100644 --- a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Energy.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Energy.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Simple_Underrelaxation_For_Energy(val, verbose) + subroutine Simple_Underrelaxation_For_Energy(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_ENERGY', 0.5, & - val, verbose) + call Control % Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_ENERGY', 0.5, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Momentum.f90 b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Momentum.f90 index f7966bf96..4e05568c9 100644 --- a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Momentum.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Momentum.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Simple_Underrelaxation_For_Momentum(val, verbose) + subroutine Simple_Underrelaxation_For_Momentum(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_MOMENTUM', 0.6, & - val, verbose) + call Control % Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_MOMENTUM', 0.6, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Pressure.f90 b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Pressure.f90 index 3dbcb68f5..57edde997 100644 --- a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Pressure.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Pressure.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Simple_Underrelaxation_For_Pressure(val, verbose) + subroutine Simple_Underrelaxation_For_Pressure(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_PRESSURE', 0.4, & - val, verbose) + call Control % Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_PRESSURE', 0.4, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Scalars.f90 b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Scalars.f90 index 710a6a959..324388190 100644 --- a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Scalars.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Scalars.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Simple_Underrelaxation_For_Scalars(val, verbose) + subroutine Simple_Underrelaxation_For_Scalars(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_SCALARS', & - 0.5, val, verbose) + call Control % Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_SCALARS', & + 0.5, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Turbulence.f90 b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Turbulence.f90 index c7ae6e557..3eb2ef745 100644 --- a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Turbulence.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Turbulence.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Simple_Underrelaxation_For_Turbulence(val, verbose) + subroutine Simple_Underrelaxation_For_Turbulence(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_TURBULENCE', & - 0.7, val, verbose) + call Control % Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_TURBULENCE', & + 0.7, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Vof.f90 index 20afa21e3..c561f179b 100644 --- a/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Simple_Underrelaxation_For_Vof.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Simple_Underrelaxation_For_Vof(val, verbose) + subroutine Simple_Underrelaxation_For_Vof(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_VOF', & - 0.5, val, verbose) + call Control % Read_Real_Item('SIMPLE_UNDERRELAXATION_FOR_VOF', & + 0.5, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Skewness_Correction_Vof.f90 b/Sources/Shared/Control_Mod/Numerics/Skewness_Correction_Vof.f90 index 8aba4dace..712af7e38 100644 --- a/Sources/Shared/Control_Mod/Numerics/Skewness_Correction_Vof.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Skewness_Correction_Vof.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Skewness_Correction_Vof(skew_corr, verbose) + subroutine Skewness_Correction_Vof(Control, skew_corr, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: skew_corr logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('SKEWNESS_CORRECTION_VOF', & - 'no', val, verbose) + call Control % Read_Char_Item('SKEWNESS_CORRECTION_VOF', & + 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -20,13 +21,10 @@ subroutine Control_Mod_Skewness_Correction_Vof(skew_corr, verbose) skew_corr = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for temporal skewness correction: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for skewness correction: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Time_Integration_Scheme.f90 b/Sources/Shared/Control_Mod/Numerics/Time_Integration_Scheme.f90 index a549b7d04..9766665c5 100644 --- a/Sources/Shared/Control_Mod/Numerics/Time_Integration_Scheme.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Time_Integration_Scheme.f90 @@ -1,14 +1,15 @@ !==============================================================================! - subroutine Control_Mod_Time_Integration_Scheme(scheme_name, verbose) + subroutine Time_Integration_Scheme(Control, scheme_name, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: scheme_name logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('TIME_INTEGRATION_SCHEME', 'linear', & - scheme_name, verbose) + call Control % Read_Char_Item('TIME_INTEGRATION_SCHEME', 'linear', & + scheme_name, verbose) call String % To_Upper_Case(scheme_name) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Time_Step.f90 b/Sources/Shared/Control_Mod/Numerics/Time_Step.f90 index 9a56f98e5..821194af5 100644 --- a/Sources/Shared/Control_Mod/Numerics/Time_Step.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Time_Step.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Time_Step(val, verbose) + subroutine Time_Step(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TIME_STEP', 1.0e-2, & - val, verbose) + call Control % Read_Real_Item('TIME_STEP', 1.0e-2, & + val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Gauss_Gradients.f90 b/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Gauss_Gradients.f90 index 891e788ee..00166c161 100644 --- a/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Gauss_Gradients.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Gauss_Gradients.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Gauss_Gradients(val, verbose) + subroutine Tolerance_For_Gauss_Gradients(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_GAUSS_GRADIENTS', & - 1.0e-3, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_GAUSS_GRADIENTS', & + 1.0e-3, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Simple_Algorithm.f90 b/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Simple_Algorithm.f90 index 6983fd22d..f45c1ae6c 100644 --- a/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Simple_Algorithm.f90 +++ b/Sources/Shared/Control_Mod/Numerics/Tolerance_For_Simple_Algorithm.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Tolerance_For_Simple_Algorithm(val, verbose) + subroutine Tolerance_For_Simple_Algorithm(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TOLERANCE_FOR_SIMPLE_ALGORITHM', & - 1.0e-4, val, verbose) + call Control % Read_Real_Item('TOLERANCE_FOR_SIMPLE_ALGORITHM', & + 1.0e-4, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Angular_Velocity_Vector.f90 b/Sources/Shared/Control_Mod/Physics/Angular_Velocity_Vector.f90 index 1789fc990..7a1d59599 100644 --- a/Sources/Shared/Control_Mod/Physics/Angular_Velocity_Vector.f90 +++ b/Sources/Shared/Control_Mod/Physics/Angular_Velocity_Vector.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Control_Mod_Angular_Velocity_Vector(v_x, v_y, v_z, verbose) + subroutine Angular_Velocity_Vector(Control, v_x, v_y, v_z, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: v_x, v_y, v_z - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: v_x, v_y, v_z + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(3) real :: val(3) @@ -12,8 +13,8 @@ subroutine Control_Mod_Angular_Velocity_Vector(v_x, v_y, v_z, verbose) data def / 0.0, 0.0, 0.0 / - call Control_Mod_Read_Real_Array('ANGULAR_VELOCITY_VECTOR', 3, def, & - val, verbose) + call Control % Read_Real_Vector('ANGULAR_VELOCITY_VECTOR', 3, def, & + val, verbose) v_x = val(1) v_y = val(2) diff --git a/Sources/Shared/Control_Mod/Physics/Buoyancy.f90 b/Sources/Shared/Control_Mod/Physics/Buoyancy.f90 index f05f446de..c47e7a5e4 100644 --- a/Sources/Shared/Control_Mod/Physics/Buoyancy.f90 +++ b/Sources/Shared/Control_Mod/Physics/Buoyancy.f90 @@ -1,15 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Buoyancy(val, verbose) + subroutine Buoyancy(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading buoyancy model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('BUOYANCY', 'none', val, verbose) + call Control % Read_Char_Item('BUOYANCY', 'none', val, verbose) call String % To_Upper_Case(val) diff --git a/Sources/Shared/Control_Mod/Physics/Dynamic_Viscosity.f90 b/Sources/Shared/Control_Mod/Physics/Dynamic_Viscosity.f90 index 6c904416f..3a5502fc2 100644 --- a/Sources/Shared/Control_Mod/Physics/Dynamic_Viscosity.f90 +++ b/Sources/Shared/Control_Mod/Physics/Dynamic_Viscosity.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Dynamic_Viscosity(val, verbose) + subroutine Dynamic_Viscosity(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('DYNAMIC_VISCOSITY', 0.01, val, verbose) + call Control % Read_Real_Item('DYNAMIC_VISCOSITY', 0.01, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Extrapolate_Temperature_Exp.f90 b/Sources/Shared/Control_Mod/Physics/Extrapolate_Temperature_Exp.f90 index 53ef806f3..1f7810bd6 100644 --- a/Sources/Shared/Control_Mod/Physics/Extrapolate_Temperature_Exp.f90 +++ b/Sources/Shared/Control_Mod/Physics/Extrapolate_Temperature_Exp.f90 @@ -1,19 +1,19 @@ !==============================================================================! - subroutine Control_Mod_Extrapolate_Temperature_Exp(temp_exp, & - verbose) + subroutine Extrapolate_Temperature_Exp(Control, temp_exp, verbose) !------------------------------------------------------------------------------! ! Reading if temprature will be extrapolated to walls exponentially ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: temp_exp logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('EXTRAPOLATE_TEMPERATURE_EXP', & - 'no', val, verbose) + call Control % Read_Char_Item('EXTRAPOLATE_TEMPERATURE_EXP', & + 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -23,13 +23,10 @@ subroutine Control_Mod_Extrapolate_Temperature_Exp(temp_exp, & temp_exp = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for temperature extrapolation: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for temperature extrapolation: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Gravitational_Vector.f90 b/Sources/Shared/Control_Mod/Physics/Gravitational_Vector.f90 index 638c9536a..2c74d0e69 100644 --- a/Sources/Shared/Control_Mod/Physics/Gravitational_Vector.f90 +++ b/Sources/Shared/Control_Mod/Physics/Gravitational_Vector.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Control_Mod_Gravitational_Vector(grav_x, grav_y, grav_z, verbose) + subroutine Gravitational_Vector(Control, grav_x, grav_y, grav_z, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: grav_x, grav_y, grav_z - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: grav_x, grav_y, grav_z + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(3) real :: val(3) @@ -12,8 +13,7 @@ subroutine Control_Mod_Gravitational_Vector(grav_x, grav_y, grav_z, verbose) data def / 0.0, 0.0, 0.0 / - call Control_Mod_Read_Real_Array('GRAVITATIONAL_VECTOR', 3, def, & - val, verbose) + call Control % Read_Real_Vector('GRAVITATIONAL_VECTOR', 3, def, val, verbose) grav_x = val(1) grav_y = val(2) diff --git a/Sources/Shared/Control_Mod/Physics/Heat_Capacity.f90 b/Sources/Shared/Control_Mod/Physics/Heat_Capacity.f90 index f4a197da5..41ca65f5b 100644 --- a/Sources/Shared/Control_Mod/Physics/Heat_Capacity.f90 +++ b/Sources/Shared/Control_Mod/Physics/Heat_Capacity.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Heat_Capacity(val, verbose) + subroutine Heat_Capacity(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('HEAT_CAPACITY', 1.0, val, verbose) + call Control % Read_Real_Item('HEAT_CAPACITY', 1.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Heat_Transfer.f90 b/Sources/Shared/Control_Mod/Physics/Heat_Transfer.f90 index 126c8cb62..e5392b5c8 100644 --- a/Sources/Shared/Control_Mod/Physics/Heat_Transfer.f90 +++ b/Sources/Shared/Control_Mod/Physics/Heat_Transfer.f90 @@ -1,30 +1,29 @@ !==============================================================================! - subroutine Control_Mod_Heat_Transfer(heat_transfer, verbose) + subroutine Heat_Transfer(Control, heat, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical, intent(out) :: heat_transfer + class(Control_Type) :: Control + logical, intent(out) :: heat logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('HEAT_TRANSFER', 'no', val, verbose) + call Control % Read_Char_Item('HEAT_TRANSFER', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then - heat_transfer = .true. + heat = .true. else if( val .eq. 'NO' ) then - heat_transfer = .false. + heat = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for heat transfer: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(60, & + 'Unknown state for heat transfer: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Hybrid_Les_Rans_Switch.f90 b/Sources/Shared/Control_Mod/Physics/Hybrid_Les_Rans_Switch.f90 index 01189ae1b..316fffdc4 100644 --- a/Sources/Shared/Control_Mod/Physics/Hybrid_Les_Rans_Switch.f90 +++ b/Sources/Shared/Control_Mod/Physics/Hybrid_Les_Rans_Switch.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Hybrid_Les_Rans_Switch(val, verbose) + subroutine Hybrid_Les_Rans_Switch(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading switch for hybrid LES/RANS model. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('HYBRID_LES_RANS_SWITCH', & - 'SWITCH_DISTANCE', & - val, verbose) + call Control % Read_Char_Item('HYBRID_LES_RANS_SWITCH', & + 'SWITCH_DISTANCE', & + val, verbose) call String % To_Upper_Case(val) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Interface_Tracking.f90 b/Sources/Shared/Control_Mod/Physics/Interface_Tracking.f90 index f13c3396f..03a623b73 100644 --- a/Sources/Shared/Control_Mod/Physics/Interface_Tracking.f90 +++ b/Sources/Shared/Control_Mod/Physics/Interface_Tracking.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Interface_Tracking(track_int, verbose) + subroutine Interface_Tracking(Control, track_int, verbose) !------------------------------------------------------------------------------! ! Reading if vof will be used to model multiphase situation ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: track_int logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('INTERFACE_TRACKING', 'no', val, verbose) + call Control % Read_Char_Item('INTERFACE_TRACKING', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -21,13 +22,10 @@ subroutine Control_Mod_Interface_Tracking(track_int, verbose) track_int = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for track front: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for interface tracking: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Latent_Heat.f90 b/Sources/Shared/Control_Mod/Physics/Latent_Heat.f90 index dd56d0f46..6fa2f5544 100644 --- a/Sources/Shared/Control_Mod/Physics/Latent_Heat.f90 +++ b/Sources/Shared/Control_Mod/Physics/Latent_Heat.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Latent_Heat(val, verbose) + subroutine Latent_Heat(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('LATENT_HEAT', 1.0, val, verbose) + call Control % Read_Real_Item('LATENT_HEAT', 1.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Mass_Density.f90 b/Sources/Shared/Control_Mod/Physics/Mass_Density.f90 index 24f32ef7a..5a886d762 100644 --- a/Sources/Shared/Control_Mod/Physics/Mass_Density.f90 +++ b/Sources/Shared/Control_Mod/Physics/Mass_Density.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Mass_Density(val, verbose) + subroutine Mass_Density(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('MASS_DENSITY', 1.0, val, verbose) + call Control % Read_Real_Item('MASS_DENSITY', 1.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Mass_Flow_Rates.f90 b/Sources/Shared/Control_Mod/Physics/Mass_Flow_Rates.f90 index c1adcde26..ae847d841 100644 --- a/Sources/Shared/Control_Mod/Physics/Mass_Flow_Rates.f90 +++ b/Sources/Shared/Control_Mod/Physics/Mass_Flow_Rates.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Control_Mod_Mass_Flow_Rates(b_x, b_y, b_z, verbose) + subroutine Mass_Flow_Rates(Control, b_x, b_y, b_z, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: b_x, b_y, b_z - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: b_x, b_y, b_z + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(3) real :: val(3) @@ -12,8 +13,7 @@ subroutine Control_Mod_Mass_Flow_Rates(b_x, b_y, b_z, verbose) def = 0.0 - call Control_Mod_Read_Real_Array('MASS_FLOW_RATES', 3, def, & - val, verbose) + call Control % Read_Real_Vector('MASS_FLOW_RATES', 3, def, val, verbose) b_x = val(1) b_y = val(2) diff --git a/Sources/Shared/Control_Mod/Physics/Mass_Transfer.f90 b/Sources/Shared/Control_Mod/Physics/Mass_Transfer.f90 index ccabffc5b..555cf08a5 100644 --- a/Sources/Shared/Control_Mod/Physics/Mass_Transfer.f90 +++ b/Sources/Shared/Control_Mod/Physics/Mass_Transfer.f90 @@ -1,15 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Mass_Transfer(phase_change, verbose) + subroutine Mass_Transfer(Control, phase_change, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: phase_change logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('MASS_TRANSFER', 'no', val, verbose) + call Control % Read_Char_Item('MASS_TRANSFER', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -19,12 +20,10 @@ subroutine Control_Mod_Mass_Transfer(phase_change, verbose) phase_change = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for phase_change: ', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(60, & + 'Unknown state for phase change: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Max_Particles.f90 b/Sources/Shared/Control_Mod/Physics/Max_Particles.f90 index 8652e456e..eccc48773 100644 --- a/Sources/Shared/Control_Mod/Physics/Max_Particles.f90 +++ b/Sources/Shared/Control_Mod/Physics/Max_Particles.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Max_Particles(val, verbose) + subroutine Max_Particles(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('MAX_PARTICLES', 0, & - val, verbose) + call Control % Read_Int_Item('MAX_PARTICLES', 0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Number_Of_Domains.f90 b/Sources/Shared/Control_Mod/Physics/Number_Of_Domains.f90 index 65a08f294..9ed7123ae 100644 --- a/Sources/Shared/Control_Mod/Physics/Number_Of_Domains.f90 +++ b/Sources/Shared/Control_Mod/Physics/Number_Of_Domains.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Number_Of_Domains(val, verbose) + subroutine Number_Of_Domains(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('NUMBER_OF_DOMAINS', 1, & - val, verbose) + call Control % Read_Int_Item('NUMBER_OF_DOMAINS', 1, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Number_Of_Phases.f90 b/Sources/Shared/Control_Mod/Physics/Number_Of_Phases.f90 index bc46a3e05..ee26cfeb3 100644 --- a/Sources/Shared/Control_Mod/Physics/Number_Of_Phases.f90 +++ b/Sources/Shared/Control_Mod/Physics/Number_Of_Phases.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Number_Of_Phases(val, verbose) + subroutine Number_Of_Phases(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('NUMBER_OF_PHASES', 1, & - val, verbose) + call Control % Read_Int_Item('NUMBER_OF_PHASES', 1, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Number_Of_Scalars.f90 b/Sources/Shared/Control_Mod/Physics/Number_Of_Scalars.f90 index 7ac4744c8..7ed78d985 100644 --- a/Sources/Shared/Control_Mod/Physics/Number_Of_Scalars.f90 +++ b/Sources/Shared/Control_Mod/Physics/Number_Of_Scalars.f90 @@ -1,14 +1,15 @@ !==============================================================================! - subroutine Control_Mod_Number_Of_Scalars(val, verbose) + subroutine Number_Of_Scalars(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading stuff related to passive scalars ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('NUMBER_OF_SCALARS', 0, val, verbose) + call Control % Read_Int_Item('NUMBER_OF_SCALARS', 0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Number_Of_Swarm_Sub_Steps.f90 b/Sources/Shared/Control_Mod/Physics/Number_Of_Swarm_Sub_Steps.f90 index 64258b32b..bd20821c2 100644 --- a/Sources/Shared/Control_Mod/Physics/Number_Of_Swarm_Sub_Steps.f90 +++ b/Sources/Shared/Control_Mod/Physics/Number_Of_Swarm_Sub_Steps.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Number_Of_Swarm_Sub_Steps(val, verbose) + subroutine Number_Of_Swarm_Sub_Steps(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('NUMBER_OF_SWARM_SUB_STEPS', 60, & - val, verbose) + call Control % Read_Int_Item('NUMBER_OF_SWARM_SUB_STEPS', 60, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Particle_Tracking.f90 b/Sources/Shared/Control_Mod/Physics/Particle_Tracking.f90 index 3275b87f5..187ff1302 100644 --- a/Sources/Shared/Control_Mod/Physics/Particle_Tracking.f90 +++ b/Sources/Shared/Control_Mod/Physics/Particle_Tracking.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Particle_Tracking(track_part, verbose) + subroutine Particle_Tracking(Control, track_part, verbose) !------------------------------------------------------------------------------! ! Reading if Lagrangian particle tracking will be used in simulations ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: track_part logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('PARTICLE_TRACKING', 'no', val, verbose) + call Control % Read_Char_Item('PARTICLE_TRACKING', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -21,13 +22,10 @@ subroutine Control_Mod_Particle_Tracking(track_part, verbose) track_part = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for track front: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for particle tracking: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Phase_Capacities.f90 b/Sources/Shared/Control_Mod/Physics/Phase_Capacities.f90 index fd5c33534..9cb96a72b 100644 --- a/Sources/Shared/Control_Mod/Physics/Phase_Capacities.f90 +++ b/Sources/Shared/Control_Mod/Physics/Phase_Capacities.f90 @@ -1,18 +1,19 @@ !==============================================================================! - subroutine Control_Mod_Phase_Capacities(val, verbose) + subroutine Phase_Capacities(Control, val, verbose) !------------------------------------------------------------------------------! ! Reads as many capacities as there are phases. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val(0:1) - logical, optional :: verbose + class(Control_Type) :: Control + real :: val(0:1) + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(2) !==============================================================================! def = 1.0 - call Control_Mod_Read_Real_Array('PHASE_CAPACITIES', 2, def, val, verbose) + call Control % Read_Real_Vector('PHASE_CAPACITIES', 2, def, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Phase_Conductivities.f90 b/Sources/Shared/Control_Mod/Physics/Phase_Conductivities.f90 index 071432c95..af5a1a53e 100644 --- a/Sources/Shared/Control_Mod/Physics/Phase_Conductivities.f90 +++ b/Sources/Shared/Control_Mod/Physics/Phase_Conductivities.f90 @@ -1,18 +1,19 @@ !==============================================================================! - subroutine Control_Mod_Phase_Conductivities(val, verbose) + subroutine Phase_Conductivities(Control, val, verbose) !------------------------------------------------------------------------------! ! Reads as many densities as there are phases. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val(0:1) - logical, optional :: verbose + class(Control_Type) :: Control + real :: val(0:1) + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(2) !==============================================================================! def = 1.0 - call Control_Mod_Read_Real_Array('PHASE_CONDUCTIVITIES', 2, def, val, verbose) + call Control % Read_Real_Vector('PHASE_CONDUCTIVITIES', 2, def, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Phase_Densities.f90 b/Sources/Shared/Control_Mod/Physics/Phase_Densities.f90 index 4707f7af8..e86fd7de9 100644 --- a/Sources/Shared/Control_Mod/Physics/Phase_Densities.f90 +++ b/Sources/Shared/Control_Mod/Physics/Phase_Densities.f90 @@ -1,18 +1,19 @@ !==============================================================================! - subroutine Control_Mod_Phase_Densities(val, verbose) + subroutine Phase_Densities(Control, val, verbose) !------------------------------------------------------------------------------! ! Reads as many densities as there are phases. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val(0:1) - logical, optional :: verbose + class(Control_Type) :: Control + real :: val(0:1) + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(2) !==============================================================================! def = 1.0 - call Control_Mod_Read_Real_Array('PHASE_DENSITIES', 2, def, val, verbose) + call Control % Read_Real_Vector('PHASE_DENSITIES', 2, def, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Phase_Viscosities.f90 b/Sources/Shared/Control_Mod/Physics/Phase_Viscosities.f90 index 7bb655ee4..9a71d3bef 100644 --- a/Sources/Shared/Control_Mod/Physics/Phase_Viscosities.f90 +++ b/Sources/Shared/Control_Mod/Physics/Phase_Viscosities.f90 @@ -1,18 +1,19 @@ !==============================================================================! - subroutine Control_Mod_Phase_Viscosities(val, verbose) + subroutine Phase_Viscosities(Control, val, verbose) !------------------------------------------------------------------------------! ! Reads as many viscosities as there are phases. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real :: val(0:1) - logical, optional :: verbose + class(Control_Type) :: Control + real :: val(0:1) + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(2) !==============================================================================! def = 1.0 - call Control_Mod_Read_Real_Array('PHASE_VISCOSITIES', 2, def, val, verbose) + call Control % Read_Real_Vector('PHASE_VISCOSITIES', 2, def, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Point_For_Monitoring_Planes.f90 b/Sources/Shared/Control_Mod/Physics/Point_For_Monitoring_Planes.f90 index 2e3e0265f..eb760d0c6 100644 --- a/Sources/Shared/Control_Mod/Physics/Point_For_Monitoring_Planes.f90 +++ b/Sources/Shared/Control_Mod/Physics/Point_For_Monitoring_Planes.f90 @@ -1,11 +1,11 @@ !==============================================================================! - subroutine Control_Mod_Point_For_Monitoring_Planes(b_xp, b_yp, b_zp, & - verbose) + subroutine Point_For_Monitoring_Planes(Control, b_xp, b_yp, b_zp, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: b_xp, b_yp, b_zp - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: b_xp, b_yp, b_zp + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(3) real :: val(3) @@ -13,8 +13,8 @@ subroutine Control_Mod_Point_For_Monitoring_Planes(b_xp, b_yp, b_zp, & data def / 0.0, 0.0, 0.0 / - call Control_Mod_Read_Real_Array('POINT_FOR_MONITORING_PLANES', 3, def, & - val, verbose) + call Control % Read_Real_Vector('POINT_FOR_MONITORING_PLANES', 3, def, & + val, verbose) b_xp = val(1) b_yp = val(2) b_zp = val(3) diff --git a/Sources/Shared/Control_Mod/Physics/Potential_Initialization.f90 b/Sources/Shared/Control_Mod/Physics/Potential_Initialization.f90 index d3f8d087d..2965c3942 100644 --- a/Sources/Shared/Control_Mod/Physics/Potential_Initialization.f90 +++ b/Sources/Shared/Control_Mod/Physics/Potential_Initialization.f90 @@ -1,18 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Potential_Initialization(pot_init, verbose) + subroutine Potential_Initialization(Control, pot_init, verbose) !------------------------------------------------------------------------------! ! Reading potential initialization from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: pot_init logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('POTENTIAL_INITIALIZATION', 'no', & - val, verbose) + call Control % Read_Char_Item('POTENTIAL_INITIALIZATION', 'no', val, verbose) call String % To_Upper_Case(val) select case(val) @@ -24,12 +24,10 @@ subroutine Control_Mod_Potential_Initialization(pot_init, verbose) pot_init = .false. case default - if(this_proc < 2) then - print *, '# Unknown state for potential initalization:', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(72, & + 'Unknown state for potential initialization: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end select end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Pressure_Drops.f90 b/Sources/Shared/Control_Mod/Physics/Pressure_Drops.f90 index 1798b97e4..c9762deec 100644 --- a/Sources/Shared/Control_Mod/Physics/Pressure_Drops.f90 +++ b/Sources/Shared/Control_Mod/Physics/Pressure_Drops.f90 @@ -1,10 +1,11 @@ !==============================================================================! - subroutine Control_Mod_Pressure_Drops(p_drop_x, p_drop_y, p_drop_z, verbose) + subroutine Pressure_Drops(Control, p_drop_x, p_drop_y, p_drop_z, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: p_drop_x, p_drop_y, p_drop_z - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: p_drop_x, p_drop_y, p_drop_z + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def(3) real :: val(3) @@ -12,8 +13,8 @@ subroutine Control_Mod_Pressure_Drops(p_drop_x, p_drop_y, p_drop_z, verbose) data def / 0.0, 0.0, 0.0 / - call Control_Mod_Read_Real_Array('PRESSURE_DROPS', 3, def, & - val, verbose) + call Control % Read_Real_Vector('PRESSURE_DROPS', 3, def, val, verbose) + p_drop_x = val(1) p_drop_y = val(2) p_drop_z = val(3) diff --git a/Sources/Shared/Control_Mod/Physics/Reference_Density.f90 b/Sources/Shared/Control_Mod/Physics/Reference_Density.f90 index 8a642e8c5..75d5daaf9 100644 --- a/Sources/Shared/Control_Mod/Physics/Reference_Density.f90 +++ b/Sources/Shared/Control_Mod/Physics/Reference_Density.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Reference_Density(d_ref, verbose) + subroutine Reference_Density(Control, d_ref, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: d_ref - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: d_ref + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def !==============================================================================! def = 0.0 - call Control_Mod_Read_Real_Item('REFERENCE_DENSITY', def, d_ref, verbose) + call Control % Read_Real_Item('REFERENCE_DENSITY', def, d_ref, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Reference_Temperature.f90 b/Sources/Shared/Control_Mod/Physics/Reference_Temperature.f90 index 3b89ab02d..b535e2326 100644 --- a/Sources/Shared/Control_Mod/Physics/Reference_Temperature.f90 +++ b/Sources/Shared/Control_Mod/Physics/Reference_Temperature.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Reference_Temperature(t_ref, verbose) + subroutine Reference_Temperature(Control, t_ref, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: t_ref - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: t_ref + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def !==============================================================================! def = 0.0 - call Control_Mod_Read_Real_Item('REFERENCE_TEMPERATURE', def, t_ref, verbose) + call Control % Read_Real_Item('REFERENCE_TEMPERATURE', def, t_ref, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Rough_Walls.f90 b/Sources/Shared/Control_Mod/Physics/Rough_Walls.f90 index b2f6b15ab..045530d0d 100644 --- a/Sources/Shared/Control_Mod/Physics/Rough_Walls.f90 +++ b/Sources/Shared/Control_Mod/Physics/Rough_Walls.f90 @@ -1,35 +1,33 @@ !==============================================================================! - subroutine Control_Mod_Rough_Walls(rough_walls, verbose) + subroutine Rough_Walls(Control, rough, verbose) !------------------------------------------------------------------------------! ! Reading wall roughness from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical, intent(out) :: rough_walls + class(Control_Type) :: Control + logical, intent(out) :: rough logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('ROUGH_WALLS', 'no', & - val, verbose) + call Control % Read_Char_Item('ROUGH_WALLS', 'no', val, verbose) call String % To_Upper_Case(val) select case(val) case('YES') - rough_walls = .true. + rough = .true. case('NO') - rough_walls = .false. + rough = .false. case default - if(this_proc < 2) then - print *, '# Unknown wall roughness state :', trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(60, & + 'Unknown wall roughness state: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end select end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Roughness_Coefficient.f90 b/Sources/Shared/Control_Mod/Physics/Roughness_Coefficient.f90 index 20b54bd9b..0ce1670cb 100644 --- a/Sources/Shared/Control_Mod/Physics/Roughness_Coefficient.f90 +++ b/Sources/Shared/Control_Mod/Physics/Roughness_Coefficient.f90 @@ -1,16 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Roughness_Coefficient(val, verbose) + subroutine Roughness_Coefficient(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val(:) - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val(:) + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: con !==============================================================================! - call Control_Mod_Read_Real_Item('ROUGHNESS_COEFFICIENT', 0.0, & - con, verbose) + call Control % Read_Real_Item('ROUGHNESS_COEFFICIENT', 0.0, con, verbose) ! Set the same value everywhere val(:) = con diff --git a/Sources/Shared/Control_Mod/Physics/Saturation_Temperature.f90 b/Sources/Shared/Control_Mod/Physics/Saturation_Temperature.f90 index f853c024b..076fd3eac 100644 --- a/Sources/Shared/Control_Mod/Physics/Saturation_Temperature.f90 +++ b/Sources/Shared/Control_Mod/Physics/Saturation_Temperature.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Saturation_Temperature(val, verbose) + subroutine Saturation_Temperature(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SATURATION_TEMPERATURE', 100., val, verbose) + call Control % Read_Real_Item('SATURATION_TEMPERATURE', 100., val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Scalars_Diffusivity.f90 b/Sources/Shared/Control_Mod/Physics/Scalars_Diffusivity.f90 index 0df35d0f5..ce0886f90 100644 --- a/Sources/Shared/Control_Mod/Physics/Scalars_Diffusivity.f90 +++ b/Sources/Shared/Control_Mod/Physics/Scalars_Diffusivity.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Scalars_Diffusivity(val, verbose) + subroutine Scalars_Diffusivity(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SCALARS_DIFFUSIVITY', 1.0e-6, val, verbose) + call Control % Read_Real_Item('SCALARS_DIFFUSIVITY', 1.0e-6, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Smagorinsky_Constant.f90 b/Sources/Shared/Control_Mod/Physics/Smagorinsky_Constant.f90 index d681b3091..8b4e602a5 100644 --- a/Sources/Shared/Control_Mod/Physics/Smagorinsky_Constant.f90 +++ b/Sources/Shared/Control_Mod/Physics/Smagorinsky_Constant.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Smagorinsky_Constant(val, verbose) + subroutine Smagorinsky_Constant(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SMAGORINSKY_CONSTANT', 0.17, & - val, verbose) + call Control % Read_Real_Item('SMAGORINSKY_CONSTANT', 0.17, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Computation.f90 b/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Computation.f90 index 7d9e74a75..36be57d3a 100644 --- a/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Computation.f90 +++ b/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Computation.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Starting_Time_Step_For_Swarm_Computation(val, verbose) + subroutine Starting_Time_Step_For_Swarm_Computation(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('STARTING_TIME_STEP_FOR_SWARM_COMPUTATION', & - 1200, val, verbose) + call Control % Read_Int_Item('STARTING_TIME_STEP_FOR_SWARM_COMPUTATION', & + 1200, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Statistics.f90 b/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Statistics.f90 index 95eea64b6..ca3ba5e14 100644 --- a/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Statistics.f90 +++ b/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Swarm_Statistics.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Starting_Time_Step_For_Swarm_Statistics(val, verbose) + subroutine Starting_Time_Step_For_Swarm_Statistics(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('STARTING_TIME_STEP_FOR_SWARM_STATISTICS', & - HUGE_INT, val, verbose) + call Control % Read_Int_Item('STARTING_TIME_STEP_FOR_SWARM_STATISTICS', & + HUGE_INT, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Turb_Statistics.f90 b/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Turb_Statistics.f90 index 0333b529b..92b4c8842 100644 --- a/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Turb_Statistics.f90 +++ b/Sources/Shared/Control_Mod/Physics/Starting_Time_Step_For_Turb_Statistics.f90 @@ -1,13 +1,14 @@ !==============================================================================! - subroutine Control_Mod_Starting_Time_Step_For_Turb_Statistics(val, verbose) + subroutine Starting_Time_Step_For_Turb_Statistics(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control integer, intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Int_Item('STARTING_TIME_STEP_FOR_TURB_STATISTICS', & - HUGE_INT, val, verbose) + call Control % Read_Int_Item('STARTING_TIME_STEP_FOR_TURB_STATISTICS', & + HUGE_INT, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Surface_Tension.f90 b/Sources/Shared/Control_Mod/Physics/Surface_Tension.f90 index aebfc8022..edc467a89 100644 --- a/Sources/Shared/Control_Mod/Physics/Surface_Tension.f90 +++ b/Sources/Shared/Control_Mod/Physics/Surface_Tension.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Surface_Tension(val, verbose) + subroutine Surface_Tension(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('SURFACE_TENSION', 0.0, val, verbose) + call Control % Read_Real_Item('SURFACE_TENSION', 0.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Swarm_Coefficient_Of_Restitution.f90 b/Sources/Shared/Control_Mod/Physics/Swarm_Coefficient_Of_Restitution.f90 index 4ec1caaeb..37e5bff09 100644 --- a/Sources/Shared/Control_Mod/Physics/Swarm_Coefficient_Of_Restitution.f90 +++ b/Sources/Shared/Control_Mod/Physics/Swarm_Coefficient_Of_Restitution.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Swarm_Coefficient_Of_Restitution(cor, verbose) + subroutine Swarm_Coefficient_Of_Restitution(Control, cor, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: cor - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: cor + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def !==============================================================================! def = 1.0 - call Control_Mod_Read_Real_Item('SWARM_COEFFICIENT_OF_RESTITUTION', & - def, cor, verbose) + call Control % Read_Real_Item('SWARM_COEFFICIENT_OF_RESTITUTION', & + def, cor, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Swarm_Density.f90 b/Sources/Shared/Control_Mod/Physics/Swarm_Density.f90 index 6ec9b83d6..d052a6373 100644 --- a/Sources/Shared/Control_Mod/Physics/Swarm_Density.f90 +++ b/Sources/Shared/Control_Mod/Physics/Swarm_Density.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Swarm_Density(s_den, verbose) + subroutine Swarm_Density(Control, s_den, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: s_den - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: s_den + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def !==============================================================================! def = 1000.0 - call Control_Mod_Read_Real_Item('SWARM_DENSITY', def, s_den, verbose) + call Control % Read_Real_Item('SWARM_DENSITY', def, s_den, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Swarm_Diameter.f90 b/Sources/Shared/Control_Mod/Physics/Swarm_Diameter.f90 index d52b2ba31..6ceeedd33 100644 --- a/Sources/Shared/Control_Mod/Physics/Swarm_Diameter.f90 +++ b/Sources/Shared/Control_Mod/Physics/Swarm_Diameter.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Swarm_Diameter(s_dia, verbose) + subroutine Swarm_Diameter(Control, s_dia, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: s_dia - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: s_dia + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def !==============================================================================! def = 2.5e-5 - call Control_Mod_Read_Real_Item('SWARM_DIAMETER', def, s_dia, verbose) + call Control % Read_Real_Item('SWARM_DIAMETER', def, s_dia, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Swarm_Subgrid_Scale_Model.f90 b/Sources/Shared/Control_Mod/Physics/Swarm_Subgrid_Scale_Model.f90 index 225baa5d8..10669a713 100644 --- a/Sources/Shared/Control_Mod/Physics/Swarm_Subgrid_Scale_Model.f90 +++ b/Sources/Shared/Control_Mod/Physics/Swarm_Subgrid_Scale_Model.f90 @@ -1,15 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Swarm_Subgrid_Scale_Model(val, verbose) + subroutine Swarm_Subgrid_Scale_Model(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading swarm SGS model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('SWARM_SUBGRID_SCALE_MODEL', & - 'none', val, verbose) + call Control % Read_Char_Item('SWARM_SUBGRID_SCALE_MODEL', & + 'none', val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Thermal_Conductivity.f90 b/Sources/Shared/Control_Mod/Physics/Thermal_Conductivity.f90 index bc36831c8..bc22e6e94 100644 --- a/Sources/Shared/Control_Mod/Physics/Thermal_Conductivity.f90 +++ b/Sources/Shared/Control_Mod/Physics/Thermal_Conductivity.f90 @@ -1,12 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Thermal_Conductivity(val, verbose) + subroutine Thermal_Conductivity(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('THERMAL_CONDUCTIVITY', 1.0, val, verbose) + call Control % Read_Real_Item('THERMAL_CONDUCTIVITY', 1.0, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Track_Front.f90 b/Sources/Shared/Control_Mod/Physics/Track_Front.f90 index f8ce4c56f..f08b4318d 100644 --- a/Sources/Shared/Control_Mod/Physics/Track_Front.f90 +++ b/Sources/Shared/Control_Mod/Physics/Track_Front.f90 @@ -1,31 +1,29 @@ !==============================================================================! - subroutine Control_Mod_Track_Front(track_front, verbose) + subroutine Track_Front(Control, track, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - logical, intent(out) :: track_front + class(Control_Type) :: Control + logical, intent(out) :: track logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('TRACK_FRONT', 'no', val, verbose) + call Control % Read_Char_Item('TRACK_FRONT', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then - track_front = .true. + track = .true. else if( val .eq. 'NO' ) then - track_front = .false. + track = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for track front: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(60, & + 'Unknown state for track front: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Track_Surface.f90 b/Sources/Shared/Control_Mod/Physics/Track_Surface.f90 index 4096815da..f9389bd05 100644 --- a/Sources/Shared/Control_Mod/Physics/Track_Surface.f90 +++ b/Sources/Shared/Control_Mod/Physics/Track_Surface.f90 @@ -1,15 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Track_Surface(track_surf, verbose) + subroutine Track_Surface(Control, track_surf, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control logical, intent(out) :: track_surf logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! character(SL) :: val !==============================================================================! - call Control_Mod_Read_Char_Item('TRACK_SURFACE', 'no', val, verbose) + call Control % Read_Char_Item('TRACK_SURFACE', 'no', val, verbose) call String % To_Upper_Case(val) if( val .eq. 'YES' ) then @@ -19,13 +20,10 @@ subroutine Control_Mod_Track_Surface(track_surf, verbose) track_surf = .false. else - if(this_proc < 2) then - print *, '# ERROR! Unknown state for track front: ', & - trim(val) - print *, '# Exiting!' - end if - call Comm_Mod_End - + call Message % Error(60, & + 'Unknown state for track surface: '//trim(val)// & + '. \n This error is critical. Exiting.', & + file=__FILE__, line=__LINE__, one_proc=.true.) end if end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Turbulence_Model.f90 b/Sources/Shared/Control_Mod/Physics/Turbulence_Model.f90 index b43853def..3bef6637b 100644 --- a/Sources/Shared/Control_Mod/Physics/Turbulence_Model.f90 +++ b/Sources/Shared/Control_Mod/Physics/Turbulence_Model.f90 @@ -1,16 +1,16 @@ !==============================================================================! - subroutine Control_Mod_Turbulence_Model(val, verbose) + subroutine Turbulence_Model(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading turbulence model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('TURBULENCE_MODEL', 'none', & - val, verbose) + call Control % Read_Char_Item('TURBULENCE_MODEL', 'none', val, verbose) call String % To_Upper_Case(val) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Turbulence_Model_Variant.f90 b/Sources/Shared/Control_Mod/Physics/Turbulence_Model_Variant.f90 index d6191f7d0..da516a4f0 100644 --- a/Sources/Shared/Control_Mod/Physics/Turbulence_Model_Variant.f90 +++ b/Sources/Shared/Control_Mod/Physics/Turbulence_Model_Variant.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Turbulence_Model_Variant(val, verbose) + subroutine Turbulence_Model_Variant(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading turbulence model variant from the control file ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('TURBULENCE_MODEL_VARIANT', 'stabilized', & - val, verbose) + call Control % Read_Char_Item('TURBULENCE_MODEL_VARIANT', 'stabilized', & + val, verbose) call String % To_Upper_Case(val) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Turbulent_Heat_Flux_Model.f90 b/Sources/Shared/Control_Mod/Physics/Turbulent_Heat_Flux_Model.f90 index c3f21fb2c..cd2498f8b 100644 --- a/Sources/Shared/Control_Mod/Physics/Turbulent_Heat_Flux_Model.f90 +++ b/Sources/Shared/Control_Mod/Physics/Turbulent_Heat_Flux_Model.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Turbulent_Heat_Flux_Model(val, verbose) + subroutine Turbulent_Heat_Flux_Model(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading turbulent heat flux model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('TURBULENT_HEAT_FLUX_MODEL', 'SGDH', & - val, verbose) + call Control % Read_Char_Item('TURBULENT_HEAT_FLUX_MODEL', 'SGDH', & + val, verbose) call String % To_Upper_Case(val) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Turbulent_Prandtl_Number.f90 b/Sources/Shared/Control_Mod/Physics/Turbulent_Prandtl_Number.f90 index 98b8c8eda..5ad5cd108 100644 --- a/Sources/Shared/Control_Mod/Physics/Turbulent_Prandtl_Number.f90 +++ b/Sources/Shared/Control_Mod/Physics/Turbulent_Prandtl_Number.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Turbulent_Prandtl_Number(val, verbose) + subroutine Turbulent_Prandtl_Number(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TURBULENT_PRANDTL_NUMBER', 0.9, & - val, verbose) + call Control % Read_Real_Item('TURBULENT_PRANDTL_NUMBER', 0.9, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Turbulent_Scalar_Flux_Model.f90 b/Sources/Shared/Control_Mod/Physics/Turbulent_Scalar_Flux_Model.f90 index 3b19a5acb..18e5eef78 100644 --- a/Sources/Shared/Control_Mod/Physics/Turbulent_Scalar_Flux_Model.f90 +++ b/Sources/Shared/Control_Mod/Physics/Turbulent_Scalar_Flux_Model.f90 @@ -1,16 +1,17 @@ !==============================================================================! - subroutine Control_Mod_Turbulent_Scalar_Flux_Model(val, verbose) + subroutine Turbulent_Scalar_Flux_Model(Control, val, verbose) !------------------------------------------------------------------------------! ! Reading turbulent heat flux model from the control file. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! + class(Control_Type) :: Control character(SL), intent(out) :: val logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Char_Item('TURBULENT_SCALAR_FLUX_MODEL', 'SGDH', & - val, verbose) + call Control % Read_Char_Item('TURBULENT_SCALAR_FLUX_MODEL', 'SGDH', & + val, verbose) call String % To_Upper_Case(val) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Turbulent_Schmidt_Number.f90 b/Sources/Shared/Control_Mod/Physics/Turbulent_Schmidt_Number.f90 index c02c2659b..54576bc28 100644 --- a/Sources/Shared/Control_Mod/Physics/Turbulent_Schmidt_Number.f90 +++ b/Sources/Shared/Control_Mod/Physics/Turbulent_Schmidt_Number.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Control_Mod_Turbulent_Schmidt_Number(val, verbose) + subroutine Turbulent_Schmidt_Number(Control, val, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: val - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: val + logical, optional :: verbose !==============================================================================! - call Control_Mod_Read_Real_Item('TURBULENT_SCHMIDT_NUMBER', 0.9, & - val, verbose) + call Control % Read_Real_Item('TURBULENT_SCHMIDT_NUMBER', 0.9, val, verbose) end subroutine diff --git a/Sources/Shared/Control_Mod/Physics/Volume_Expansion_Coefficient.f90 b/Sources/Shared/Control_Mod/Physics/Volume_Expansion_Coefficient.f90 index bd9c02809..7052ff6bb 100644 --- a/Sources/Shared/Control_Mod/Physics/Volume_Expansion_Coefficient.f90 +++ b/Sources/Shared/Control_Mod/Physics/Volume_Expansion_Coefficient.f90 @@ -1,17 +1,18 @@ !==============================================================================! - subroutine Control_Mod_Volume_Expansion_Coefficient(cor, verbose) + subroutine Volume_Expansion_Coefficient(Control, cor, verbose) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - real, intent(out) :: cor - logical, optional :: verbose + class(Control_Type) :: Control + real, intent(out) :: cor + logical, optional :: verbose !-----------------------------------[Locals]-----------------------------------! real :: def !==============================================================================! def = 1.0 - call Control_Mod_Read_Real_Item('VOLUME_EXPANSION_COEFFICIENT', & - def, cor, verbose) + call Control % Read_Real_Item('VOLUME_EXPANSION_COEFFICIENT', & + def, cor, verbose) end subroutine diff --git a/Sources/Shared/File_Mod.f90 b/Sources/Shared/File_Mod.f90 index 56c3887f2..cac4cffba 100644 --- a/Sources/Shared/File_Mod.f90 +++ b/Sources/Shared/File_Mod.f90 @@ -1,3 +1,6 @@ +#include "../Shared/Assert.h90" +#include "../Shared/Unused.h90" + !==============================================================================! module File_Mod !------------------------------------------------------------------------------! @@ -38,8 +41,10 @@ module File_Mod end type - type(Tokenizer_Type) :: Line - type(File_Type) :: File + !---------------------------! + ! Singleton object File ! + !---------------------------! + type(File_Type) :: File integer(SP) :: int4_array(MAX_ITEMS) integer(DP) :: int8_array(MAX_ITEMS) diff --git a/Sources/Shared/File_Mod/Append_For_Writing_Ascii.f90 b/Sources/Shared/File_Mod/Append_For_Writing_Ascii.f90 index aa9439882..2bc461340 100644 --- a/Sources/Shared/File_Mod/Append_For_Writing_Ascii.f90 +++ b/Sources/Shared/File_Mod/Append_For_Writing_Ascii.f90 @@ -12,6 +12,8 @@ subroutine Append_For_Writing_Ascii(File, name_o, file_unit, processor) !-----------------------------------[Locals]-----------------------------------! logical :: file_exists ! file exists? logical, save :: first_call = .true. ! first call? +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! inquire(file = trim(name_o), exist = file_exists) diff --git a/Sources/Shared/File_Mod/Delete.f90 b/Sources/Shared/File_Mod/Delete.f90 index c8e33dcef..e32440925 100644 --- a/Sources/Shared/File_Mod/Delete.f90 +++ b/Sources/Shared/File_Mod/Delete.f90 @@ -10,6 +10,8 @@ subroutine Delete(File, name_d) class(File_Type) :: File integer :: file_unit logical :: file_exists +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! ! First check if the file exists diff --git a/Sources/Shared/File_Mod/Is_In_Unix_Format.f90 b/Sources/Shared/File_Mod/Is_In_Unix_Format.f90 index aaff538a9..6c9c0bcb0 100644 --- a/Sources/Shared/File_Mod/Is_In_Unix_Format.f90 +++ b/Sources/Shared/File_Mod/Is_In_Unix_Format.f90 @@ -8,8 +8,8 @@ logical function Is_In_Unix_Format(File, file_name) class(File_Type) :: File character(len=*) :: file_name !-----------------------------------[Locals]-----------------------------------! - integer :: file_size, file_unit, i - integer(1) :: byte, next, cnt_13_10 + integer :: file_size, file_unit, cnt_13_10, i + integer(1) :: byte, next !==============================================================================! inquire(file=file_name, size=file_size) diff --git a/Sources/Shared/File_Mod/Line_Length.f90 b/Sources/Shared/File_Mod/Line_Length.f90 index cdcc5dc6d..a461dad09 100644 --- a/Sources/Shared/File_Mod/Line_Length.f90 +++ b/Sources/Shared/File_Mod/Line_Length.f90 @@ -10,6 +10,8 @@ integer function Line_Length(File, file_unit) !-----------------------------------[Locals]-----------------------------------! integer :: length integer(1) :: byte +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! length = 0 diff --git a/Sources/Shared/File_Mod/Open_For_Reading_Ascii.f90 b/Sources/Shared/File_Mod/Open_For_Reading_Ascii.f90 index f92105f82..92c3bdb20 100644 --- a/Sources/Shared/File_Mod/Open_For_Reading_Ascii.f90 +++ b/Sources/Shared/File_Mod/Open_For_Reading_Ascii.f90 @@ -11,6 +11,8 @@ subroutine Open_For_Reading_Ascii(File, name_i, file_unit, processor) integer, optional :: processor !-----------------------------------[Locals]-----------------------------------! logical :: file_exists +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! ! First check if the file exists diff --git a/Sources/Shared/File_Mod/Open_For_Reading_Binary.f90 b/Sources/Shared/File_Mod/Open_For_Reading_Binary.f90 index c1b54315a..84cd1a53f 100644 --- a/Sources/Shared/File_Mod/Open_For_Reading_Binary.f90 +++ b/Sources/Shared/File_Mod/Open_For_Reading_Binary.f90 @@ -14,6 +14,8 @@ subroutine Open_For_Reading_Binary(File, name_i, file_unit, & !-----------------------------------[Locals]-----------------------------------! logical :: file_exists logical :: verb = .true. +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! if(present(verbose)) verb = verbose diff --git a/Sources/Shared/File_Mod/Open_For_Writing_Ascii.f90 b/Sources/Shared/File_Mod/Open_For_Writing_Ascii.f90 index 9d15ce930..a8b2e6a28 100644 --- a/Sources/Shared/File_Mod/Open_For_Writing_Ascii.f90 +++ b/Sources/Shared/File_Mod/Open_For_Writing_Ascii.f90 @@ -9,6 +9,8 @@ subroutine Open_For_Writing_Ascii(File, name_o, file_unit, processor) character(len=*) :: name_o integer :: file_unit integer, optional :: processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! open(newunit = file_unit, file = trim(name_o), status = 'replace') diff --git a/Sources/Shared/File_Mod/Open_For_Writing_Binary.f90 b/Sources/Shared/File_Mod/Open_For_Writing_Binary.f90 index 461344449..dd3b33781 100644 --- a/Sources/Shared/File_Mod/Open_For_Writing_Binary.f90 +++ b/Sources/Shared/File_Mod/Open_For_Writing_Binary.f90 @@ -9,6 +9,8 @@ subroutine Open_For_Writing_Binary(File, name_o, file_unit, processor) character(len=*) :: name_o integer :: file_unit integer, optional :: processor +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! open(newunit = file_unit, & diff --git a/Sources/Shared/File_Mod/Read_Binary_Int4_Array.f90 b/Sources/Shared/File_Mod/Read_Binary_Int4_Array.f90 index ef928131f..1974e43ee 100644 --- a/Sources/Shared/File_Mod/Read_Binary_Int4_Array.f90 +++ b/Sources/Shared/File_Mod/Read_Binary_Int4_Array.f90 @@ -11,6 +11,8 @@ subroutine Read_Binary_Int4_Array(File, un, n, reached_end) logical, optional :: reached_end !-----------------------------------[Locals]-----------------------------------! integer :: i +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! ! If present, assumed the end of file has not been reached diff --git a/Sources/Shared/File_Mod/Read_Binary_Int8_Array.f90 b/Sources/Shared/File_Mod/Read_Binary_Int8_Array.f90 index 2c14915fc..743c7b4e2 100644 --- a/Sources/Shared/File_Mod/Read_Binary_Int8_Array.f90 +++ b/Sources/Shared/File_Mod/Read_Binary_Int8_Array.f90 @@ -11,6 +11,8 @@ subroutine Read_Binary_Int8_Array(File, un, n, reached_end) logical, optional :: reached_end !-----------------------------------[Locals]-----------------------------------! integer :: i +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! ! If present, assumed the end of file has not been reached diff --git a/Sources/Shared/File_Mod/Read_Binary_Real4_Array.f90 b/Sources/Shared/File_Mod/Read_Binary_Real4_Array.f90 index 7eab59b2c..8d85aa4fd 100644 --- a/Sources/Shared/File_Mod/Read_Binary_Real4_Array.f90 +++ b/Sources/Shared/File_Mod/Read_Binary_Real4_Array.f90 @@ -11,6 +11,8 @@ subroutine Read_Binary_Real4_Array(File, un, n, reached_end) logical, optional :: reached_end !-----------------------------------[Locals]-----------------------------------! integer :: i +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! ! If present, assumed the end of file has not been reached diff --git a/Sources/Shared/File_Mod/Read_Binary_Real8_Array.f90 b/Sources/Shared/File_Mod/Read_Binary_Real8_Array.f90 index f35046500..c89cbe681 100644 --- a/Sources/Shared/File_Mod/Read_Binary_Real8_Array.f90 +++ b/Sources/Shared/File_Mod/Read_Binary_Real8_Array.f90 @@ -11,6 +11,8 @@ subroutine Read_Binary_Real8_Array(File, un, n, reached_end) logical, optional :: reached_end !-----------------------------------[Locals]-----------------------------------! integer :: i +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! ! If present, assumed the end of file has not been reached diff --git a/Sources/Shared/File_Mod/Read_Line.f90 b/Sources/Shared/File_Mod/Read_Line.f90 index 2eaaa0a76..5c9b38d42 100644 --- a/Sources/Shared/File_Mod/Read_Line.f90 +++ b/Sources/Shared/File_Mod/Read_Line.f90 @@ -3,6 +3,9 @@ subroutine Read_Line(File, un, reached_end, remove) !------------------------------------------------------------------------------! ! Reads a Line from a file unit un and discards if it is comment. ! ! In addition, it breaks the line in tokens (individual strings). ! +! ! +! A comment is each line which begins with "!", "#" or "%". ! +! Input line must not exceed len(Line % whole) characters in length ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -15,10 +18,9 @@ subroutine Read_Line(File, un, reached_end, remove) integer(1) :: byte character(7) :: format = '(a0000)' character(SL) :: fmtd +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! -! A comment is each line which begins with "!", "#" or "%". ! -! Input line must not exceed MAX_TOKENS*2 characters in length ! -!------------------------------------------------------------------------------! ! If present, assumed the end of file has not been reached if(present(reached_end)) then @@ -34,11 +36,11 @@ subroutine Read_Line(File, un, reached_end, remove) inquire(unit=un, formatted=fmtd) 1 continue if(fmtd .eq. 'YES') then - write(format(3:6), '(i4.4)') MAX_TOKENS*2 + write(format(3:6), '(i4.4)') len(Line % whole) read(un, format, end=2) Line % whole else Line % whole = '' - do i = 1, MAX_TOKENS*2 + do i = 1, len(Line % whole) read(un, end=2) byte if(byte .eq. 10) exit if(byte .ne. 13) Line % whole(i:i) = char(byte) diff --git a/Sources/Shared/File_Mod/Set_Name.f90 b/Sources/Shared/File_Mod/Set_Name.f90 index 412608bc4..000cdc3cd 100644 --- a/Sources/Shared/File_Mod/Set_Name.f90 +++ b/Sources/Shared/File_Mod/Set_Name.f90 @@ -22,6 +22,8 @@ subroutine Set_Name(File, & integer :: last_pos integer :: ldir, lnam, lext, lapp character(SL) :: rel_path, sys_comm +!------------------------[Avoid unused parent warning]-------------------------! + Unused(File) !==============================================================================! !-------------------------------------------! @@ -44,6 +46,8 @@ subroutine Set_Name(File, & ! Handle problems with multiple domains ! !-------------------------------------------! if(present(domain)) then + Assert(domain >= 1) + Assert(domain <= MD) lnam = len_trim(problem_name(domain)) if(last_pos > 0) then name_out(last_pos+1:last_pos+lnam) = problem_name(domain)(1:lnam) diff --git a/Sources/Shared/Grid_Mod.f90 b/Sources/Shared/Grid_Mod.f90 index 419e17fdf..73605276d 100644 --- a/Sources/Shared/Grid_Mod.f90 +++ b/Sources/Shared/Grid_Mod.f90 @@ -1,4 +1,5 @@ #include "../Shared/Assert.h90" +#include "../Shared/Browse.h90" !==============================================================================! module Grid_Mod @@ -7,10 +8,10 @@ module Grid_Mod ! (that means in "Generate", "Divide", "Convert", "Process". ! !------------------------------------------------------------------------------! !----------------------------------[Modules]-----------------------------------! - use Assert_Mod + use Vect_Mod use Profiler_Mod use File_Mod - use Boundary_Mod + use Region_Mod use Vtk_Mod use Metis_Mod use Sort_Mod @@ -34,13 +35,20 @@ module Grid_Mod logical :: polyhedral = .false. ! Number of ... - integer :: n_nodes = 0 ! ... nodes - integer :: n_cells = 0 ! ... cells - integer :: n_faces = 0 ! ... faces - integer :: n_bnd_cells = 0 ! ... boundary cells - integer :: n_bnd_cond = 0 ! ... boundary conditions - integer :: n_shadows = 0 ! ... shadow faces - integer :: n_edges = 0 ! ... edges (needed to create dual grid) + integer :: n_nodes = 0 ! nodes + integer :: n_cells = 0 ! cells + integer :: n_faces = 0 ! faces + integer :: n_bnd_cells = 0 ! boundary cells + integer :: n_bnd_regions = 0 ! boundary conditions + integer :: n_regions = 0 ! all conditions (bnd, inside, per ...) + integer :: n_shadows = 0 ! shadow faces + integer :: n_edges = 0 ! edges (needed to create dual grid) + integer :: per_x_reg = 0 ! periodic x region + integer :: per_y_reg = 0 ! periodic y region + integer :: per_z_reg = 0 ! periodic z region + + ! Rank (in case of simulations with multiple domains) + integer :: rank = 0 ! Periodic span real :: per_x, per_y, per_z @@ -92,7 +100,7 @@ module Grid_Mod integer, allocatable :: cells_bnd_face(:) ! For each cell; type of the boundary condition in a given direction - integer, allocatable :: cells_bnd_color(:,:) + integer, allocatable :: cells_bnd_region(:,:) !-------------------------! ! Face-based variables ! @@ -132,7 +140,7 @@ module Grid_Mod ! Node coordinates real, allocatable :: xn(:), yn(:), zn(:) - type(Boundary_Type) :: bnd_cond + type(Region_Type) :: region ! Maximum number of cells, boundary cells and faces ! (Used for tentative memory allocation in Generator) @@ -164,23 +172,24 @@ module Grid_Mod integer, allocatable :: edges_bc(:,:) ! edges' boundary conditions integer, allocatable :: edges_fb(:,:) ! edges' faces on boundaries - !------------------------------------------! - ! Communication class for parallel run ! - !------------------------------------------! + !-------------------------------------------! + ! Communication class for parallel runs ! + !-------------------------------------------! type(Comm_Type) :: Comm - ! User arrays. I am neither sure if this is the ... - ! ... best place for them nor do I need them at all? - integer :: n_user_arrays - real, allocatable :: user_array(:,:) + !-------------------------------------------! + ! Vectorization class for manycore runs ! + !-------------------------------------------! + type(Vect_Type) :: Vect contains procedure :: Allocate_Cells procedure :: Allocate_Faces procedure :: Allocate_Nodes - procedure :: Bnd_Cond_Name + procedure :: Allocate_Regions + procedure :: Bnd_Cond_Name_At_Cell + procedure :: Bnd_Cond_Name_At_Face procedure :: Bnd_Cond_Type - procedure :: Bnd_Cond_Ranges procedure :: Bounding_Box procedure :: Calculate_Cell_Centers procedure :: Calculate_Cell_Inertia @@ -196,6 +205,8 @@ module Grid_Mod procedure :: Check_Cells_Closure procedure :: Correct_Face_Surfaces procedure :: Decompose + procedure :: Determine_Regions_Ranges + procedure :: Determine_Threads procedure :: Exchange_Cells_Int procedure :: Exchange_Cells_Log procedure :: Exchange_Cells_Real @@ -204,25 +215,28 @@ module Grid_Mod procedure :: Find_Cells_Faces procedure :: Find_Nodes_Cells procedure :: Form_Cells_Comm - procedure :: Form_Maps + procedure :: Form_Maps_For_Backup procedure :: Initialize_New_Numbers procedure :: Is_Face_In_Cell procedure :: Is_Point_In_Cell + procedure :: Load_And_Prepare_For_Processing procedure :: Load_Cfn procedure :: Load_Dim procedure :: Merge_Duplicate_Nodes - procedure :: Print_Bnd_Cond_List + procedure :: Print_Regions_List procedure :: Print_Grid_Statistics procedure :: Save_Cfn procedure :: Save_Dim procedure :: Save_Debug_Vtu + procedure :: Save_Vtk_Cell + procedure :: Save_Vtk_Face procedure :: Save_Vtu_Cells procedure :: Save_Vtu_Edges procedure :: Save_Vtu_Faces - procedure :: Sort_Cells_By_Index - procedure :: Sort_Cells_Smart + procedure :: Sort_Cells_By_Thread + procedure :: Sort_Cells_By_Coordinates procedure :: Sort_Faces_By_Index - procedure :: Sort_Faces_Smart + procedure :: Sort_Faces_By_Region procedure :: Write_Template_Control_File end type @@ -232,9 +246,10 @@ module Grid_Mod # include "Grid_Mod/Allocate_Cells.f90" # include "Grid_Mod/Allocate_Faces.f90" # include "Grid_Mod/Allocate_Nodes.f90" -# include "Grid_Mod/Bnd_Cond_Name.f90" +# include "Grid_Mod/Allocate_Regions.f90" +# include "Grid_Mod/Bnd_Cond_Name_At_Cell.f90" +# include "Grid_Mod/Bnd_Cond_Name_At_Face.f90" # include "Grid_Mod/Bnd_Cond_Type.f90" -# include "Grid_Mod/Bnd_Cond_Ranges.f90" # include "Grid_Mod/Bounding_Box.f90" # include "Grid_Mod/Calculate_Cell_Centers.f90" # include "Grid_Mod/Calculate_Cell_Inertia.f90" @@ -251,6 +266,8 @@ module Grid_Mod # include "Grid_Mod/Correct_Face_Surfaces.f90" # include "Grid_Mod/Check_Cells_Closure.f90" # include "Grid_Mod/Decompose.f90" +# include "Grid_Mod/Determine_Regions_Ranges.f90" +# include "Grid_Mod/Determine_Threads.f90" # include "Grid_Mod/Exchange_Cells_Int.f90" # include "Grid_Mod/Exchange_Cells_Log.f90" # include "Grid_Mod/Exchange_Cells_Real.f90" @@ -258,25 +275,28 @@ module Grid_Mod # include "Grid_Mod/Find_Cells_Faces.f90" # include "Grid_Mod/Find_Nodes_Cells.f90" # include "Grid_Mod/Form_Cells_Comm.f90" -# include "Grid_Mod/Form_Maps.f90" +# include "Grid_Mod/Form_Maps_For_Backup.f90" # include "Grid_Mod/Initialize_New_Numbers.f90" # include "Grid_Mod/Is_Face_In_Cell.f90" # include "Grid_Mod/Is_Point_In_Cell.f90" +# include "Grid_Mod/Load_And_Prepare_For_Processing.f90" # include "Grid_Mod/Load_Cfn.f90" # include "Grid_Mod/Load_Dim.f90" # include "Grid_Mod/Merge_Duplicate_Nodes.f90" -# include "Grid_Mod/Print_Bnd_Cond_List.f90" +# include "Grid_Mod/Print_Regions_List.f90" # include "Grid_Mod/Print_Grid_Statistics.f90" # include "Grid_Mod/Save_Cfn.f90" # include "Grid_Mod/Save_Dim.f90" # include "Grid_Mod/Save_Debug_Vtu.f90" +# include "Grid_Mod/Save_Vtk_Cell.f90" +# include "Grid_Mod/Save_Vtk_Face.f90" # include "Grid_Mod/Save_Vtu_Cells.f90" # include "Grid_Mod/Save_Vtu_Edges.f90" # include "Grid_Mod/Save_Vtu_Faces.f90" -# include "Grid_Mod/Sort_Cells_By_Index.f90" -# include "Grid_Mod/Sort_Cells_Smart.f90" +# include "Grid_Mod/Sort_Cells_By_Coordinates.f90" +# include "Grid_Mod/Sort_Cells_By_Thread.f90" # include "Grid_Mod/Sort_Faces_By_Index.f90" -# include "Grid_Mod/Sort_Faces_Smart.f90" +# include "Grid_Mod/Sort_Faces_By_Region.f90" # include "Grid_Mod/Write_Template_Control_File.f90" end module diff --git a/Sources/Shared/Grid_Mod/Allocate_Cells.f90 b/Sources/Shared/Grid_Mod/Allocate_Cells.f90 index 6ce69c4b7..32f13f23a 100644 --- a/Sources/Shared/Grid_Mod/Allocate_Cells.f90 +++ b/Sources/Shared/Grid_Mod/Allocate_Cells.f90 @@ -3,9 +3,9 @@ subroutine Allocate_Cells(Grid, nc, nb) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid - integer :: nc ! number of cells inside - integer :: nb ! number of cells on the bounday + class(Grid_Type) :: Grid + integer, intent(in) :: nc ! number of cells inside + integer, intent(in) :: nb ! number of cells on the bounday !-----------------------------------[Locals]-----------------------------------! integer :: c !==============================================================================! @@ -45,10 +45,10 @@ subroutine Allocate_Cells(Grid, nc, nb) allocate(Grid % cells_n_faces(-nb:nc)); Grid % cells_n_faces(:) = 0 allocate(Grid % cells_n_cells(-nb:nc)); Grid % cells_n_cells(:) = 0 - ! Boundary condition color in a given direction + ! Boundary condition region in a given direction ! (These go up to 6 because they are needed for ! non-polyhedral meshes creted in Gambit/Gmsh) - allocate(Grid % cells_bnd_color(6, -nb:nc)) + allocate(Grid % cells_bnd_region(6, -nb:nc)) ! Allocate processor i.d. allocate(Grid % Comm % cell_proc(-nb:nc)); Grid % Comm % cell_proc(:) = 0 @@ -57,6 +57,9 @@ subroutine Allocate_Cells(Grid, nc, nb) Grid % Comm % cell_glo(c) = c end do + ! Allocate thread i.d. + allocate(Grid % Vect % cell_thread(-nb:nc)); Grid % Vect % cell_thread(:) = 0 + ! Allocate new and old numbers (this is so often used, maybe is better here) allocate(Grid % new_c(-nb:nc)); Grid % new_c(:) = 0 allocate(Grid % old_c(-nb:nc)); Grid % old_c(:) = 0 diff --git a/Sources/Shared/Grid_Mod/Allocate_Faces.f90 b/Sources/Shared/Grid_Mod/Allocate_Faces.f90 index ae4e8bdfd..59cc91e8b 100644 --- a/Sources/Shared/Grid_Mod/Allocate_Faces.f90 +++ b/Sources/Shared/Grid_Mod/Allocate_Faces.f90 @@ -56,6 +56,9 @@ subroutine Allocate_Faces(Grid, nf, ns) allocate(Grid % f (nf+ns)); Grid % f (:) = 0.0 allocate(Grid % fw(nf+ns)); Grid % fw(:) = 0.0 + ! Allocate thread i.d. + allocate(Grid % Vect % face_thread(nf+ns)); Grid % Vect % face_thread(:) = 0 + ! Allocate new and old numbers (this is so often used, maybe is better here) allocate(Grid % new_f(nf+ns)); Grid % new_f(:) = 0 allocate(Grid % old_f(nf+ns)); Grid % old_f(:) = 0 diff --git a/Sources/Shared/Grid_Mod/Allocate_Nodes.f90 b/Sources/Shared/Grid_Mod/Allocate_Nodes.f90 index 8b1530b24..bb85c4fea 100644 --- a/Sources/Shared/Grid_Mod/Allocate_Nodes.f90 +++ b/Sources/Shared/Grid_Mod/Allocate_Nodes.f90 @@ -3,8 +3,8 @@ subroutine Allocate_Nodes(Grid, nn) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid - integer :: nn + class(Grid_Type) :: Grid + integer, intent(in) :: nn !-----------------------------------[Locals]-----------------------------------! integer :: n !==============================================================================! diff --git a/Sources/Shared/Grid_Mod/Allocate_Regions.f90 b/Sources/Shared/Grid_Mod/Allocate_Regions.f90 new file mode 100644 index 000000000..552b488a7 --- /dev/null +++ b/Sources/Shared/Grid_Mod/Allocate_Regions.f90 @@ -0,0 +1,64 @@ +!==============================================================================! + subroutine Allocate_Regions(Grid, nbr) +!------------------------------------------------------------------------------! +! Regions. There are some boundary regions for boundary conditions. These ! +! are specified by a user in one file or another, depending if you are in ! +! Generate, Convert or others. They are stored in Grid % n_bnd_regions. ! +! ! +! In addition to those, there is an extra region for internal cells or ! +! faces. It is stored in Grid % n_regions, and Grid % n_regions is equal ! +! to Grid % n_bnd_regions + 1. ! +! ! +! In addition, there are also buffer cells in Process, which would be ! +! stored in Grid % n_regions + 1 or Grid % n_bnd_regions + 2. ! +! ! +! On top of them all, there are three regions reserved for periodic x, y ! +! and z directions, used for copy boundaries and they are stored in ! +! Grid % n_regions + 2, Grid % n_regions + 3 and Grid % n_regions + 4. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type) :: Grid + integer, intent(in) :: nbr ! number of boundary regions +!==============================================================================! + + ! Store the number of boundary regions for the grid + Grid % n_bnd_regions = nbr + + ! Number of regions, at least the "visible" ones ... + ! ... is bigger by one, by the "internal" regaion + Grid % n_regions = Grid % n_bnd_regions + 1 + + Grid % per_x_reg = Grid % n_bnd_regions + 3 ! for periodic_x region + Grid % per_y_reg = Grid % n_bnd_regions + 4 ! for periodic_y region + Grid % per_z_reg = Grid % n_bnd_regions + 5 ! for periodic_z region + + ! Allocate memory for regions' names + allocate(Grid % region % name(Grid % n_regions+5)) + Grid % region % name(1:Grid % n_bnd_regions) = 'UNDEFINED' + Grid % region % name (Grid % n_bnd_regions + 1) = 'INSIDE' + Grid % region % name (Grid % n_bnd_regions + 2) = 'BUFFER' + Grid % region % name (Grid % n_bnd_regions + 3) = 'PERIODIC_X' + Grid % region % name (Grid % n_bnd_regions + 4) = 'PERIODIC_Y' + Grid % region % name (Grid % n_bnd_regions + 5) = 'PERIODIC_Z' + + ! Allocate memory for regions' types + allocate(Grid % region % type(Grid % n_regions+5)) + Grid % region % type(1:Grid % n_bnd_regions) = UNDEFINED + Grid % region % type (Grid % n_bnd_regions + 1) = INSIDE + Grid % region % type (Grid % n_bnd_regions + 2) = BUFFER + Grid % region % type (Grid % n_bnd_regions + 3) = PERIODIC_X + Grid % region % type (Grid % n_bnd_regions + 4) = PERIODIC_Y + Grid % region % type (Grid % n_bnd_regions + 5) = PERIODIC_Z + + ! Memory for cell and face ranges + allocate(Grid % region % f_cell(Grid % n_regions+5)) + allocate(Grid % region % l_cell(Grid % n_regions+5)) + allocate(Grid % region % f_face(Grid % n_regions+5)) + allocate(Grid % region % l_face(Grid % n_regions+5)) + Grid % region % f_cell(:) = -1 + Grid % region % l_cell(:) = -HUGE_INT + Grid % region % f_face(:) = 0 + Grid % region % l_face(:) = -1 + + end subroutine diff --git a/Sources/Shared/Comm_Mod/Sequential/Send_Log_Array.f90 b/Sources/Shared/Grid_Mod/Bnd_Cond_Name_At_Cell.f90 similarity index 55% rename from Sources/Shared/Comm_Mod/Sequential/Send_Log_Array.f90 rename to Sources/Shared/Grid_Mod/Bnd_Cond_Name_At_Cell.f90 index 03e8874a7..b16e888e5 100644 --- a/Sources/Shared/Comm_Mod/Sequential/Send_Log_Array.f90 +++ b/Sources/Shared/Grid_Mod/Bnd_Cond_Name_At_Cell.f90 @@ -1,14 +1,15 @@ !==============================================================================! - subroutine Send_Log_Array(Comm, len_s, phi_s, dest) + character(SL) function Bnd_Cond_Name_At_Cell(Grid, cell) !------------------------------------------------------------------------------! -! Dummy function for sequential compilation. ! +! Provides a shortcut to obtain boundary condition name at boundary cell. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Comm_Type) :: Comm - integer :: len_s ! send length - logical :: phi_s(len_s) ! send buffer - integer :: dest ! destination processor + class(Grid_Type) :: Grid + integer, intent(in) :: cell !==============================================================================! - end subroutine + Bnd_Cond_Name_At_Cell = Grid % region % name(Grid % region % at_cell(cell)) + + end function + diff --git a/Sources/Shared/Grid_Mod/Bnd_Cond_Name_At_Face.f90 b/Sources/Shared/Grid_Mod/Bnd_Cond_Name_At_Face.f90 new file mode 100644 index 000000000..618e21cd9 --- /dev/null +++ b/Sources/Shared/Grid_Mod/Bnd_Cond_Name_At_Face.f90 @@ -0,0 +1,22 @@ +!==============================================================================! + character(SL) function Bnd_Cond_Name_At_Face(Grid, face) +!------------------------------------------------------------------------------! +! Provides a shortcut to obtain boundary condition name at a face. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type) :: Grid + integer, intent(in) :: face +!==============================================================================! + + Assert(Grid % region % at_face(face) .ge. 0) + Assert(Grid % region % at_face(face) .le. Grid % per_z_reg) + + if(Grid % region % at_face(face) .eq. 0) then + Bnd_Cond_Name_At_Face = 'UNDEFINED' + else + Bnd_Cond_Name_At_Face = Grid % region % name(Grid % region % at_face(face)) + end if + + end function + diff --git a/Sources/Shared/Grid_Mod/Bnd_Cond_Ranges.f90 b/Sources/Shared/Grid_Mod/Bnd_Cond_Ranges.f90 deleted file mode 100644 index b1160c915..000000000 --- a/Sources/Shared/Grid_Mod/Bnd_Cond_Ranges.f90 +++ /dev/null @@ -1,36 +0,0 @@ -!==============================================================================! - subroutine Bnd_Cond_Ranges(Grid) -!------------------------------------------------------------------------------! -! Allocates memory and finds the range (first and last boundary cell) ! -! for each of the boundary condition colors. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid -!-----------------------------------[Locals]-----------------------------------! - integer :: c, color -!==============================================================================! - - ! Allocate memory - allocate(Grid % bnd_cond % color_s_cell(Grid % n_bnd_cond)) - allocate(Grid % bnd_cond % color_e_cell(Grid % n_bnd_cond)) - - ! Set non-realizable ranges - Grid % bnd_cond % color_s_cell(:) = -1 - Grid % bnd_cond % color_e_cell(:) = 0 - - ! Browse forward and backward to find first and last cell for each range - do c = -1, -Grid % n_bnd_cells, -1 - color = Grid % bnd_cond % color(c) - if(c < Grid % bnd_cond % color_e_cell(color)) then - Grid % bnd_cond % color_e_cell(color) = c - end if - end do - do c = -Grid % n_bnd_cells, -1 - color = Grid % bnd_cond % color(c) - if(c > Grid % bnd_cond % color_e_cell(color)) then - Grid % bnd_cond % color_s_cell(color) = c - end if - end do - - end subroutine diff --git a/Sources/Shared/Grid_Mod/Bnd_Cond_Type.f90 b/Sources/Shared/Grid_Mod/Bnd_Cond_Type.f90 index c18c2ae57..494ed8be1 100644 --- a/Sources/Shared/Grid_Mod/Bnd_Cond_Type.f90 +++ b/Sources/Shared/Grid_Mod/Bnd_Cond_Type.f90 @@ -1,18 +1,17 @@ !==============================================================================! - integer function Bnd_Cond_Type(Grid, bnd_cell) + integer function Bnd_Cond_Type(Grid, cell) !------------------------------------------------------------------------------! ! Provides a shortcut to obtain boundary condition type. ! ! Warning: avoid calling this function for temperature and species (scalars) ! -! since they may have different b.c. for the same color. ! +! since they may have different b.c. for the same region. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid - integer :: bnd_cell + class(Grid_Type) :: Grid + integer, intent(in) :: cell !==============================================================================! - Bnd_Cond_Type = & - Grid % bnd_cond % type(Grid % bnd_cond % color(bnd_cell)) + Bnd_Cond_Type = Grid % region % type(Grid % region % at_cell(cell)) end function diff --git a/Sources/Shared/Grid_Mod/Bounding_Box.f90 b/Sources/Shared/Grid_Mod/Bounding_Box.f90 index c4a6cd6d5..9882c2865 100644 --- a/Sources/Shared/Grid_Mod/Bounding_Box.f90 +++ b/Sources/Shared/Grid_Mod/Bounding_Box.f90 @@ -20,12 +20,12 @@ subroutine Bounding_Box(Grid, xmin, ymin, zmin, xmax, ymax, zmax) ymax = maxval(Grid % yn(1:nn)) zmax = maxval(Grid % zn(1:nn)) - call Comm_Mod_Global_Min_Real(xmin) - call Comm_Mod_Global_Min_Real(ymin) - call Comm_Mod_Global_Min_Real(zmin) + call Global % Min_Real(xmin) + call Global % Min_Real(ymin) + call Global % Min_Real(zmin) - call Comm_Mod_Global_Max_Real(xmax) - call Comm_Mod_Global_Max_Real(ymax) - call Comm_Mod_Global_Max_Real(zmax) + call Global % Max_Real(xmax) + call Global % Max_Real(ymax) + call Global % Max_Real(zmax) end subroutine diff --git a/Sources/Shared/Grid_Mod/Calculate_Face_Geometry.f90 b/Sources/Shared/Grid_Mod/Calculate_Face_Geometry.f90 index d61371028..bffa20ed9 100644 --- a/Sources/Shared/Grid_Mod/Calculate_Face_Geometry.f90 +++ b/Sources/Shared/Grid_Mod/Calculate_Face_Geometry.f90 @@ -17,13 +17,13 @@ subroutine Calculate_Face_Geometry(Grid) !------------------------------[Local parameters]------------------------------! logical, parameter :: DEBUG = .false. !-----------------------------------[Locals]-----------------------------------! - integer :: c, i_fac, c1, c2, s, sh, m, n, pnt_to, pnt_from, fail_count + integer :: c1, c2, s, sh, n, pnt_to, pnt_from, fail_count real :: xc1, yc1, zc1, xc2, yc2, zc2 - real :: d_s, min_d, max_d, dx, dy, dz, sx, sy, sz - real :: vec1(3), vec2(3), prod(3), dist(3), surf(3) + real :: d_s, min_d, max_d, sx, sy, sz + real :: dist(3), surf(3) !==============================================================================! - if(this_proc < 2) print '(a)', ' # Checking the integrity of cell faces ...' + if(First_Proc()) print '(a)', ' # Checking the integrity of cell faces ...' !-----------------------------------! ! Perform some integrity checks ! @@ -153,7 +153,7 @@ subroutine Calculate_Face_Geometry(Grid) "this and will terminate now.", & file=__FILE__, line=__LINE__) - if(this_proc < 2) print '(a)', ' # All integrity tests passed' + if(First_Proc()) print '(a)', ' # All integrity tests passed' !---------------------------------------! ! ! @@ -169,9 +169,9 @@ subroutine Calculate_Face_Geometry(Grid) min_d = min(min_d, d_s) max_d = max(max_d, d_s) end do - call Comm_Mod_Global_Min_Real(min_d) - call Comm_Mod_Global_Max_Real(max_d) - if(this_proc < 2 .and. Grid % n_shadows > 0) then + call Global % Min_Real(min_d) + call Global % Max_Real(max_d) + if(First_Proc() .and. Grid % n_shadows > 0) then print '(a,f9.3)', ' # Minimum distance stored in shadow faces: ', min_d print '(a,f9.3)', ' # Maximum distance stored in shadow faces: ', max_d end if @@ -192,28 +192,22 @@ subroutine Calculate_Face_Geometry(Grid) if(abs(Grid % dx(s)) > PICO) then if(abs(Grid % xc(c2) - Grid % xc(c1) ) > 1.5 * abs(Grid % dx(s))) then - if(Grid % xc(c2) > Grid % xc(c1)) then - Assert(Grid % faces_s(s) > 0) - Grid % bnd_cond % color(s) = Grid % n_bnd_cond + 1 - end if + Assert(Grid % faces_s(s) > 0) + Grid % region % at_face(s) = Grid % per_x_reg end if end if if(abs(Grid % dy(s)) > PICO) then if(abs(Grid % yc(c2) - Grid % yc(c1) ) > 1.5 * abs(Grid % dy(s))) then - if(Grid % yc(c2) > Grid % yc(c1)) then - Assert(Grid % faces_s(s) > 0) - Grid % bnd_cond % color(s) = Grid % n_bnd_cond + 2 - end if + Assert(Grid % faces_s(s) > 0) + Grid % region % at_face(s) = Grid % per_y_reg end if end if if(abs(Grid % dz(s)) > PICO) then if(abs(Grid % zc(c2) - Grid % zc(c1) ) > 1.5 * abs(Grid % dz(s))) then - if(Grid % zc(c2) > Grid % zc(c1)) then - Assert(Grid % faces_s(s) > 0) - Grid % bnd_cond % color(s) = Grid % n_bnd_cond + 3 - end if + Assert(Grid % faces_s(s) > 0) + Grid % region % at_face(s) = Grid % per_z_reg end if end if @@ -236,9 +230,9 @@ subroutine Calculate_Face_Geometry(Grid) max_d = max(max_d, d_s) end if end do - call Comm_Mod_Global_Min_Real(min_d) - call Comm_Mod_Global_Max_Real(max_d) - if(this_proc < 2 .and. Grid % n_shadows > 0) then + call Global % Min_Real(min_d) + call Global % Max_Real(max_d) + if(First_Proc() .and. Grid % n_shadows > 0) then print '(a,f9.3)', ' # Minimum corrected distance at shadows: ', min_d print '(a,f9.3)', ' # Maximum corrected distance at shadows: ', max_d end if @@ -257,7 +251,7 @@ subroutine Calculate_Face_Geometry(Grid) if(Grid % faces_s(s) .ne. 0) pnt_from = pnt_from + 1 end do if(pnt_to .ne. pnt_from) then - print *, '# Pointers to and from shadows wrong in processor: ', this_proc + print *, '# Pointers to and from shadows wrong in processor: ', This_Proc() stop end if diff --git a/Sources/Shared/Grid_Mod/Calculate_Face_Surfaces.f90 b/Sources/Shared/Grid_Mod/Calculate_Face_Surfaces.f90 index 73863bdcc..df55fe536 100644 --- a/Sources/Shared/Grid_Mod/Calculate_Face_Surfaces.f90 +++ b/Sources/Shared/Grid_Mod/Calculate_Face_Surfaces.f90 @@ -8,7 +8,6 @@ subroutine Calculate_Face_Surfaces(Grid) class(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! integer :: s, i_nod, j_nod, m, n - real :: dx, dy, dz real, allocatable :: xf(:), yf(:), zf(:) !==============================================================================! diff --git a/Sources/Shared/Grid_Mod/Calculate_Global_Volumes.f90 b/Sources/Shared/Grid_Mod/Calculate_Global_Volumes.f90 index 7d4b590c1..2da704bf2 100644 --- a/Sources/Shared/Grid_Mod/Calculate_Global_Volumes.f90 +++ b/Sources/Shared/Grid_Mod/Calculate_Global_Volumes.f90 @@ -21,8 +21,8 @@ subroutine Calculate_Global_Volumes(Grid) end do ! Make them global (over all processors) - call Comm_Mod_Global_Max_Real(Grid % max_vol) - call Comm_Mod_Global_Min_Real(Grid % min_vol) - call Comm_Mod_Global_Sum_Real(Grid % tot_vol) + call Global % Max_Real(Grid % max_vol) + call Global % Min_Real(Grid % min_vol) + call Global % Sum_Real(Grid % tot_vol) end subroutine diff --git a/Sources/Shared/Grid_Mod/Calculate_Wall_Distance.f90 b/Sources/Shared/Grid_Mod/Calculate_Wall_Distance.f90 index 09d7ba4f8..8bee86269 100644 --- a/Sources/Shared/Grid_Mod/Calculate_Wall_Distance.f90 +++ b/Sources/Shared/Grid_Mod/Calculate_Wall_Distance.f90 @@ -24,7 +24,7 @@ subroutine Calculate_Wall_Distance(Grid) !------------------------------------------------------------------! Grid % wall_dist = HUGE - call Print_Bnd_Cond_List(Grid) + call Print_Regions_List(Grid) call Message % Framed(60, & 'Calculating distance from the walls ', & 'Type ordinal number(s) of wall or wall_flux boundary condition(s) ' // & @@ -74,9 +74,7 @@ subroutine Calculate_Wall_Distance(Grid) ' % complete...', achar(13) do b = 1, n_wall_colors - do c2 = Grid % bnd_cond % color_s_cell( wall_colors(b) ), & - Grid % bnd_cond % color_e_cell( wall_colors(b) ), & - -1 + do c2 = Cells_In_Region( wall_colors(b) ) Grid % wall_dist(c1) = & min(Grid % wall_dist(c1), & Math % Distance_Squared(Grid % xc(c1), & diff --git a/Sources/Shared/Grid_Mod/Decompose.f90 b/Sources/Shared/Grid_Mod/Decompose.f90 index c0641f7b3..7b159819c 100644 --- a/Sources/Shared/Grid_Mod/Decompose.f90 +++ b/Sources/Shared/Grid_Mod/Decompose.f90 @@ -1,14 +1,14 @@ !==============================================================================! subroutine Decompose(Grid, n_parts) !------------------------------------------------------------------------------! -! Coarsens the grid with METIS library. ! +! Decomposes the grid with METIS library. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid - integer :: n_parts + class(Grid_Type), intent(inout) :: Grid + integer, intent(in) :: n_parts !-----------------------------------[Locals]-----------------------------------! - integer :: c, c1, c2, s + integer :: c, c1, c2, s, s_f, s_l integer, allocatable :: part(:) ! result of partitioning !==============================================================================! @@ -20,27 +20,20 @@ subroutine Decompose(Grid, n_parts) !----------------------------------------------------------------------------! ! Prepare METIS and Exectute a call to METIS graph partitioning function ! !----------------------------------------------------------------------------! - call Metis % Create_Metis(Grid % faces_c, n_parts) - - Metis % options = -1 ! Initialize all to default - Metis % options(METIS_OPTION_DBGLVL) = 0 - - call Metis_PartGraphRecursive( & ! rank intent type METIS - Metis % n_verts, & ! 1. (in), int nvtxs - Metis % n_constrains, & ! 2. (in), int ncon - Metis % row, & ! 3. (in), int(:) xadj - Metis % col, & ! 4. (in), int(:) adjncy - Metis % vert_weights, & ! 5. (in), int(:) vwgt - Metis % vert_data, & ! 6. (in), int(:) vsize - Metis % edge_weights, & ! 7. (in), int(:) adjwgt - n_parts, & ! 8. (in), int(:) nparts - Metis % part_weight, & ! 9. (in), real(:) tpwgts - Metis % imbalance, & ! 10. (in), real(:) ubvec - Metis % options, & ! 11. (in), int(:) options - Metis % return_val, & ! 12. (out) int(:) objval - part(:)) ! 13. (out) int(:) part - - part(:) = part(:) + 1 ! +1, METIS works from zero + + ! Set the bounding faces + s_l = Grid % n_faces + Grid % n_shadows ! last face at this point + do s_f = 1, s_l ! search for first inside face + if(Grid % faces_c(2, s_f) > 0) exit ! when you find first inside face + end do + + ! Call METIS with estimated face range + call Metis % Create_Metis(s_f, s_l, Grid % faces_c, n_parts) + + !-----------------------------! + ! Execute a call to METIS ! + !-----------------------------! + call Metis % Call_Metis(n_parts, part) !-----------------------------------------------------! ! Save the result from the call to METIS function ! diff --git a/Sources/Shared/Grid_Mod/Determine_Regions_Ranges.f90 b/Sources/Shared/Grid_Mod/Determine_Regions_Ranges.f90 new file mode 100644 index 000000000..fb6627610 --- /dev/null +++ b/Sources/Shared/Grid_Mod/Determine_Regions_Ranges.f90 @@ -0,0 +1,204 @@ +!==============================================================================! + subroutine Determine_Regions_Ranges(Grid) +!------------------------------------------------------------------------------! +! Allocates memory and finds the range (first and last boundary cell) ! +! for each of the boundary condition region. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type), intent(inout) :: Grid +!------------------------------[Local parameters]------------------------------! + logical, parameter :: DEBUG = .false. +!-----------------------------------[Locals]-----------------------------------! + integer :: c, c1, c2, reg, s, siz + integer :: last_face_only_inside, first_face_in_buffers +!==============================================================================! + + !-------------------! + ! ! + ! Cells' ranges ! + ! ! + !-------------------! + + !-------------------------------! + ! Set non-realizable ranges ! + !-------------------------------! + Grid % region % f_cell(:) = -1 + Grid % region % l_cell(:) = -HUGE_INT + + !----------------------------------------------------------------------------! + ! Browse forward and backward to find first and last cell for each range ! + !----------------------------------------------------------------------------! + + ! Forward + do c = -Grid % n_bnd_cells, -1 + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then + reg = Grid % region % at_cell(c) + if(c < Grid % region % f_cell(reg)) then + Grid % region % f_cell(reg) = c + end if + end if + end do + + ! Backward + do c = -1, -Grid % n_bnd_cells, -1 + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then + reg = Grid % region % at_cell(c) + if(c > Grid % region % l_cell(reg)) then + Grid % region % l_cell(reg) = c + end if + end if + end do + + !------------------! + ! Inside cells ! + !------------------! + reg = Grid % n_regions + Grid % region % f_cell(reg) = Grid % n_cells + Grid % region % l_cell(reg) = 1 + do c = 1, Grid % n_cells + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then + if(c < Grid % region % f_cell(reg)) then + Grid % region % f_cell(reg) = c + end if + if(c > Grid % region % l_cell(reg)) then + Grid % region % l_cell(reg) = c + end if + end if + end do + + !------------------! + ! Buffer cells ! + !- - - - - - - - - +--------------------------------------------------! + ! Note: leave Grid % region % l_cell(reg) at Grid % n_cells since ! + ! it makes macro Cells_In_Domain_And_Buffers() work in sequential ! + !---------------------------------------------------------------------! + reg = Grid % n_regions + 1 + Grid % region % f_cell(reg) = Grid % n_cells + 1 + Grid % region % l_cell(reg) = Grid % n_cells + do c = 1, Grid % n_cells + if(Grid % Comm % cell_proc(c) .ne. This_Proc()) then + if(c < Grid % region % f_cell(reg)) then + Grid % region % f_cell(reg) = c + end if + if(c > Grid % region % l_cell(reg)) then + Grid % region % l_cell(reg) = c + end if + end if + end do + + if(DEBUG) then + write(1000+This_Proc(), '(a,a)') ' # Cell ranges from ', PROGRAM_NAME + do reg = All_Regions() + siz = Grid % region % l_cell(reg) - Grid % region % f_cell(reg) + 1 + write(1000+This_Proc(),'(a,i3,i15,i15,i15,a,a)') ' # Region: ', reg, & + Grid % region % f_cell(reg), & + Grid % region % l_cell(reg), & + max(siz, 0), ' ', & + trim(Grid % region % name(reg)) + end do + end if + + !-------------------! + ! ! + ! Faces' ranges ! + ! ! + !-------------------! + + !-------------------------------! + ! Set non-realizable ranges ! + !-------------------------------! + Grid % region % f_face(:) = 0 + Grid % region % l_face(:) = -1 + + !----------------------------------------------------------! + ! Browse through colors and faces to set faces' ranges ! + !----------------------------------------------------------! + do reg = Boundary_Regions() + if(Grid % region % f_cell(reg) < Grid % region % l_cell(reg)) then + do s = 1, Grid % n_faces + c = Grid % faces_c(2, s) + if(Grid % region % f_cell(reg) .eq. c) then + Grid % region % f_face(reg) = s + end if + if(Grid % region % l_cell(reg) .eq. c) then + Grid % region % l_face(reg) = s + end if + end do + end if + end do + + !------------------! + ! Inside faces ! + !------------------! + reg = Grid % n_regions + Grid % region % f_face(reg) = Grid % n_faces + Grid % region % l_face(reg) = 1 + do s = 1, Grid % n_faces + c1 = Grid % faces_c(1, s) + c2 = Grid % faces_c(2, s) + if(c2 > 0) then ! limit to inside faces + if(Grid % Comm % cell_proc(c1) .eq. This_Proc() .or. & + Grid % Comm % cell_proc(c2) .eq. This_Proc()) then + if(s <= Grid % region % f_face(reg)) then + Grid % region % f_face(reg) = s + end if + if(s >= Grid % region % l_face(reg)) then + Grid % region % l_face(reg) = s + end if + Assert(Grid % Comm % cell_proc(c1) .eq. This_Proc()) ! this should hold + end if + end if ! c2 > 0 + end do + + !-------------! + ! Check 1 ! + !-------------! + do s = Faces_In_Domain() + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + Assert(c2 > 0) + end do + + !-------------! + ! Check 2 ! + !-------------! + last_face_only_inside = 0 + first_face_in_buffers = HUGE_INT ! first face in buffers + do s = Faces_In_Domain() + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) + if(Grid % Comm % cell_proc(c1) .eq. This_Proc() .and. & + Grid % Comm % cell_proc(c2) .eq. This_Proc()) then + last_face_only_inside = max(last_face_only_inside, s) + end if + if(Grid % Comm % cell_proc(c1) .eq. This_Proc() .and. & + Grid % Comm % cell_proc(c2) .ne. This_Proc()) then + first_face_in_buffers = min(first_face_in_buffers, s) + end if + end do + Assert(last_face_only_inside < first_face_in_buffers) + + if(DEBUG) then + write(2000+This_Proc(), '(a,a)') ' # Face ranges from ', PROGRAM_NAME + do reg = All_Regions() + siz = Grid % region % l_face(reg) - Grid % region % f_face(reg) + 1 + write(2000+This_Proc(),'(a,i3,i15,i15,i15,a,a)') ' # Region: ', reg, & + Grid % region % f_face(reg), & + Grid % region % l_face(reg), & + max(siz, 0), ' ', & + trim(Grid % region % name(reg)) + end do + end if + + !-------------! + ! Check 3 ! + !-------------! + do reg = Boundary_Regions() + do s = Faces_In_Region(reg) + c = Grid % faces_c(2, s) + Assert(Grid % region % at_cell(c) == reg) + end do + end do + + end subroutine diff --git a/Sources/Shared/Grid_Mod/Determine_Threads.f90 b/Sources/Shared/Grid_Mod/Determine_Threads.f90 new file mode 100644 index 000000000..e3042dbc9 --- /dev/null +++ b/Sources/Shared/Grid_Mod/Determine_Threads.f90 @@ -0,0 +1,212 @@ +!==============================================================================! + subroutine Determine_Threads(Grid) +!------------------------------------------------------------------------------! +! Take care of threads for OpenMP ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type), target, intent(inout) :: Grid +!-----------------------------------[Locals]-----------------------------------! + type(Vect_Type), pointer :: Vect + integer :: c, s, m, i_fac + integer :: n_cells_in, in_thread, n_remains, thr + integer, allocatable :: cells_in_thread(:) + character(SL) :: st1, st2 + integer :: f_s, l_s + integer, allocatable :: old_fc (:,:) + integer, allocatable :: old_nn (:) + integer, allocatable :: old_shad(:) + integer, allocatable :: old_nods(:,:) +!==============================================================================! + + m = size(Grid % faces_n, 1) + allocate(old_fc (2, Grid % n_faces)) ! old number of nodes + allocate(old_nn ( Grid % n_faces)) ! old number of nodes + allocate(old_shad( Grid % n_faces)) + allocate(old_nods(m, Grid % n_faces)) + + ! Take aliases + Vect => Grid % Vect + + !----------------------------! + ! ! + ! Find number of threads ! + ! ! + !- - - - - - - - - - - - - - +-----------------------! + ! This is all a bit silly at this stage, it will ! + ! make more sense when Vect_Mod matures a bit. ! + !----------------------------------------------------! + + ! You read desired number of threads from control file, try to use that + if(Vect % d_threads .lt. Vect % Get_Max_Threads()) then + call Vect % Set_Num_Threads(Vect % d_threads) + + else if(Vect % d_threads .gt. Vect % Get_Max_Threads()) then + write(st1, '(i0.0)') Vect % d_threads + write(st2, '(i0.0)') Vect % Get_Max_Threads() + call Message % Error(80, & + 'You are trying to run with '//trim(st1)//' OpenMP threads ' // & + 'but there are only '//trim(st2)//' available. ' // & + 'The workaround is to either increase the environment ' // & + 'variable OMP_NUM_THREAD, or decrease parameter MAX_THREADS ' // & + 'in control file.', & + file=__FILE__, line=__LINE__, one_proc=.true.) + end if + + ! Set n_threads to whatever you adjusted above + Vect % n_threads = Vect % Get_Max_Threads() + + if(Vect % n_threads > 1) then + write(st1, '(i0.0)') Vect % n_threads + call Message % Framed(48, 'NOTE from OpenMP!', & + 'You are running a simulation on ' // & + trim(st1) // ' threads.', one_proc=.true.) + end if + + !-------------------------------------------------------! + ! ! + ! If there is more than one thread, distribute them ! + ! ! + !-------------------------------------------------------! + if(PROGRAM_NAME == "Process" .and. & + Vect % n_threads > 1) then + + !--------------------------! + ! Arrange cell threads ! + !--------------------------! + allocate(Vect % thread % f_cell(Vect % n_threads)) + allocate(Vect % thread % l_cell(Vect % n_threads)) + + n_cells_in = Grid % region % l_cell(Grid % n_regions) - & + Grid % region % f_cell(Grid % n_regions) + 1 + in_thread = n_cells_in / Vect % n_threads + n_remains = mod(n_cells_in, Vect % n_threads) + + allocate(cells_in_thread(Vect % n_threads)) + cells_in_thread(:) = in_thread + + ! Add the remaining cells to the threads + do thr = 1, n_remains + cells_in_thread(thr) = cells_in_thread(thr) + 1 + end do + + ! Work out starts and ends of the threads + Vect % thread % f_cell(1) = Grid % region % f_cell(Grid % n_regions) + Vect % thread % l_cell(1) = Vect % thread % f_cell(1) & + + cells_in_thread(1) - 1 + do thr = 2, Vect % n_threads + Vect % thread % f_cell(thr) = Vect % thread % l_cell(thr-1) + 1 + Vect % thread % l_cell(thr) = Vect % thread % f_cell(thr) & + + cells_in_thread(thr) - 1 + end do + + ! Assign cell threads (not sure if really needed) + do thr = 1, Vect % n_threads + do c = Vect % thread % f_cell(thr), Vect % thread % l_cell(thr) + Vect % cell_thread(c) = thr + end do + end do + + !-------------------------! + ! Arange face threads ! + !-------------------------! + + ! A plain copy of cell threads to face threads seems to work just fine + ! (For the time being, I am only treating inside faces. I am not even + ! sure if explcit parallelization of boundary regions makes sense) + do s = Faces_In_Domain() + c = Grid % faces_c(1, s) + Vect % face_thread(s) = Vect % cell_thread(c) + end do + call Grid % Save_Vtu_Faces(int_phi_f=Vect % face_thread) + + ! The problem with simple assignments above is that face threads + ! are not continous, they break at buffer faces which are sorted + ! by processors. This shouldn't be needed for parallel runs ... + do s = 1, Grid % n_faces + Grid % old_f(s) = s + end do + + ! ... hence, faces are sorted by threads + f_s = Grid % region % f_face(Grid % n_regions) + l_s = Grid % region % l_face(Grid % n_regions) + call Sort % Int_Carry_Int(Vect % face_thread(f_s:l_s), & + Grid % old_f(f_s:l_s)) + + ! Sort connectivity: faces_c, faces_n_nodes, faces_n and faces_s + do s = Faces_In_Domain() + old_fc (1:2,s) = Grid % faces_c (1:2, Grid % old_f(s)) + old_nn ( s) = Grid % faces_n_nodes( Grid % old_f(s)) + old_nods(1:m,s) = Grid % faces_n (1:m, Grid % old_f(s)) + old_shad( s) = Grid % faces_s ( Grid % old_f(s)) + end do + do s = Faces_In_Domain() + Grid % faces_c(1:2, s) = old_fc (1:2, s) + Grid % faces_n_nodes(s) = old_nn ( s) + Grid % faces_n(1:m, s) = old_nods(1:m, s) + Grid % faces_s (s) = old_shad( s) + Assert(Grid % faces_c(1,s) .lt. Grid % faces_c(2,s)) + end do + + ! Form the new face numbers from the old face numbers + do s = 1, Grid % n_faces + Grid % new_f(Grid % old_f(s)) = s + end do + + ! Do the sorting of geometrical quantities. All ... + ! ... which is read from .dim file should be here. + call Sort % Real_By_Index(Grid % n_faces, Grid % sx(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % sy(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % sz(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % dx(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % dy(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % dz(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % f (1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % xf(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % yf(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % zf(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % rx(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % ry(1), Grid % new_f(1)) + call Sort % Real_By_Index(Grid % n_faces, Grid % rz(1), Grid % new_f(1)) + + ! Correct shadow faces + do s = Grid % n_faces + 1, Grid % n_faces + Grid % n_shadows + Grid % faces_s(s) = Grid % new_f(Grid % faces_s(s)) + end do + + ! Correct face indexes for cells + do c = -Grid % n_bnd_cells, Grid % n_cells + do i_fac = 1, Grid % cells_n_faces(c) + s = Grid % cells_f(i_fac, c) ! take the face's index + Grid % cells_f(i_fac, c) = Grid % new_f(s) + end do + end do + + ! Work out starts and ends of the threads + allocate(Vect % thread % f_face(Vect % n_threads)) + allocate(Vect % thread % l_face(Vect % n_threads)) + + do thr = 1, Vect % n_threads + Vect % thread % f_face(thr) = HUGE_INT + Vect % thread % l_face(thr) = -HUGE_INT + do s = Faces_In_Domain() + if(Vect % face_thread(s) .eq. thr) then + Vect % thread % f_face(thr) = min(Vect % thread % f_face(thr), s) + Vect % thread % l_face(thr) = max(Vect % thread % l_face(thr), s) + end if + end do + end do + + ! Perform some check + do thr = 1, Vect % n_threads + Assert(Vect % thread % f_face(thr) .le. Vect % thread % l_face(thr)) + end do + do thr = 2, Vect % n_threads + Assert(Vect % thread % f_face(thr) .ge. Vect % thread % f_face(thr-1)) + Assert(Vect % thread % l_face(thr) .ge. Vect % thread % l_face(thr-1)) + Assert(Vect % thread % f_face(thr) .ge. Vect % thread % l_face(thr-1)) + end do + + end if + + end subroutine diff --git a/Sources/Shared/Grid_Mod/Exchange_Cells_Int.f90 b/Sources/Shared/Grid_Mod/Exchange_Cells_Int.f90 index 8975b0493..a908700f6 100644 --- a/Sources/Shared/Grid_Mod/Exchange_Cells_Int.f90 +++ b/Sources/Shared/Grid_Mod/Exchange_Cells_Int.f90 @@ -12,7 +12,7 @@ subroutine Exchange_Cells_Int(Grid, phi) !==============================================================================! ! Fill the buffers with new values - do sub = 1, n_proc + do sub = 1, N_Procs() len_s = Grid % Comm % cells_send(sub) % n_items do ln = 1, len_s c1 = Grid % Comm % cells_send(sub) % map(ln) @@ -21,7 +21,7 @@ subroutine Exchange_Cells_Int(Grid, phi) end do ! Exchange the values - do sub = 1, n_proc + do sub = 1, N_Procs() len_s = Grid % Comm % cells_send(sub) % n_items len_r = Grid % Comm % cells_recv(sub) % n_items if(len_s + len_r > 0) then @@ -35,7 +35,7 @@ subroutine Exchange_Cells_Int(Grid, phi) end do ! Fill the buffers with new values - do sub = 1, n_proc + do sub = 1, N_Procs() len_r = Grid % Comm % cells_recv(sub) % n_items do ln = 1, len_r c2 = Grid % Comm % cells_recv(sub) % map(ln) diff --git a/Sources/Shared/Grid_Mod/Exchange_Cells_Log.f90 b/Sources/Shared/Grid_Mod/Exchange_Cells_Log.f90 index 417d01db0..4753d5c3e 100644 --- a/Sources/Shared/Grid_Mod/Exchange_Cells_Log.f90 +++ b/Sources/Shared/Grid_Mod/Exchange_Cells_Log.f90 @@ -12,7 +12,7 @@ subroutine Exchange_Cells_Log(Grid, phi) !==============================================================================! ! Fill the buffers with new values - do sub = 1, n_proc + do sub = 1, N_Procs() len_s = Grid % Comm % cells_send(sub) % n_items do ln = 1, len_s c1 = Grid % Comm % cells_send(sub) % map(ln) @@ -21,7 +21,7 @@ subroutine Exchange_Cells_Log(Grid, phi) end do ! Exchange the values - do sub = 1, n_proc + do sub = 1, N_Procs() len_s = Grid % Comm % cells_send(sub) % n_items len_r = Grid % Comm % cells_recv(sub) % n_items if(len_s + len_r > 0) then @@ -35,7 +35,7 @@ subroutine Exchange_Cells_Log(Grid, phi) end do ! Fill the buffers with new values - do sub = 1, n_proc + do sub = 1, N_Procs() len_r = Grid % Comm % cells_recv(sub) % n_items do ln = 1, len_r c2 = Grid % Comm % cells_recv(sub) % map(ln) diff --git a/Sources/Shared/Grid_Mod/Exchange_Cells_Real.f90 b/Sources/Shared/Grid_Mod/Exchange_Cells_Real.f90 index 4b23dbfa4..7d47a17a7 100644 --- a/Sources/Shared/Grid_Mod/Exchange_Cells_Real.f90 +++ b/Sources/Shared/Grid_Mod/Exchange_Cells_Real.f90 @@ -29,12 +29,12 @@ subroutine Exchange_Cells_Real(Grid, phi, caller) !-------------------------------------------------------------------! if(present(caller)) then - if(this_proc < 2) then + if(First_Proc()) then call File % Append_For_Writing_Ascii( & - 'exchange_cells_real.log', fu, this_proc) + 'exchange_cells_real.log', fu, This_Proc()) end if - do sub = 1, n_proc + do sub = 1, N_Procs() len_r = Grid % Comm % cells_recv(sub) % n_items do ln = 1, len_r c2 = Grid % Comm % cells_recv(sub) % map(ln) @@ -48,7 +48,7 @@ subroutine Exchange_Cells_Real(Grid, phi, caller) !----------------------------------! ! Fill the buffers with new values - do sub = 1, n_proc + do sub = 1, N_Procs() len_s = Grid % Comm % cells_send(sub) % n_items do ln = 1, len_s c1 = Grid % Comm % cells_send(sub) % map(ln) @@ -57,7 +57,7 @@ subroutine Exchange_Cells_Real(Grid, phi, caller) end do ! Exchange the values - do sub = 1, n_proc + do sub = 1, N_Procs() len_s = Grid % Comm % cells_send(sub) % n_items len_r = Grid % Comm % cells_recv(sub) % n_items if(len_s + len_r > 0) then @@ -71,7 +71,7 @@ subroutine Exchange_Cells_Real(Grid, phi, caller) end do ! Fill the buffers with new values - do sub = 1, n_proc + do sub = 1, N_Procs() len_r = Grid % Comm % cells_recv(sub) % n_items do ln = 1, len_r c2 = Grid % Comm % cells_recv(sub) % map(ln) @@ -86,7 +86,7 @@ subroutine Exchange_Cells_Real(Grid, phi, caller) if(present(caller)) then needed = NO - do sub = 1, n_proc + do sub = 1, N_Procs() len_r = Grid % Comm % cells_recv(sub) % n_items do ln = 1, len_r if( Grid % Comm % cells_recv(sub) % r_buff(ln) .ne. & @@ -97,9 +97,9 @@ subroutine Exchange_Cells_Real(Grid, phi, caller) end do ! What if it is needed on some other processor - call Comm_Mod_Global_Max_Int(needed) + call Global % Max_Int(needed) - if(this_proc < 2) then + if(First_Proc()) then if(needed .eq. YES) then write(fu,'(a)') '# Call from: ' // caller // ' was needed!' else diff --git a/Sources/Shared/Grid_Mod/Find_Nodes_Cells.f90 b/Sources/Shared/Grid_Mod/Find_Nodes_Cells.f90 index 114388dc7..02be3f565 100644 --- a/Sources/Shared/Grid_Mod/Find_Nodes_Cells.f90 +++ b/Sources/Shared/Grid_Mod/Find_Nodes_Cells.f90 @@ -47,7 +47,7 @@ subroutine Find_Nodes_Cells(Grid) ! Allocate memory for cells surrounding each node if(run .eq. 1) then max_n_cells = maxval(Grid % nodes_n_cells) - call Comm_Mod_Global_Max_Int(max_n_cells) + call Global % Max_Int(max_n_cells) allocate(Grid % nodes_c(1:max_n_cells, 1:Grid % n_nodes)) allocate(cell_list(max_n_cells*2)); cell_list(:) = 0 end if diff --git a/Sources/Shared/Grid_Mod/Form_Cells_Comm.f90 b/Sources/Shared/Grid_Mod/Form_Cells_Comm.f90 index d4ae9ad03..805680f0a 100644 --- a/Sources/Shared/Grid_Mod/Form_Cells_Comm.f90 +++ b/Sources/Shared/Grid_Mod/Form_Cells_Comm.f90 @@ -2,24 +2,45 @@ subroutine Form_Cells_Comm(Grid) !------------------------------------------------------------------------------! ! Find communication patterns for cells from Process ! +! ! +! This is not the simplest procedure in T-Flows, so in this header I will ! +! try to explain how it works. In a nutshell, it browses through buffer ! +! cells of all sub-domains and stores their global numbers as well as sub- ! +! domain numbers they are from (in need_cell and from_proc matrices). ! +! This information is distributed among all the processor by performing a ! +! global sum over integer arrays, and with that continues to form buffers. ! +! ! +! For this procedure to work, it is essential that global cell numbers are ! +! the same in buffers and in inside cells from which the data is needed. ! +! This was the case until the moment we started sorting inside cells to be ! +! in different threads for vectorization. Once that happened, an extra ! +! measure was taken, by sorting buffers with criteria in send_sort() and ! +! recv_sort(). (Though, the latter one might not be needed.) ! +! ! +! In other words: because we are browsing through cells in separate dom- ! +! ains independently, we must ensure they are in right order. This is en- ! +! sured by forming send_sort() and recv_sort() and applying them order ! +! cells in send and receive buffers. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! class(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! - integer :: sub, ms, mr, cnt + integer :: sub, ms, mr, cnt, n_fail integer :: c, c1, c2, s, n_buff_faces, n_max_buff_cells, i_cel integer, allocatable :: send_cells(:), recv_cells(:) integer, allocatable :: send_buff_cnt(:,:), recv_buff_cnt(:,:) integer, allocatable :: need_cell(:,:), from_proc(:,:) + integer, allocatable :: send_sort(:), recv_sort(:) + integer, allocatable :: glo(:) ! used for checking the communication logical, parameter :: DEBUG = .false. !==============================================================================! - if(n_proc < 2) return + if(Sequential_Run()) return ! Allocate memory for locally used arrays - allocate(send_buff_cnt(n_proc, n_proc)) - allocate(recv_buff_cnt(n_proc, n_proc)) + allocate(send_buff_cnt(N_Procs(), N_Procs())) + allocate(recv_buff_cnt(N_Procs(), N_Procs())) allocate(send_cells(-Grid % n_bnd_cells:Grid % n_cells)) allocate(recv_cells(-Grid % n_bnd_cells:Grid % n_cells)) @@ -27,11 +48,12 @@ subroutine Form_Cells_Comm(Grid) ! Count buffer cells inside ! !-------------------------------! Grid % Comm % n_buff_cells = 0 - do c = 1, Grid % n_cells - if(Grid % Comm % cell_proc(c) .ne. this_proc) then - Grid % Comm % n_buff_cells = & - Grid % Comm % n_buff_cells + 1 - end if + do c = Cells_In_Domain() + Assert(Grid % Comm % cell_proc(c) .eq. This_Proc()) + end do + do c = Cells_In_Buffers() + Assert(Grid % Comm % cell_proc(c) .ne. This_Proc()) + Grid % Comm % n_buff_cells = Grid % Comm % n_buff_cells + 1 end do !------------------------! @@ -51,25 +73,26 @@ subroutine Form_Cells_Comm(Grid) !--------------------------------------------------------! recv_buff_cnt(:,:) = 0 recv_cells(:) = 0 - do c = Grid % n_cells - Grid % Comm % n_buff_cells + 1, & - Grid % n_cells + do c = Cells_In_Buffers() sub = Grid % Comm % cell_proc(c) - recv_buff_cnt(this_proc, sub) = recv_buff_cnt(this_proc, sub) + 1 + recv_buff_cnt(This_Proc(), sub) = recv_buff_cnt(This_Proc(), sub) + 1 recv_cells(c) = sub end do if(DEBUG) then - do sub=1, n_proc - if(sub .ne. this_proc) then - write(100*this_proc+sub, *) '#====================================' // & + do sub=1, N_Procs() + if(sub .ne. This_Proc()) then + write(100*This_Proc()+sub, *) & + '#====================================' // & '=====================================' - write(100*this_proc+sub, '(a,i7,a,i7)') & + write(100*This_Proc()+sub, '(a,i7,a,i7)') & ' # There are ', Grid % Comm % n_buff_cells, & - ' buffer cells in processor ', this_proc - write(100*this_proc+sub, *) '#------------------------------------' // & + ' buffer cells in processor ', This_Proc() + write(100*This_Proc()+sub, *) & + '#------------------------------------' // & '-------------------------------------' - write(100*this_proc+sub, '(a,i7,a,i7)') & - ' # It needs ', recv_buff_cnt(this_proc, sub), & + write(100*This_Proc()+sub, '(a,i7,a,i7)') & + ' # It needs ', recv_buff_cnt(This_Proc(), sub), & ' cells from processors ', sub end if end do @@ -79,48 +102,46 @@ subroutine Form_Cells_Comm(Grid) ! Allocate memory for matrix with needed cells ! !--------------------------------------------------! n_max_buff_cells = Grid % Comm % n_buff_cells - call Comm_Mod_Global_Max_Int(n_max_buff_cells) - allocate(need_cell(n_max_buff_cells, n_proc)); need_cell(:,:) = 0 - allocate(from_proc(n_max_buff_cells, n_proc)); from_proc(:,:) = 0 + call Global % Max_Int(n_max_buff_cells) + allocate(need_cell(n_max_buff_cells, N_Procs())); need_cell(:,:) = 0 + allocate(from_proc(n_max_buff_cells, N_Procs())); from_proc(:,:) = 0 !-------------------------------------------! ! Store global number of cells you need ! ! and also from which processor it is ! !-------------------------------------------! i_cel = 0 - do c = Grid % n_cells - Grid % Comm % n_buff_cells + 1, & - Grid % n_cells - if(Grid % Comm % cell_proc(c) .ne. this_proc) then - i_cel = i_cel + 1 - need_cell(i_cel, this_proc) = Grid % Comm % cell_glo(c) - from_proc(i_cel, this_proc) = Grid % Comm % cell_proc(c) - end if + do c = Cells_In_Buffers() + Assert(Grid % Comm % cell_proc(c) .ne. This_Proc()) + i_cel = i_cel + 1 + need_cell(i_cel, This_Proc()) = Grid % Comm % cell_glo(c) + from_proc(i_cel, This_Proc()) = Grid % Comm % cell_proc(c) end do !----------------------------------------------! ! Inform all processors about needed cells ! ! and from which processor are they needed ! !----------------------------------------------! - need_cell = reshape(need_cell, (/n_max_buff_cells*n_proc, 1/)) - from_proc = reshape(from_proc, (/n_max_buff_cells*n_proc, 1/)) - call Comm_Mod_Global_Sum_Int_Array(n_max_buff_cells*n_proc, need_cell) - call Comm_Mod_Global_Sum_Int_Array(n_max_buff_cells*n_proc, from_proc) - need_cell = reshape(need_cell, (/n_max_buff_cells, n_proc/)) - from_proc = reshape(from_proc, (/n_max_buff_cells, n_proc/)) + need_cell = reshape(need_cell, (/n_max_buff_cells*N_Procs(), 1/)) + from_proc = reshape(from_proc, (/n_max_buff_cells*N_Procs(), 1/)) + call Global % Sum_Int_Array(n_max_buff_cells*N_Procs(), need_cell) + call Global % Sum_Int_Array(n_max_buff_cells*N_Procs(), from_proc) + need_cell = reshape(need_cell, (/n_max_buff_cells, N_Procs()/)) + from_proc = reshape(from_proc, (/n_max_buff_cells, N_Procs()/)) !---------------------------------------------------------------------! ! Form send_buff_cnt from the information in the matrix from_proc ! !---------------------------------------------------------------------! send_buff_cnt(:,:) = 0 - do sub = 1, n_proc - if(sub .ne. this_proc) then + do sub = 1, N_Procs() + if(sub .ne. This_Proc()) then do i_cel = 1, n_max_buff_cells - if(from_proc(i_cel, sub) .eq. this_proc) then - send_buff_cnt(this_proc, sub) = send_buff_cnt(this_proc, sub) + 1 + if(from_proc(i_cel, sub) .eq. This_Proc()) then + send_buff_cnt(This_Proc(), sub) = send_buff_cnt(This_Proc(), sub) + 1 end if end do - if(DEBUG) write(100*this_proc + sub, '(2(a,i7))') & - ' # It should send ', send_buff_cnt(this_proc, sub), & + if(DEBUG) write(100*This_Proc() + sub, '(2(a,i7))') & + ' # It should send ', send_buff_cnt(This_Proc(), sub), & ' cells to processor ', sub end if end do @@ -128,33 +149,34 @@ subroutine Form_Cells_Comm(Grid) !--------------------------------------------------! ! Allocate memory for send and receive buffers ! !--------------------------------------------------! - allocate(Grid % Comm % cells_send(n_proc)) - allocate(Grid % Comm % cells_recv(n_proc)) + allocate(Grid % Comm % cells_send(N_Procs())) + allocate(Grid % Comm % cells_recv(N_Procs())) !-----------------------------------! ! ! ! Form send and receive buffers ! ! ! !-----------------------------------! - do sub = 1, n_proc + do sub = 1, N_Procs() ! Initialize buffer size to zero Grid % Comm % cells_send(sub) % n_items = 0 Grid % Comm % cells_recv(sub) % n_items = 0 - if(sub .ne. this_proc) then + if(sub .ne. This_Proc()) then !---------------------------------! ! Allocate memory for buffers ! !---------------------------------! - ms = send_buff_cnt(this_proc, sub) - mr = recv_buff_cnt(this_proc, sub) + ms = send_buff_cnt(This_Proc(), sub) + mr = recv_buff_cnt(This_Proc(), sub) if(ms > 0) then allocate(Grid % Comm % cells_send(sub) % map(ms)); allocate(Grid % Comm % cells_send(sub) % i_buff(ms)); allocate(Grid % Comm % cells_send(sub) % l_buff(ms)); allocate(Grid % Comm % cells_send(sub) % r_buff(ms)); + allocate(send_sort(ms)); end if if(mr > 0) then @@ -163,20 +185,19 @@ subroutine Form_Cells_Comm(Grid) allocate(Grid % Comm % cells_recv(sub) % l_buff(mr)); allocate(Grid % Comm % cells_recv(sub) % r_buff(mr)); allocate(Grid % Comm % cells_recv(sub) % o_buff(mr)); + allocate(recv_sort(mr)); end if !------------------------------------------! ! Form send_cells from the information ! ! in matrices from_proc and need_cell ! !------------------------------------------! - ms = 0 - mr = 0 cnt = 0 send_cells(:) = 0 do i_cel = 1, n_max_buff_cells - if(from_proc(i_cel, sub) .eq. this_proc) then - do c = 1, Grid % n_cells + if(from_proc(i_cel, sub) .eq. This_Proc()) then + do c = Cells_In_Domain() if(Grid % Comm % cell_glo(c) .eq. need_cell(i_cel, sub)) then send_cells(c) = sub ! identify cnt = cnt + 1 @@ -185,36 +206,60 @@ subroutine Form_Cells_Comm(Grid) end if end do - if(DEBUG) write(100*this_proc + sub, '(2(a,i7))') & + if(DEBUG) write(100*This_Proc() + sub, '(2(a,i7))') & ' # It did find ', cnt, & ' cells to send to processor', sub - ! This worries me. Why should this be from -Grid % n_bnd_cells or not - do c = 1, Grid % n_cells + ! Browse through cells in domain to find what you have to send + ms = 0 + do c = Cells_In_Domain() if(send_cells(c) .eq. sub) then ms = ms + 1 Grid % Comm % cells_send(sub) % map(ms) = c + send_sort(ms) = Grid % Comm % cell_glo(c) ! store sorting criterion end if end do - ! This worries me. Why should this be from -Grid % n_bnd_cells or not - do c = 1, Grid % n_cells + ! Important link for robustness: insures that the sent cells in this + ! domain are ordered in the same way as receive cells in other domain + if(ms > 0) then + call Sort % Int_Carry_Int(send_sort, & + Grid % Comm % cells_send(sub) % map) + end if + + ! Browse through cells in buffers to find out what you need to receive + mr = 0 + do c = Cells_In_Buffers() if(recv_cells(c) .eq. sub) then mr = mr + 1 Grid % Comm % cells_recv(sub) % map(mr) = c + recv_sort(mr) = Grid % Comm % cell_glo(c) ! store sorting criterion end if end do + ! Important link for robustness: insures that the receive cells in this + ! domain are ordered in the same way as sent cells in other domain. + ! (Yet, this is not engaged yet since the cells in buffers has not been + ! fiddled with like the cells in domain due to OpenMP threading.) + ! if(mr > 0) then + ! call Sort % Int_Carry_Int(recv_sort, & + ! Grid % Comm % cells_recv(sub) % map) + ! end if + if(DEBUG) then - write(100*this_proc+sub, '(a,i0.0,a,i0.0,a,i0.0,a,i0.0)') & - ' # send/recv (', this_proc, '/', sub, ') = ', ms, ' / ', mr + write(100*This_Proc()+sub, '(a,i0.0,a,i0.0,a,i0.0,a,i0.0)') & + ' # send/recv (', This_Proc(), '/', sub, ') = ', ms, ' / ', mr end if ! Store final buffer lengths Grid % Comm % cells_send(sub) % n_items = ms Grid % Comm % cells_recv(sub) % n_items = mr - end if ! sub .ne. this_proc + ! Free sorting arrays for the next iteration + if(ms > 0) deallocate(send_sort) + if(mr > 0) deallocate(recv_sort) + + end if ! sub .ne. This_Proc() end do ! sub !-------------------------------------! @@ -223,10 +268,31 @@ subroutine Form_Cells_Comm(Grid) !-------------------------------------! Grid % n_faces = Grid % n_faces - n_buff_faces - ! De-allocate locally used memory - deallocate(send_buff_cnt) - deallocate(recv_buff_cnt) - deallocate(send_cells) - deallocate(recv_cells) + !------------------------------------------! + ! Check if communication patterns work ! + !------------------------------------------! + allocate(glo(-Grid % n_bnd_cells : Grid % n_cells)); glo(:) = 0 + + do c = Cells_In_Domain() + glo(c) = Grid % Comm % cell_glo(c) + end do + + call Grid % Exchange_Cells_Int(glo) + + n_fail = 0 + do c = Cells_In_Buffers() + if(.not. glo(c) .eq. Grid % Comm % cell_glo(c)) then + n_fail = n_fail + 1 + end if + end do + call Global % Sum_Int(n_fail) + if(n_fail .gt. 0) then + call Message % Error(55, & + 'Ouch, this hurts. Formation of communication ' // & + 'patterns has failed. Hopefully, you just ran ' // & + 'the simulation on fewer processor than there ' // & + 'are subdomains. \n \n This error is critical.', & + file=__FILE__, line=__LINE__, one_proc=.true.) + end if end subroutine diff --git a/Sources/Shared/Grid_Mod/Form_Maps.f90 b/Sources/Shared/Grid_Mod/Form_Maps_For_Backup.f90 similarity index 67% rename from Sources/Shared/Grid_Mod/Form_Maps.f90 rename to Sources/Shared/Grid_Mod/Form_Maps_For_Backup.f90 index b26b662b7..0090a02dd 100644 --- a/Sources/Shared/Grid_Mod/Form_Maps.f90 +++ b/Sources/Shared/Grid_Mod/Form_Maps_For_Backup.f90 @@ -1,14 +1,8 @@ !==============================================================================! - subroutine Form_Maps(Grid) + subroutine Form_Maps_For_Backup(Grid) !------------------------------------------------------------------------------! ! Forms maps for parallel backup ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid -!-----------------------------------[Locals]-----------------------------------! - integer :: c, cnt -!==============================================================================! +! ! ! There is an issue with this procedure, but it's more related to MPI/IO ! ! functions than T-Flows. In cases a subdomain has no physical boundary ! ! cells, variable "nb_sub" turns out to be zero. This, per se, should not ! @@ -17,7 +11,17 @@ subroutine Form_Maps(Grid) ! length. But they don't. Therefore, I avoid allocation with zero size ! ! (max(nb_sub,1)) here and creation of new types with zero size in ! ! "Comm_Mod_Create_New_Types". It is a bit of a dirty trick :-( ! +! ! +! Another issue, also related to MPI, is that maps for saving must be in ! +! increasing order. If you are doing only MPI that is fine, but if you ! +! are renumbering cells for threading with OpenMP, things get cumbersome. ! !------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type) :: Grid +!-----------------------------------[Locals]-----------------------------------! + integer :: c, cnt, reg +!==============================================================================! ! Initialize number of cells in subdomain Grid % Comm % nc_sub = Grid % n_cells - Grid % Comm % n_buff_cells @@ -25,20 +29,26 @@ subroutine Form_Maps(Grid) ! Initialize number of boundary cells in subdomain Grid % Comm % nb_sub = 0 do c = -Grid % n_bnd_cells, -1 - if(Grid % Comm % cell_proc(c) .eq. this_proc) then + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then Grid % Comm % nb_sub = Grid % Comm % nb_sub + 1 end if end do - ! First and last cell to send - Grid % Comm % nb_f = Grid % n_bnd_cells - Grid % Comm % nb_l = Grid % n_bnd_cells - Grid % Comm % nb_sub + 1 + ! First and last cell to send are found through regions + Grid % Comm % nb_l = Grid % n_bnd_cells + Grid % Comm % nb_f = 1 + do reg = Boundary_Regions() + if(Grid % region % l_cell(reg) >= Grid % region % f_cell(reg)) then + Grid % Comm % nb_l = min(Grid % Comm % nb_l, -Grid % region % l_cell(reg)) + Grid % Comm % nb_f = max(Grid % Comm % nb_f, -Grid % region % f_cell(reg)) + end if + end do ! Initialize total number of cells Grid % Comm % nc_tot = Grid % Comm % nc_sub Grid % Comm % nb_tot = Grid % Comm % nb_sub - call Comm_Mod_Global_Sum_Int(Grid % Comm % nc_tot) - call Comm_Mod_Global_Sum_Int(Grid % Comm % nb_tot) + call Global % Sum_Int(Grid % Comm % nc_tot) + call Global % Sum_Int(Grid % Comm % nb_tot) ! Allocate memory for mapping matrices allocate(Grid % Comm % cell_map (Grid % Comm % nc_sub)) @@ -51,7 +61,7 @@ subroutine Form_Maps(Grid) ! For run with one processor ! ! ! !--------------------------------! - if(n_proc < 2) then + if(Sequential_Run()) then !-------------------------------------! ! Global cell numbers for T-Flows ! @@ -93,14 +103,28 @@ subroutine Form_Maps(Grid) Grid % Comm % cell_map(c) = int(Grid % Comm % cell_glo(c)-1, SP) end do + ! Maps must be in increasing order + do c = 2, Grid % Comm % nc_sub + Assert(Grid % Comm % cell_map(c) .gt. Grid % Comm % cell_map(c-1)) + end do + !-----------------------! ! Boundary cell map ! !-----------------------! cnt = 0 - do c = -Grid % Comm % nb_f, -Grid % Comm % nb_l - cnt = cnt + 1 - Grid % Comm % bnd_cell_map(cnt) = int( Grid % Comm % cell_glo(c) & - + Grid % Comm % nb_tot, SP) + do reg = Boundary_Regions() + do c = Cells_In_Region(reg) + cnt = cnt + 1 + ! Keep in mind there that for boundary cells, cell_glo is negative, so + ! adding the nb_tot to all the indices, shifts them all to positive + Grid % Comm % bnd_cell_map(cnt) = int( Grid % Comm % cell_glo(c) & + + Grid % Comm % nb_tot, SP) + end do + end do ! region + + ! Maps must be in increasing order + do c = 2, Grid % Comm % nb_sub + Assert(Grid % Comm % bnd_cell_map(c) .gt. Grid % Comm % bnd_cell_map(c-1)) end do ! If domain has zero boundary cells, make the only diff --git a/Sources/Shared/Grid_Mod/Load_And_Prepare_For_Processing.f90 b/Sources/Shared/Grid_Mod/Load_And_Prepare_For_Processing.f90 new file mode 100644 index 000000000..4143f43d1 --- /dev/null +++ b/Sources/Shared/Grid_Mod/Load_And_Prepare_For_Processing.f90 @@ -0,0 +1,27 @@ +!==============================================================================! + subroutine Load_And_Prepare_For_Processing(Grid, d) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type), intent(inout) :: Grid + integer, intent(in) :: d +!==============================================================================! + + call Control % Read_Problem_Name(problem_name(d)) + + ! Load the finite volume Grid + call Grid % Load_Cfn(This_Proc(), domain=d) + call Grid % Load_Dim(This_Proc(), domain=d) + + ! Determine threads for OpenMP runs + call Control % Max_Threads(Grid % Vect % d_threads, .true.) + call Grid % Determine_Threads() + + call Grid % Calculate_Face_Geometry() + + ! Find communication patterns + call Grid % Form_Cells_Comm() + call Grid % Form_Maps_For_Backup() + + end subroutine + diff --git a/Sources/Shared/Grid_Mod/Load_Cfn.f90 b/Sources/Shared/Grid_Mod/Load_Cfn.f90 index 412c10ecb..e623d419f 100644 --- a/Sources/Shared/Grid_Mod/Load_Cfn.f90 +++ b/Sources/Shared/Grid_Mod/Load_Cfn.f90 @@ -9,10 +9,12 @@ subroutine Load_Cfn(Grid, this_proc, domain) integer, intent(in) :: this_proc ! needed if called from Processor integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! - integer :: c, c1, c2, s, n, ss, sr, fu, real_prec - character(SL) :: name_in + integer :: c, c1, c2, s, n, ss, sr, fu, real_prec, version + character(SL) :: name_in, str, str1, str2 !==============================================================================! + call Profiler % Start('Load_Cfn') + !-------------------------------! ! Read the file with the ! ! connections between cells ! @@ -48,6 +50,22 @@ subroutine Load_Cfn(Grid, this_proc, domain) end if end if + !------------------------------! + ! Read version of the file ! + !------------------------------! + read(fu) version + + if(version .ne. VERSION_CFN) then + write(str1, '(i0.0)') version + write(str2, '(i0.0)') VERSION_CFN + call Message % Error(72, & + 'You seem to be reading wrong version of the .cfn file. '// & + 'The version you are reading is '//trim(str1)//' but the '// & + 'code expects version '//trim(str2)//'. Re-generate or '// & + 'convert again the grids (and divide them if you run in '// & + 'parallel).', one_proc = .true.) + end if + !-----------------------------------------------! ! Number of cells, boundary cells and faces ! !-----------------------------------------------! @@ -56,7 +74,7 @@ subroutine Load_Cfn(Grid, this_proc, domain) read(fu) Grid % n_bnd_cells ! number of boundary cells read(fu) Grid % n_faces ! number of faces (with buffer faces) read(fu) Grid % n_shadows ! number of shadow faces - read(fu) Grid % n_bnd_cond ! number of boundary conditions + read(fu) Grid % n_bnd_regions ! number of boundary conditions !-------------------------------------! ! Does grid have polyhedral cells ! @@ -64,14 +82,10 @@ subroutine Load_Cfn(Grid, this_proc, domain) read(fu) Grid % polyhedral ! Allocate memory =--> carefull, there is no checking! - call Grid % Allocate_Nodes(Grid % n_nodes) - call Grid % Allocate_Cells(Grid % n_cells, Grid % n_bnd_cells) - call Grid % Allocate_Faces(Grid % n_faces, Grid % n_shadows) - - ! Boundary conditions' keys - ! (Go from zero for faces which are not at the boundary) - allocate(Grid % bnd_cond % name(0 : Grid % n_bnd_cond + 3)) - allocate(Grid % bnd_cond % type(0 : Grid % n_bnd_cond + 3)) + call Grid % Allocate_Nodes (Grid % n_nodes) + call Grid % Allocate_Cells (Grid % n_cells, Grid % n_bnd_cells) + call Grid % Allocate_Faces (Grid % n_faces, Grid % n_shadows) + call Grid % Allocate_Regions(Grid % n_bnd_regions) !-----------------! ! Domain name ! @@ -81,17 +95,10 @@ subroutine Load_Cfn(Grid, this_proc, domain) !------------------------------! ! Boundary conditions list ! !------------------------------! - do n = 1, Grid % n_bnd_cond - read(fu) Grid % bnd_cond % name(n) + do n = Boundary_Regions() + read(fu) Grid % region % name(n) end do - ! The last three are reserved for perodicity - ! and used for inlet copy boundary condition. Don't delete these thinking - ! they are useless. They are assigned in Calculate_Face_Geometry - Grid % bnd_cond % name(Grid % n_bnd_cond + 1) = 'PERIODIC_X' - Grid % bnd_cond % name(Grid % n_bnd_cond + 2) = 'PERIODIC_Y' - Grid % bnd_cond % name(Grid % n_bnd_cond + 3) = 'PERIODIC_Z' - !--------------------------! ! Nodes global numbers ! !--------------------------! @@ -108,10 +115,11 @@ subroutine Load_Cfn(Grid, this_proc, domain) do c = -Grid % n_bnd_cells, Grid % n_cells if(c .ne. 0) then if(Grid % cells_n_nodes(c) .eq. 0) then - print *, '# ERROR: Number of nodes is zero at cell:', c - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') c + call Message % Error(72, & + 'Number of nodes is zero at cell: '//trim(str)//'. '// & + 'This is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end do @@ -129,10 +137,11 @@ subroutine Load_Cfn(Grid, this_proc, domain) do c = -Grid % n_bnd_cells, Grid % n_cells do n = 1, abs(Grid % cells_n_nodes(c)) if(Grid % cells_n(n, c) .eq. 0) then - print *, '# ERROR: Node index is zero at cell:', c - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') c + call Message % Error(72, & + 'Node index is zero at cell: '//trim(str)//'. '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do end do @@ -144,10 +153,11 @@ subroutine Load_Cfn(Grid, this_proc, domain) do c = -Grid % n_bnd_cells, Grid % n_cells if(c .ne. 0) then if(Grid % cells_n_faces(c) .eq. 0) then - print *, '# ERROR: Number of faces is zero at cell:', c - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') c + call Message % Error(72, & + 'Number of faces is zero at cell: '//trim(str)//'. '// & + 'This is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end do @@ -164,10 +174,11 @@ subroutine Load_Cfn(Grid, this_proc, domain) do c = -Grid % n_bnd_cells, Grid % n_cells do s = 1, Grid % cells_n_faces(c) if(Grid % cells_f(s, c) .eq. 0) then - print *, '# ERROR: Face index is zero at cell:', c - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') c + call Message % Error(72, & + 'Face index is zero at cell: '//trim(str)//'. '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do end do @@ -188,10 +199,11 @@ subroutine Load_Cfn(Grid, this_proc, domain) ! Error trap for number of nodes for each face do s = 1, Grid % n_faces + Grid % n_shadows if(Grid % faces_n_nodes(s) .eq. 0) then - print *, '# ERROR: Number of nodes is zero at face:', s - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') s + call Message % Error(72, & + 'Number of nodes is zero at face: '//trim(str)//'. '// & + 'This is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do @@ -207,10 +219,11 @@ subroutine Load_Cfn(Grid, this_proc, domain) do s = 1, Grid % n_faces + Grid % n_shadows do n = 1, Grid % faces_n_nodes(s) if(Grid % faces_n(n, s) .eq. 0) then - print *, '# ERROR: Node index is zero at face:', s - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') s + call Message % Error(72, & + 'Node index is zero at face: '//trim(str)//'. '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do end do @@ -230,16 +243,22 @@ subroutine Load_Cfn(Grid, this_proc, domain) Grid % Comm % cell_proc(c2) .eq. this_proc) then if( .not. (c1.eq.0 .and. c2.eq.0) ) then if(Grid % faces_c(1, s) .eq. 0) then - print *, '# ERROR: Cell one is zero at face:', s, c1, c2 - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') s + write(str1, '(i0.0)') c1; write(str2, '(i0.0)') c2; + call Message % Error(72, & + 'Cell one is zero at face: '//trim(str)//' '// & + 'surrounded by cells '//trim(str1)//' and '//trim(str2) & + //'. \n This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if if(Grid % faces_c(2, s) .eq. 0) then - print *, '# ERROR: Cell two is zero at face:', s - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') s + write(str1, '(i0.0)') c1; write(str2, '(i0.0)') c2; + call Message % Error(72, & + 'Cell two is zero at face: '//trim(str)//' '// & + 'surrounded by cells '//trim(str1)//' and '//trim(str2) & + //'. \n This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end if @@ -252,16 +271,16 @@ subroutine Load_Cfn(Grid, this_proc, domain) do ss = Grid % n_faces + 1, Grid % n_faces + Grid % n_shadows sr = Grid % faces_s(ss) ! real face from shadow data if(sr .eq. 0) then - print *, '# ERROR: Shadow faces points to zero face' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + call Message % Error(72, & + 'Shadow face points to zero face. ' // & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if if(Grid % faces_s(sr) .ne. ss) then - print *, '# ERROR: Real and shadow faces do not point to each other' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + call Message % Error(60, & + 'Real and shadow face do not point to one another. ' // & + ' \n This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do @@ -272,11 +291,16 @@ subroutine Load_Cfn(Grid, this_proc, domain) ! Physical boundary cells (and all the faces) ! (This opens the oportunity to store bounary condition info in ... ! ... the faces thus ridding us of the "if(c2 < 0) then" checks) - allocate (Grid % bnd_cond % color(-Grid % n_bnd_cells-1:Grid % n_faces)) - read(fu) (Grid % bnd_cond % color(c), c = -Grid % n_bnd_cells, -1) + allocate (Grid % region % at_cell(-Grid % n_bnd_cells:-1)) + read(fu) (Grid % region % at_cell(c), c = -Grid % n_bnd_cells, -1) - call Bnd_Cond_Ranges(Grid) + allocate (Grid % region % at_face(1:Grid % n_faces)) + Grid % region % at_face(1:Grid % n_faces) = 0 + + call Grid % Determine_Regions_Ranges() close(fu) + call Profiler % Stop('Load_Cfn') + end subroutine diff --git a/Sources/Shared/Grid_Mod/Load_Dim.f90 b/Sources/Shared/Grid_Mod/Load_Dim.f90 index bd19025f2..5609a61f5 100644 --- a/Sources/Shared/Grid_Mod/Load_Dim.f90 +++ b/Sources/Shared/Grid_Mod/Load_Dim.f90 @@ -9,10 +9,12 @@ subroutine Load_Dim(Grid, this_proc, domain) integer, intent(in) :: this_proc integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! - integer :: c, n, s, fu, real_prec - character(SL) :: name_in + integer :: c, n, s, fu, real_prec, version + character(SL) :: name_in, str1, str2 !==============================================================================! + call Profiler % Start('Load_Dim') + !----------------------------! ! Read the file with ! ! geometrical dimensions ! @@ -21,6 +23,12 @@ subroutine Load_Dim(Grid, this_proc, domain) domain=domain) call File % Open_For_Reading_Binary(name_in, fu, this_proc) + !----------------------------------------------! + ! Store rank (domain number) for this grid ! + !----------------------------------------------! + Grid % rank = 0 + if(present(domain)) Grid % rank = domain + !-------------------------! ! Read real precision ! !-------------------------! @@ -46,6 +54,22 @@ subroutine Load_Dim(Grid, this_proc, domain) end if end if + !------------------------------! + ! Read version of the file ! + !------------------------------! + read(fu) version + + if(version .ne. VERSION_DIM) then + write(str1, '(i0.0)') version + write(str2, '(i0.0)') VERSION_DIM + call Message % Error(72, & + 'You seem to be reading wrong version of the .dim file. '// & + 'The version you are reading is '//trim(str1)//' but the '// & + 'code expects version '//trim(str2)//'. Re-generate or '// & + 'convert again the grids (and divide them if you run in '// & + 'parallel).', one_proc = .true.) + end if + !-------------------------! ! Read everything else ! !-------------------------! @@ -91,4 +115,6 @@ subroutine Load_Dim(Grid, this_proc, domain) close(fu) + call Profiler % Stop('Load_Dim') + end subroutine diff --git a/Sources/Shared/Grid_Mod/Merge_Duplicate_Nodes.f90 b/Sources/Shared/Grid_Mod/Merge_Duplicate_Nodes.f90 index 6f39c3142..d88e198f5 100644 --- a/Sources/Shared/Grid_Mod/Merge_Duplicate_Nodes.f90 +++ b/Sources/Shared/Grid_Mod/Merge_Duplicate_Nodes.f90 @@ -9,7 +9,7 @@ subroutine Merge_Duplicate_Nodes(Grid) real, allocatable :: xn(:), yn(:), zn(:) !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #=======================================================' print '(a,a,a)', ' # Merging nodes in "', trim(Grid % name), '" if needed' print '(a)', ' #-------------------------------------------------------' @@ -51,13 +51,13 @@ subroutine Merge_Duplicate_Nodes(Grid) end if Grid % new_n(Grid % old_n(n)) = cnt end do - if(this_proc < 2) then + if(First_Proc()) then print '(a,i9)', ' # Number of unique nodes: ', cnt end if ! Decide what to do based on the compressed number of nodes if(cnt .eq. Grid % n_nodes) then - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # No duplicate nodes found, nothing to merge!' end if return @@ -66,7 +66,7 @@ subroutine Merge_Duplicate_Nodes(Grid) ! Do the actuall sorting work ! !---------------------------------! else - if(this_proc < 2) then + if(First_Proc()) then print '(a,i0.0,a)', ' # ', Grid % n_nodes - cnt, ' duplicate nodes' // & ' found; compressing them now!' end if @@ -121,7 +121,7 @@ subroutine Merge_Duplicate_Nodes(Grid) end do end do - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # Done!' end if diff --git a/Sources/Shared/Grid_Mod/Print_Grid_Statistics.f90 b/Sources/Shared/Grid_Mod/Print_Grid_Statistics.f90 index eedc9bcce..0ab27d8e2 100644 --- a/Sources/Shared/Grid_Mod/Print_Grid_Statistics.f90 +++ b/Sources/Shared/Grid_Mod/Print_Grid_Statistics.f90 @@ -14,7 +14,7 @@ subroutine Print_Grid_Statistics(Grid) !------------! ! Header ! !------------! - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #=========================================================' print '(a)', ' #' print '(3a)', ' # Grid ', trim(Grid % name), ' statistics' @@ -27,7 +27,7 @@ subroutine Print_Grid_Statistics(Grid) !------------------! call Grid % Bounding_Box(xmin, ymin, zmin, xmax, ymax, zmax) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' # Bounding box:' print '(2(a,es10.3))', ' # X range: ', xmin, ' to: ', xmax print '(2(a,es10.3))', ' # Y range: ', ymin, ' to: ', ymax @@ -47,7 +47,7 @@ subroutine Print_Grid_Statistics(Grid) max_n_polg = 0 ! maximum number of nodes in polygon do s = 1, Grid % n_faces c1 = Grid % faces_c(1, s) - if(Grid % Comm % cell_proc(c1) .eq. this_proc) then + if(Grid % Comm % cell_proc(c1) .eq. This_Proc()) then n_faces = n_faces + 1 max_n_polg = max(max_n_polg, Grid % faces_n_nodes(s)) if(Grid % faces_s(s) .gt. s) then @@ -63,14 +63,14 @@ subroutine Print_Grid_Statistics(Grid) end if end do - call Comm_Mod_Global_Sum_Int(n_faces) - call Comm_Mod_Global_Sum_Int(n_shadows) - call Comm_Mod_Global_Sum_Int(n_tri) - call Comm_Mod_Global_Sum_Int(n_quad) - call Comm_Mod_Global_Sum_Int(n_polg) - call Comm_Mod_Global_Max_Int(max_n_polg) + call Global % Sum_Int(n_faces) + call Global % Sum_Int(n_shadows) + call Global % Sum_Int(n_tri) + call Global % Sum_Int(n_quad) + call Global % Sum_Int(n_polg) + call Global % Max_Int(max_n_polg) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #- - - - - - - - - - - - - - - - - - - - - - - - - - - -' print '(a,i9)', ' # Number of faces: ', n_faces print '(a,i9)', ' # Number of shadows: ', n_shadows @@ -90,7 +90,7 @@ subroutine Print_Grid_Statistics(Grid) n_quad = 0 n_polg = 0 do c = -Grid % n_bnd_cells, -1 - if(Grid % Comm % cell_proc(c) .eq. this_proc) then + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then n_bnd_cells = n_bnd_cells + 1 if(Grid % cells_n_nodes(c) .eq. 3) then n_tri = n_tri + 1 @@ -110,7 +110,7 @@ subroutine Print_Grid_Statistics(Grid) n_polh = 0 max_n_polh = 0 ! maximum number of nodes in polyhedron do c = 1, Grid % n_cells - if(Grid % Comm % cell_proc(c) .eq. this_proc) then + if(Grid % Comm % cell_proc(c) .eq. This_Proc()) then n_cells = n_cells + 1 if(Grid % cells_n_nodes(c) .eq. 4) then n_tet = n_tet + 1 @@ -127,19 +127,19 @@ subroutine Print_Grid_Statistics(Grid) end if end do - call Comm_Mod_Global_Sum_Int(n_bnd_cells) - call Comm_Mod_Global_Sum_Int(n_cells) - call Comm_Mod_Global_Sum_Int(n_tri) - call Comm_Mod_Global_Sum_Int(n_quad) - call Comm_Mod_Global_Sum_Int(n_polg) - call Comm_Mod_Global_Sum_Int(n_tet) - call Comm_Mod_Global_Sum_Int(n_pyr) - call Comm_Mod_Global_Sum_Int(n_wed) - call Comm_Mod_Global_Sum_Int(n_hex) - call Comm_Mod_Global_Sum_Int(n_polh) - call Comm_Mod_Global_Max_Int(max_n_polh) + call Global % Sum_Int(n_bnd_cells) + call Global % Sum_Int(n_cells) + call Global % Sum_Int(n_tri) + call Global % Sum_Int(n_quad) + call Global % Sum_Int(n_polg) + call Global % Sum_Int(n_tet) + call Global % Sum_Int(n_pyr) + call Global % Sum_Int(n_wed) + call Global % Sum_Int(n_hex) + call Global % Sum_Int(n_polh) + call Global % Max_Int(max_n_polh) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #- - - - - - - - - - - - - - - - - - - - - - - - - - - -' print '(a,i9)', ' # Number of bnd. cells: ', n_bnd_cells print '(a,i9)', ' # Number of inside cells:', n_cells @@ -160,7 +160,7 @@ subroutine Print_Grid_Statistics(Grid) end if end if - if(this_proc < 2) then + if(First_Proc()) then print *, '#---------------------------------------------------------' end if diff --git a/Sources/Shared/Grid_Mod/Print_Bnd_Cond_List.f90 b/Sources/Shared/Grid_Mod/Print_Regions_List.f90 similarity index 55% rename from Sources/Shared/Grid_Mod/Print_Bnd_Cond_List.f90 rename to Sources/Shared/Grid_Mod/Print_Regions_List.f90 index ddd170768..53b4fc9c4 100644 --- a/Sources/Shared/Grid_Mod/Print_Bnd_Cond_List.f90 +++ b/Sources/Shared/Grid_Mod/Print_Regions_List.f90 @@ -1,37 +1,37 @@ !==============================================================================! - subroutine Print_Bnd_Cond_List(Grid) + subroutine Print_Regions_List(Grid) !------------------------------------------------------------------------------! -! Prints a list of boundary conditions in a grid. ! +! Prints a list of regions (boundary conditions) in a grid. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! class(Grid_Type) :: Grid !-----------------------------------[Locals]-----------------------------------! - integer :: j, ll, lc - character(MAX_TOKENS*2) :: bnd_cond_list + integer :: j, ll, lc + character(DL) :: reg_list !==============================================================================! ! Clear the list - bnd_cond_list(:) = ' ' + reg_list(:) = ' ' !--------------------------------------! ! Form the boundary condition list ! !--------------------------------------! ll = 1 - do j = 1, Grid % n_bnd_cond - if(j < Grid % n_bnd_cond) then - lc = len_trim(Grid % bnd_cond % name(j)) + 8 - write(bnd_cond_list(ll:ll+lc), '(i2,a2,a,a4)') & - j, & - '. ', & - trim(Grid % bnd_cond % name(j)), & + do j = 1, Grid % n_bnd_regions + if(j < Grid % n_bnd_regions) then + lc = len_trim(Grid % region % name(j)) + 8 + write(reg_list(ll:ll+lc), '(i2,a2,a,a4)') & + j, & + '. ', & + trim(Grid % region % name(j)), & ' \n ' else - lc = len_trim(Grid % bnd_cond % name(j)) + 4 - write(bnd_cond_list(ll:ll+lc), '(i2,a2,a,a4)') & - j, & - '. ', & - trim(Grid % bnd_cond % name(j)) + lc = len_trim(Grid % region % name(j)) + 4 + write(reg_list(ll:ll+lc), '(i2,a2,a,a4)') & + j, & + '. ', & + trim(Grid % region % name(j)) end if ll = ll + lc + 1 end do @@ -41,6 +41,6 @@ subroutine Print_Bnd_Cond_List(Grid) !-------------------------------! call Message % Framed(20, & "Grid currently has the following boundary conditions:", & - bnd_cond_list(1:ll)) + reg_list(1:ll)) end subroutine diff --git a/Sources/Shared/Grid_Mod/Save_Cfn.f90 b/Sources/Shared/Grid_Mod/Save_Cfn.f90 index 53cb0a0df..e6d5ecdd0 100644 --- a/Sources/Shared/Grid_Mod/Save_Cfn.f90 +++ b/Sources/Shared/Grid_Mod/Save_Cfn.f90 @@ -16,7 +16,7 @@ subroutine Save_Cfn(Grid, & !-----------------------------------[Locals]-----------------------------------! integer :: c, n, i_nod, s, fu, c1, c2, ss, sr integer, allocatable :: faces_n(:) - character(SL) :: name_out + character(SL) :: name_out, str, str1, str2 !==============================================================================! call Profiler % Start('Save_Cfn') @@ -39,15 +39,20 @@ subroutine Save_Cfn(Grid, & !-------------------------! write(fu) RP + !------------------------------! + ! Save version of the file ! + !------------------------------! + write(fu) VERSION_CFN + !-----------------------------------------------! ! Number of cells, boundary cells and faces ! !-----------------------------------------------! write(fu) nn_sub - write(fu) nc_sub ! new way: add buffer cells to cells - write(fu) nbc_sub ! number of boundary cells + write(fu) nc_sub ! new way: add buffer cells to cells + write(fu) nbc_sub ! number of boundary cells write(fu) nf_sub write(fu) ns_sub - write(fu) Grid % n_bnd_cond ! number of bounary conditions + write(fu) Grid % n_bnd_regions ! number of bounary conditions !-------------------------------------! ! Does grid have polyhedral cells ! @@ -62,8 +67,8 @@ subroutine Save_Cfn(Grid, & !------------------------------! ! Boundary conditions list ! !------------------------------! - do n = 1, Grid % n_bnd_cond - write(fu) Grid % bnd_cond % name(n) + do n = Boundary_Regions() + write(fu) Grid % region % name(n) end do !--------------------------! @@ -91,10 +96,11 @@ subroutine Save_Cfn(Grid, & if(Grid % old_c(c) .ne. 0 .or. c .eq. 0) then if(c .ne. 0) then if(Grid % cells_n_nodes(Grid % old_c(c)) .eq. 0) then - print *, '# ERROR: Number of nodes is zero at cell:', Grid % old_c(c) - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_c(c) + call Message % Error(72, & + 'Number of nodes is zero at cell: '//trim(str)//'. '// & + 'This is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end if @@ -114,10 +120,11 @@ subroutine Save_Cfn(Grid, & if(Grid % old_c(c) .ne. 0 .or. c .eq. 0) then do i_nod = 1, abs(Grid % cells_n_nodes(Grid % old_c(c))) if(Grid % new_n(Grid % cells_n(i_nod, Grid % old_c(c))) .eq. 0) then - print *, '# ERROR: Node index is zero at cell:', Grid % old_c(c) - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_c(c) + call Message % Error(72, & + 'Node index is zero at cell: '//trim(str)//'. '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do end if @@ -135,10 +142,11 @@ subroutine Save_Cfn(Grid, & if(Grid % old_c(c) .ne. 0 .or. c .eq. 0) then if(c .ne. 0) then if(Grid % cells_n_faces(Grid % old_c(c)) .eq. 0) then - print *, '# ERROR: Number of faces is zero at cell:', Grid % old_c(c) - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_c(c) + call Message % Error(72, & + 'Number of faces is zero at cell: '//trim(str)//'. '// & + 'This is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end if @@ -158,10 +166,11 @@ subroutine Save_Cfn(Grid, & if(Grid % old_c(c) .ne. 0 .or. c .eq. 0) then do s = 1, Grid % cells_n_faces(Grid % old_c(c)) if(Grid % new_f(Grid % cells_f(s, Grid % old_c(c))) .eq. 0) then - print *, '# ERROR: Face index is zero at cell:', Grid % old_c(c) - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_c(c) + call Message % Error(72, & + 'Face index is zero at cell: '//trim(str)//'. '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do end if @@ -196,10 +205,11 @@ subroutine Save_Cfn(Grid, & do s = 1, Grid % n_faces + Grid % n_shadows if(Grid % old_f(s) .ne. 0) then if(Grid % faces_n_nodes(Grid % old_f(s)) .eq. 0) then - print *, '# ERROR: Number of nodes is zero at face:', Grid % old_f(s) - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_f(s) + call Message % Error(72, & + 'Number of nodes is zero at face: '//trim(str)//'. '// & + 'This is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end do @@ -236,10 +246,11 @@ subroutine Save_Cfn(Grid, & if(Grid % old_f(s) .ne. 0) then do i_nod = 1, Grid % faces_n_nodes(Grid % old_f(s)) if(Grid % new_n(Grid % faces_n(i_nod, Grid % old_f(s))) .eq. 0) then - print *, '# ERROR: Node index is zero at face:', Grid % old_f(s) - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_f(s) + call Message % Error(72, & + 'Node index is zero at face: '//trim(str)//'. '// & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end do end if @@ -279,16 +290,22 @@ subroutine Save_Cfn(Grid, & if(Grid % Comm % cell_proc(c1) .eq. sub .or. & Grid % Comm % cell_proc(c2) .eq. sub) then if(Grid % new_c(c1) .eq. 0) then - print *, '# ERROR: Cell one is zero at face:', s - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_f(s) + write(str1, '(i0.0)') c1; write(str2, '(i0.0)') c2; + call Message % Error(72, & + 'Cell one is zero at face: '//trim(str)//' '// & + 'surrounded by cells '//trim(str1)//' and '//trim(str2) & + //'. \n This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if if(Grid % new_c(c2) .eq. 0) then - print *, '# ERROR: Cell two is zero at face:', s - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + write(str, '(i0.0)') Grid % old_f(s) + write(str1, '(i0.0)') c1; write(str2, '(i0.0)') c2; + call Message % Error(72, & + 'Cell two is zero at face: '//trim(str)//' '// & + 'surrounded by cells '//trim(str1)//' and '//trim(str2) & + //'. \n This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end if @@ -314,10 +331,10 @@ subroutine Save_Cfn(Grid, & if(sr .ne. 0) then ! the saved face (sr) has a shadow (ss) write(fu) Grid % new_f(sr) else - print *, '# ERROR: Shadow faces points to zero face' - print *, '# This error is critical. Exiting!' - call Comm_Mod_End - stop + call Message % Error(72, & + 'Shadow face points to zero face. ' // & + 'This error is critical. Exiting!', & + file=__FILE__, line=__LINE__) end if end if end do @@ -329,7 +346,7 @@ subroutine Save_Cfn(Grid, & ! Physical boundary cells do c = -Grid % n_bnd_cells, -1 if(Grid % old_c(c) .ne. 0) then - write(fu) Grid % bnd_cond % color(Grid % old_c(c)) + write(fu) Grid % region % at_cell(Grid % old_c(c)) end if end do diff --git a/Sources/Shared/Grid_Mod/Save_Debug_Vtu.f90 b/Sources/Shared/Grid_Mod/Save_Debug_Vtu.f90 index d191b7820..ba1d65e56 100644 --- a/Sources/Shared/Grid_Mod/Save_Debug_Vtu.f90 +++ b/Sources/Shared/Grid_Mod/Save_Debug_Vtu.f90 @@ -161,8 +161,10 @@ subroutine Save_Debug_Vtu(Grid, append, & ! Create .vtu file ! ! ! !----------------------! - call File % Set_Name(name_out, appendix='-'//trim(append), & - processor=this_proc, extension='.vtu') + call File % Set_Name(name_out, & + appendix = '-'//trim(append), & + processor = This_Proc(), & + extension = '.vtu') call File % Open_For_Writing_Binary(name_out, fu) !------------! @@ -644,7 +646,7 @@ subroutine Save_Debug_Vtu(Grid, append, & if(.not. allocated(Grid % Comm % cell_proc)) return ! Create it only from subdomain 1, when decomposed - if(maxval(Grid % Comm % cell_proc(:)) > 1 .and. this_proc .eq. 1) then + if(maxval(Grid % Comm % cell_proc(:)) > 1 .and. This_Proc() .eq. 1) then call File% Set_Name(name_out, appendix='-'//trim(append), & extension='.pvtu') @@ -702,7 +704,7 @@ subroutine Save_Debug_Vtu(Grid, append, & write(fu,'(a,a)') IN_2, '' ! Write out the names of all the pieces - do n = 1, n_proc + do n = 1, N_Procs() call File % Set_Name(name_out, appendix='-'//trim(append), & processor=n, extension='.vtu') write(fu, '(a,a,a,a)') IN_2, '' diff --git a/Sources/Shared/Grid_Mod/Save_Dim.f90 b/Sources/Shared/Grid_Mod/Save_Dim.f90 index 27af429be..568c706de 100644 --- a/Sources/Shared/Grid_Mod/Save_Dim.f90 +++ b/Sources/Shared/Grid_Mod/Save_Dim.f90 @@ -25,6 +25,11 @@ subroutine Save_Dim(Grid, sub) !-------------------------! write(fu) RP + !------------------------------! + ! Save version of the file ! + !------------------------------! + write(fu) VERSION_DIM + !----------------------! ! Node coordinates ! !----------------------! diff --git a/Sources/Shared/Grid_Mod/Save_Vtk_Cell.f90 b/Sources/Shared/Grid_Mod/Save_Vtk_Cell.f90 new file mode 100644 index 000000000..aaa354644 --- /dev/null +++ b/Sources/Shared/Grid_Mod/Save_Vtk_Cell.f90 @@ -0,0 +1,86 @@ +!==============================================================================! + subroutine Save_Vtk_Cell(Grid, c, head, rank) +!------------------------------------------------------------------------------! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type) :: Grid + integer, intent(in) :: c + character(*) :: head + integer, intent(in) :: rank +!-----------------------------------[Locals]-----------------------------------! + integer :: fu, i_nod, l_nod, n, i_fac, s, ndata, npoly + character(len=SL) :: filename + integer, allocatable :: local_node(:) +!==============================================================================! + + allocate(local_node(Grid % n_nodes)) + local_node(:) = 0 + + write(filename,'(a,"-",i9.9,".vtk")') trim(head), rank + + open(newunit=fu, file=filename) + write(fu,'(a26)') '# vtk DataFile Version 2.0' + write(fu,'(a6,i7.7)') 'File: ', rank + write(fu,'(a5)') 'ASCII' + write(fu,*) ' ' + write(fu,'(a16)') 'DATASET POLYDATA' + + ! Write the points out + write(fu,'(a6,i7,a6)') 'POINTS', abs(Grid % cells_n_nodes(c)), ' float' + l_nod = 0 + do i_nod = 1, abs(Grid % cells_n_nodes(c)) + n = Grid % cells_n(i_nod, c) + write(fu,'(3es15.6)') Grid % xn(n), Grid % yn(n), Grid % zn(n) + l_nod = l_nod + 1 + local_node(n) = l_nod + end do + + ! Count the polygons and data + npoly = 0 + ndata = 0 + do i_fac = 1, Grid % cells_n_faces(c) + s = Grid % cells_f(i_fac, c) + npoly = npoly + 1 + ndata = ndata + Grid % faces_n_nodes(s) + 1 + end do + + ! Write polygons and data out + write(fu,'(a8,i7,i7)') 'POLYGONS', npoly, ndata + do i_fac = 1, Grid % cells_n_faces(c) + s = Grid % cells_f(i_fac, c) + write(fu,'(i5)') Grid % faces_n_nodes(s) + do i_nod = 1, Grid % faces_n_nodes(s) + n = Grid % faces_n(i_nod, s) + write(fu,'(i7)') local_node(n) - 1 + end do + end do + + ! Beginning of face data + write(fu,'(a9,i7)') 'CELL_DATA', npoly + + ! Write out the face local number + write(fu,'(a24)') 'SCALARS face_local int 1' + write(fu,'(a20)') 'LOOKUP_TABLE default' + do i_fac = 1, Grid % cells_n_faces(c) + write(fu,'(i9)') i_fac + end do + + ! Write out the face global number + write(fu,'(a25)') 'SCALARS face_global int 1' + write(fu,'(a20)') 'LOOKUP_TABLE default' + do i_fac = 1, Grid % cells_n_faces(c) + write(fu,'(i9)') Grid % cells_f(i_fac, c) + end do + + ! Write out the face surface vectors + write(fu,'(a25)') 'SCALARS face_surf float 3' + write(fu,'(a20)') 'LOOKUP_TABLE default' + do i_fac = 1, Grid % cells_n_faces(c) + s = Grid % cells_f(i_fac, c) + write(fu,'(3es15.6)') Grid % sx(s), Grid % sy(s), Grid % sz(s) + end do + + close(fu) + + end diff --git a/Sources/Shared/Grid_Mod/Save_Vtk_Face.f90 b/Sources/Shared/Grid_Mod/Save_Vtk_Face.f90 new file mode 100644 index 000000000..d1aa8d30a --- /dev/null +++ b/Sources/Shared/Grid_Mod/Save_Vtk_Face.f90 @@ -0,0 +1,48 @@ +!==============================================================================! + subroutine Save_Vtk_Face(Grid, s, head, rank) +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Grid_Type) :: Grid + integer, intent(in) :: s + character(*) :: head + integer, intent(in) :: rank +!-----------------------------------[Locals]-----------------------------------! + integer :: i_nod, n, fu + character(len=80) :: filename ! don't use SL for separate compilation +!==============================================================================! + + write(filename,'(a,"-",i9.9,".vtk")') trim(head), rank + + open(newunit=fu, file=filename) + write(fu,'(a26)') '# vtk DataFile Version 2.0' + write(fu,'(a6,i7.7)') 'File: ', s + write(fu,'(a5)') 'ASCII' + write(fu,*) ' ' + write(fu,'(a16)') 'DATASET POLYDATA' + + ! Write the points out + write(fu,'(a6,i7,a6)') 'POINTS', Grid % faces_n_nodes(s), ' float' + do i_nod = 1, Grid % faces_n_nodes(s) + n = Grid % faces_n(i_nod, s) + write(fu,'(3es15.6)') Grid % xn(n), Grid % yn(n), Grid % zn(n) + end do + + ! Write polygons and data out + write(fu,'(a8,i7,i7)') 'POLYGONS', 1, Grid % faces_n_nodes(s) + 1 + write(fu,'(i7)') Grid % faces_n_nodes(s) + do i_nod = 1, Grid % faces_n_nodes(s) + write(fu,'(i7)') i_nod-1 + end do + + ! Beginning of face data + write(fu,'(a9,i7)') 'CELL_DATA', 1 + + ! Write out the face surface vectors + write(fu,'(a25)') 'SCALARS face_surf float 3' + write(fu,'(a20)') 'LOOKUP_TABLE default' + write(fu,'(3es15.6)') Grid % sx(s), Grid % sy(s), Grid % sz(s) + + close(fu) + + end diff --git a/Sources/Shared/Grid_Mod/Save_Vtu_Cells.f90 b/Sources/Shared/Grid_Mod/Save_Vtu_Cells.f90 index 532a82958..8a5151155 100644 --- a/Sources/Shared/Grid_Mod/Save_Vtu_Cells.f90 +++ b/Sources/Shared/Grid_Mod/Save_Vtu_Cells.f90 @@ -142,42 +142,61 @@ subroutine Save_Vtu_Cells(Grid, sub, n_nodes_sub, n_cells_sub) !---------------! write(fu) IN_3 // '' // LF - ! Processor i.d. + ! Cell processor write(str1, '(i0.0)') data_offset - write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF + data_offset = data_offset + SP + n_cells_sub * IP ! prepare for next + + ! Cell thread + write(str1, '(i0.0)') data_offset + write(fu) IN_4 // '' // LF write(fu) IN_4 // '' // LF data_offset = data_offset + SP + n_cells_sub * IP ! prepare for next ! Number of nodes write(str1, '(i0.0)') data_offset - write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF write(fu) IN_4 // '' // LF data_offset = data_offset + SP + n_cells_sub * IP ! prepare for next ! Wall distance write(str1, '(i0.0)') data_offset - write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF write(fu) IN_4 // '' // LF data_offset = data_offset + SP + n_cells_sub * RP ! prepare for next ! Cell volume write(str1, '(i0.0)') data_offset - write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF write(fu) IN_4 // '' // LF data_offset = data_offset + SP + n_cells_sub * RP ! prepare for next + ! Cell inertia + write(str1, '(i0.0)') data_offset + write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF + data_offset = data_offset + SP + n_cells_sub * RP * 6 ! prepare for next + !------------! ! ! ! Footer ! @@ -314,7 +333,7 @@ subroutine Save_Vtu_Cells(Grid, sub, n_nodes_sub, n_cells_sub) ! Cell data ! !---------------! - ! Processor i.d. + ! Cell processor data_size = int(n_cells_sub * IP, SP) write(fu) data_size do c = 1, Grid % n_cells @@ -323,6 +342,15 @@ subroutine Save_Vtu_Cells(Grid, sub, n_nodes_sub, n_cells_sub) end if end do + ! Cell thread + data_size = int(n_cells_sub * IP, SP) + write(fu) data_size + do c = 1, Grid % n_cells + if(Grid % new_c(c) .ne. 0) then + write(fu) Grid % Vect % cell_thread(c) + end if + end do + ! Number of nodes data_size = int(n_cells_sub * IP, SP) write(fu) data_size @@ -350,6 +378,16 @@ subroutine Save_Vtu_Cells(Grid, sub, n_nodes_sub, n_cells_sub) end if end do + ! Cell inertia + data_size = int(n_cells_sub * RP * 6, SP) + write(fu) data_size + do c = 1, Grid % n_cells + if(Grid % new_c(c) .ne. 0) then + write(fu) Grid % ixx(c), Grid % iyy(c), Grid % izz(c), & + Grid % ixy(c), Grid % iyz(c), Grid % ixz(c) + end if + end do + write(fu) LF // IN_0 // '' // LF write(fu) IN_0 // '' // LF @@ -381,11 +419,13 @@ subroutine Save_Vtu_Cells(Grid, sub, n_nodes_sub, n_cells_sub) ! Data section is not mandatory, but very useful write(fu,'(a,a)') IN_2, '' write(fu,'(a,a)') IN_3, '' + ' Name="Grid Processor [1]"/>' + write(fu,'(a,a)') IN_3, '' write(fu,'(a,a)') IN_3, '' + ' Name="Grid Wall Distance [m]"/>' write(fu,'(a,a)') IN_3, '' + ' Name="Grid Cell Volume [m^3]"/>' write(fu,'(a,a)') IN_2, '' ! Write out the names of all the pieces diff --git a/Sources/Shared/Grid_Mod/Save_Vtu_Faces.f90 b/Sources/Shared/Grid_Mod/Save_Vtu_Faces.f90 index bcba08191..1a1f1c2d4 100644 --- a/Sources/Shared/Grid_Mod/Save_Vtu_Faces.f90 +++ b/Sources/Shared/Grid_Mod/Save_Vtu_Faces.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Save_Vtu_Faces(Grid, plot_shadows, phi_f) + subroutine Save_Vtu_Faces(Grid, plot_shadows, real_phi_f, int_phi_f) !------------------------------------------------------------------------------! ! Writes boundary condition .faces.vtu or shadow .shadow.vtu file. ! !------------------------------------------------------------------------------! @@ -7,7 +7,8 @@ subroutine Save_Vtu_Faces(Grid, plot_shadows, phi_f) !---------------------------------[Arguments]----------------------------------! class(Grid_Type) :: Grid logical, optional :: plot_shadows ! plot shadow faces - real, optional :: phi_f(1:Grid % n_faces) + real, optional :: real_phi_f(1:Grid % n_faces) + integer, optional :: int_phi_f (1:Grid % n_faces) !-----------------------------------[Locals]-----------------------------------! integer(SP) :: data_size integer :: c2, n, s, s_f, s_l, cell_offset, data_offset, n_conns, fu @@ -51,7 +52,9 @@ subroutine Save_Vtu_Faces(Grid, plot_shadows, phi_f) !------------------------! ! Open the .vtu file ! !------------------------! - call File % Set_Name(name_out, processor=this_proc, extension=trim(ext)) + call File % Set_Name(name_out, & + processor = This_Proc(), & + extension = trim(ext)) call File % Open_For_Writing_Binary(name_out, fu) !------------! @@ -134,17 +137,28 @@ subroutine Save_Vtu_Faces(Grid, plot_shadows, phi_f) write(fu) IN_4 // '' // LF data_offset = data_offset + SP + (s_l-s_f+1) * IP ! prepare for next - ! Optional face variable - if(present(phi_f)) then + ! Optional real face variable + if(present(real_phi_f)) then write(str1, '(i0.0)') data_offset write(fu) IN_4 // '' // LF write(fu) IN_4 // '' // LF data_offset = data_offset + SP + (s_l-s_f+1) * RP ! prepare for next end if + ! Optional integer face variable + if(present(int_phi_f)) then + write(str1, '(i0.0)') data_offset + write(fu) IN_4 // '' // LF + write(fu) IN_4 // '' // LF + data_offset = data_offset + SP + (s_l-s_f+1) * IP ! prepare for next + end if + ! Number of nodes write(str1, '(i0.0)') data_offset write(fu) IN_4 // ' n_threads + cell (c) = c + Grid % old_c(c) = c + end do + + !--------------------------------------------------! + ! Sort new numbers according to three criteria ! + !--------------------------------------------------! + call Sort % Two_Int_Carry_Int(thread(1:Grid % n_cells), & + cell (1:Grid % n_cells), & + Grid % old_c(1:Grid % n_cells)) + + ! Check if buffers stayed untouched + do c = Cells_In_Buffers() + Assert(Grid % old_c(c) .eq. c) + end do + + ! This is a bit of a bluff + do c = 1, Grid % n_cells + Grid % new_c(Grid % old_c(c)) = c + end do + + !----------------------------------! + ! Update cell numbers at faces ! + !----------------------------------! + do s = 1, Grid % n_faces + Grid % n_shadows + c1 = Grid % faces_c(1, s) + c2 = Grid % faces_c(2, s) + Grid % faces_c(1, s) = Grid % new_c(c1) + if(c2 > 0) then + Grid % faces_c(2, s) = Grid % new_c(c2) + + ! If the face changed its orientation during cell renumeration + if(Grid % faces_c(2, s) < Grid % faces_c(1, s)) then + + ! Swap c1 and c2 of course ... + call Swap_Int(Grid % faces_c(1, s), Grid % faces_c(2, s)) + + ! ...but also reverse the order of face's nodes ... + n = Grid % faces_n_nodes(s) ! number of nodes in this face + call Sort % Reverse_Order_Int(Grid % faces_n(1:n, s)) + + ! ... and fix the geometrical quantities + Grid % sx(s) = -Grid % sx(s) + Grid % sy(s) = -Grid % sy(s) + Grid % sz(s) = -Grid % sz(s) + Grid % dx(s) = -Grid % dx(s) + Grid % dy(s) = -Grid % dy(s) + Grid % dz(s) = -Grid % dz(s) + Grid % f (s) = 1.0 - Grid % f(s) + end if + end if + end do + + !-----------------------------------------------! + ! Do the sorting of data pertinent to cells ! + !-----------------------------------------------! + do c = 1, Grid % n_cells + Grid % cells_n_nodes(Grid % new_c(c)) = old_nn (c) + Grid % cells_n(1:mcn,Grid % new_c(c)) = old_nodes(1:mcn, c) + Grid % cells_n_faces(Grid % new_c(c)) = old_nf (c) + Grid % cells_f(1:mcf,Grid % new_c(c)) = old_faces(1:mcf, c) + Grid % cells_n_cells(Grid % new_c(c)) = old_nc (c) + Grid % cells_c(1:mcc,Grid % new_c(c)) = old_cells(1:mcc, c) + end do + nc = Grid % n_cells ! abbreviate the syntax + call Sort % Real_By_Index(nc, Grid % xc (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % yc (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % zc (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % vol (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % ixx (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % iyy (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % izz (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % ixy (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % ixz (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % iyz (1), Grid % new_c(1)) + call Sort % Real_By_Index(nc, Grid % wall_dist (1), Grid % new_c(1)) + call Sort % Int_By_Index (nc, Grid % Vect % cell_thread(1), Grid % new_c(1)) + call Sort % Int_By_Index (nc, Grid % Comm % cell_glo (1), Grid % new_c(1)) + call Sort % Int_By_Index (nc, Grid % Comm % cell_proc (1), Grid % new_c(1)) + + !-----------------------------! + ! Check processor numbers ! + !-----------------------------! + do c = 1, Grid % n_cells + Assert(old_proc(c) .eq. Grid % Comm % cell_proc(c)) + end do + + end subroutine diff --git a/Sources/Shared/Grid_Mod/Sort_Faces_Smart.f90 b/Sources/Shared/Grid_Mod/Sort_Faces_By_Region.f90 similarity index 84% rename from Sources/Shared/Grid_Mod/Sort_Faces_Smart.f90 rename to Sources/Shared/Grid_Mod/Sort_Faces_By_Region.f90 index ae94d87a9..051df14f0 100644 --- a/Sources/Shared/Grid_Mod/Sort_Faces_Smart.f90 +++ b/Sources/Shared/Grid_Mod/Sort_Faces_By_Region.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Sort_Faces_Smart(Grid) + subroutine Sort_Faces_By_Region(Grid) !------------------------------------------------------------------------------! ! Sorts array of faces in a smart way. That would mean boundary faces ! ! first, boundary region by boundary region, then inside faces, then ! @@ -10,12 +10,11 @@ subroutine Sort_Faces_Smart(Grid) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Grid_Type) :: Grid + class(Grid_Type), intent(inout) :: Grid !------------------------------[Local parameters]------------------------------! - integer, parameter :: BIG = 2147483647 ! Euler's prime number - logical, parameter :: VERBOSE = .false. + logical, parameter :: DEBUG = .false. !-----------------------------------[Locals]-----------------------------------! - integer :: s, m, n, c, c1, c2, n_bc, color + integer :: s, m, n, c, c1, c2, n_bc, reg integer :: max_diff_1, max_diff_2, c1_s1, c2_s1, c1_s2, c2_s2 integer, allocatable :: old_nn (:) integer, allocatable :: old_shad(:) @@ -34,7 +33,7 @@ subroutine Sort_Faces_Smart(Grid) !--------------------------------------------------------! ! Form the three criteria: ! - ! 1 - the strongest is boundary condition color; to ! + ! 1 - the strongest is boundary condition region; to ! ! sort faces by boundary condition colors first ! ! 2 - the second on the list is cell number, so that ! ! inside cells are later browsed in a straight- ! @@ -45,14 +44,10 @@ subroutine Sort_Faces_Smart(Grid) do s = 1, Grid % n_faces c1 = Grid % faces_c(1, s) c2 = Grid % faces_c(2, s) + criteria(s,1) = HUGE_INT + if(c2 < 0) criteria(s,1) = Grid % region % at_cell(c2) criteria(s,2) = c1 criteria(s,3) = c2 - if(c2 > 0) then - criteria(s,1) = BIG ! make sure that inside faces end up last - else - criteria(s,1) = Grid % bnd_cond % color(c2) - criteria(s,3) = -criteria(s,3) - end if Grid % old_f(s) = s end do @@ -74,27 +69,32 @@ subroutine Sort_Faces_Smart(Grid) Grid % faces_c(1,s) = criteria(s,2) Grid % faces_c(2,s) = criteria(s,3) + c2 = criteria(s,3) + ! ... but renumber c2 if on the boundary - if(criteria(s,1) .ne. BIG) then ! on the boundary - n_bc = n_bc + 1 ! increase the count - Grid % faces_c(2,s) = -n_bc ! set face_c properly - Grid % old_c(-n_bc) = -criteria(s,3) ! store the old number - else + if(criteria(s,1) .ne. HUGE_INT) then ! on the boundary + Grid % faces_c(2,s) = -Grid % n_bnd_cells + n_bc ! set face_c properly + Grid % old_c(-Grid % n_bnd_cells + n_bc) = c2 ! store the old number + n_bc = n_bc + 1 ! increase the count end if + end do + ! Check if counting ended well + Assert(n_bc == Grid % n_bnd_cells) + !------------------------------------------------------! ! Using the old boundary cell number, retreive ! ! their boundary colors and geometrical quantities ! !------------------------------------------------------! do c=-1, -Grid % n_bnd_cells, -1 - old_nn ( -c) = Grid % bnd_cond % color(Grid % old_c(c)) ! use old_nn ... + old_nn ( -c) = Grid % region % at_cell(Grid % old_c(c)) ! use old_nn ... old_bxyz(1,c) = Grid % xc(Grid % old_c(c)) ! ... for colors old_bxyz(2,c) = Grid % yc(Grid % old_c(c)) old_bxyz(3,c) = Grid % zc(Grid % old_c(c)) end do do c=-1, -Grid % n_bnd_cells, -1 - Grid % bnd_cond % color(c) = old_nn (-c) + Grid % region % at_cell(c) = old_nn(-c) Grid % xc(c) = old_bxyz(1,c) Grid % yc(c) = old_bxyz(2,c) Grid % zc(c) = old_bxyz(3,c) @@ -163,21 +163,22 @@ subroutine Sort_Faces_Smart(Grid) end do end do - ! Find boundary color ranges - call Bnd_Cond_Ranges(Grid) + ! Find boundary reg ranges + call Grid % Determine_Regions_Ranges() - if(VERBOSE) then + if(DEBUG) then + print '(a)', 's, c1, c2, Grid % region % at_cell(c2)' do s = 1, Grid % n_faces c1 = Grid % faces_c(1, s) c2 = Grid % faces_c(2, s) if(c2 < 0) then - print '(4i6)', s, c1, c2, Grid % bnd_cond % color(c2) + print '(4i12)', s, c1, c2, Grid % region % at_cell(c2) end if end do - do color = 1, Grid % n_bnd_cond - print '(2i6)', Grid % bnd_cond % color_s_cell(color), & - Grid % bnd_cond % color_e_cell(color) + do reg = Boundary_Regions() + print '(a)', 'Cells_In_Region(reg)' + print '(2i12)', Cells_In_Region(reg) end do end if @@ -201,7 +202,10 @@ subroutine Sort_Faces_Smart(Grid) end if end if end do + + print '(a)', ' #==========================================================' print '(a)', ' # In Sort_Faces_Smart' + print '(a)', ' #----------------------------------------------------------' print '(a,i9)', ' # Maximum cell difference at single face: ', max_diff_1 print '(a,i9)', ' # Maximum cell difference betwen two faces: ', max_diff_2 diff --git a/Sources/Shared/Grid_Mod/Write_Template_Control_File.f90 b/Sources/Shared/Grid_Mod/Write_Template_Control_File.f90 index 3dea24607..f158c47ca 100644 --- a/Sources/Shared/Grid_Mod/Write_Template_Control_File.f90 +++ b/Sources/Shared/Grid_Mod/Write_Template_Control_File.f90 @@ -51,8 +51,8 @@ subroutine Write_Template_Control_File(Grid) write(fu,'(a)') '# "eps", "zeta" and "f22"' write(fu,'(a)') '#-----------------------------------------------------------' - do j = 1, Grid % n_bnd_cond - work = Grid % bnd_cond % name(j) + do j = Boundary_Regions() + work = Grid % region % name(j) call String % To_Lower_Case(work) write(fu,'(a,a)') ' BOUNDARY_CONDITION ', trim(work) write(fu,'(a)') ' TYPE wall (or: ' // & diff --git a/Sources/Shared/Isoap_Mod.f90 b/Sources/Shared/Isoap_Mod.f90 index 8c105cbad..54753d5b1 100644 --- a/Sources/Shared/Isoap_Mod.f90 +++ b/Sources/Shared/Isoap_Mod.f90 @@ -17,6 +17,9 @@ module Isoap_Mod implicit none !==============================================================================! + ! Parameters used inside the module + integer, parameter :: NS=200, NV=240 + !----------------! ! Isoap type ! !----------------! diff --git a/Sources/Shared/Isoap_Mod/Dim_Polyhedron.h b/Sources/Shared/Isoap_Mod/Dim_Polyhedron.h deleted file mode 100644 index 07c662f31..000000000 --- a/Sources/Shared/Isoap_Mod/Dim_Polyhedron.h +++ /dev/null @@ -1 +0,0 @@ - integer, parameter :: NS=200, NV=240 diff --git a/Sources/Shared/Isoap_Mod/Extract_Iso_Polygons.f90 b/Sources/Shared/Isoap_Mod/Extract_Iso_Polygons.f90 index 2e31f9666..1bdfc3858 100644 --- a/Sources/Shared/Isoap_Mod/Extract_Iso_Polygons.f90 +++ b/Sources/Shared/Isoap_Mod/Extract_Iso_Polygons.f90 @@ -3,17 +3,14 @@ subroutine Extract_Iso_Polygons(Isoap, Grid, cell, phi_n) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Isoap_Type) :: Isoap - type(Grid_Type) :: Grid - integer, intent(in) :: cell - real :: phi_n(:) + class(Isoap_Type), intent(out) :: Isoap + type(Grid_Type), target, intent(in) :: Grid + integer, intent(in) :: cell + real, optional, intent(in) :: phi_n(:) !------------------------------[Local parameters]------------------------------! logical, parameter :: DEBUG = .false. ! if true, a lot of files are created !-----------------------------------[Locals]-----------------------------------! integer, pointer, contiguous :: glo(:) - integer :: local_face_nodes(MAX_ISOAP_VERTS) - integer :: i_nod, i_fac, i_ver, i_iso, l_nod - integer :: s, n, faces_n_nodes !==============================================================================! ! Take alias for global cell numbers diff --git a/Sources/Shared/Isoap_Mod/Isopol.f90 b/Sources/Shared/Isoap_Mod/Isopol.f90 index 84bb5027b..bb7c8f243 100644 --- a/Sources/Shared/Isoap_Mod/Isopol.f90 +++ b/Sources/Shared/Isoap_Mod/Isopol.f90 @@ -35,8 +35,6 @@ SUBROUTINE ISOPOL(ISOAP, & NTS) !---------------------------------------------------------------------! IMPLICIT NONE -!---------------------------------------------------------------------! - INCLUDE "Isoap_Mod/Dim_Polyhedron.h" ! holds NS and NV !---------------------------------------------------------------------! CLASS(ISOAP_TYPE) :: ISOAP INTEGER, INTENT(IN) :: IA(NV) @@ -57,6 +55,8 @@ SUBROUTINE ISOPOL(ISOAP, & IPINI,IPISE(NV,2),IPMARK(NV),IPNEW,IS,IS1,ISCUT(NS), & ISE(NS,NV),ISNEW,ITYPE,IV,IV1,IVISE(NS,NV),IVNEW,IVNEWT, & NEDGE(NS),NINT,NIPNEW,NISCUT,NIV,NIVNEW +!* Avoid unused warning + ASSOCIATE(ISOAP => ISOAP); END ASSOCIATE !* Determination of the faces intersected by the isosurface NISCUT=0 !* NEDGE(IS) = Number of intersected edges of the face IS diff --git a/Sources/Shared/Isoap_Mod/Main_Isoap.f90 b/Sources/Shared/Isoap_Mod/Main_Isoap.f90 index baea95ce3..9040726d4 100644 --- a/Sources/Shared/Isoap_Mod/Main_Isoap.f90 +++ b/Sources/Shared/Isoap_Mod/Main_Isoap.f90 @@ -25,8 +25,6 @@ SUBROUTINE MAIN_ISOAP(ISOAP, POLYHEDRON, ISO_POLYGONS) !---------------------------------------------------------------------! IMPLICIT NONE -!---------------------------------------------------------------------! - INCLUDE "Isoap_Mod/Dim_Polyhedron.h" ! holds NS and NV !---------------------------------------------------------------------! CLASS(ISOAP_TYPE) :: ISOAP TYPE(POLYHEDRON_TYPE), TARGET :: POLYHEDRON diff --git a/Sources/Shared/Math_Mod.f90 b/Sources/Shared/Math_Mod.f90 index 4e1b47079..c31b75228 100644 --- a/Sources/Shared/Math_Mod.f90 +++ b/Sources/Shared/Math_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Unused.h90" + !==============================================================================! module Math_Mod !------------------------------------------------------------------------------! diff --git a/Sources/Shared/Math_Mod/Approx_Real.f90 b/Sources/Shared/Math_Mod/Approx_Real.f90 index a04f2cf48..af43c26d4 100644 --- a/Sources/Shared/Math_Mod/Approx_Real.f90 +++ b/Sources/Shared/Math_Mod/Approx_Real.f90 @@ -13,6 +13,8 @@ pure logical function Approx_Real(Math, a, b, tol) real, optional, intent(in) :: tol !-----------------------------------[Locals]-----------------------------------! real :: tolerance +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! if( .not. present(tol) ) then diff --git a/Sources/Shared/Math_Mod/Approx_String.f90 b/Sources/Shared/Math_Mod/Approx_String.f90 index f9cd78095..063bbd6dc 100644 --- a/Sources/Shared/Math_Mod/Approx_String.f90 +++ b/Sources/Shared/Math_Mod/Approx_String.f90 @@ -14,6 +14,8 @@ pure logical function Approx_String(Math, s, t, tol) !-----------------------------------[Locals]-----------------------------------! integer :: i, j, m, n, cost, tolerance integer, allocatable :: d(:,:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! if( .not. present(tol) ) then diff --git a/Sources/Shared/Math_Mod/Cross_Product.f90 b/Sources/Shared/Math_Mod/Cross_Product.f90 index 8c1ae12ed..b2cf357de 100644 --- a/Sources/Shared/Math_Mod/Cross_Product.f90 +++ b/Sources/Shared/Math_Mod/Cross_Product.f90 @@ -9,6 +9,8 @@ pure function Cross_Product(Math, a, b) class(Math_Type), intent(in) :: Math real, dimension(3) :: Cross_Product real, dimension(3), intent(in) :: a, b +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! Cross_Product(1) = a(2) * b(3) - a(3) * b(2) diff --git a/Sources/Shared/Math_Mod/Distance.f90 b/Sources/Shared/Math_Mod/Distance.f90 index d3e787d76..61994656d 100644 --- a/Sources/Shared/Math_Mod/Distance.f90 +++ b/Sources/Shared/Math_Mod/Distance.f90 @@ -1,14 +1,16 @@ -!======================================================================! +!==============================================================================! pure real function Distance(Math, x_a, y_a, z_a, & x_b, y_b, z_b) -!----------------------------------------------------------------------! -! Calculates distance between two points in three-dimensional space. ! -!----------------------------------------------------------------------! +!------------------------------------------------------------------------------! +! Calculates distance between two points in three-dimensional space. ! +!------------------------------------------------------------------------------! implicit none -!-----------------------------[Arguments]------------------------------! +!---------------------------------[Arguments]----------------------------------! class(Math_Type), intent(in) :: Math real, intent(in) :: x_a, y_a, z_a, x_b, y_b, z_b -!======================================================================! +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) +!==============================================================================! Distance = sqrt( (x_a-x_b)*(x_a-x_b) & + (y_a-y_b)*(y_a-y_b) & diff --git a/Sources/Shared/Math_Mod/Distance_Squared.f90 b/Sources/Shared/Math_Mod/Distance_Squared.f90 index ca937cdd0..eb6e0b214 100644 --- a/Sources/Shared/Math_Mod/Distance_Squared.f90 +++ b/Sources/Shared/Math_Mod/Distance_Squared.f90 @@ -1,14 +1,16 @@ -!======================================================================! +!==============================================================================! pure real function Distance_Squared(Math, x_a, y_a, z_a, & x_b, y_b, z_b) -!----------------------------------------------------------------------! -! Calculates squared distance between two points in three-dimensions. ! -!----------------------------------------------------------------------! +!------------------------------------------------------------------------------! +! Calculates squared distance between two points in three-dimensions. ! +!------------------------------------------------------------------------------! implicit none -!-----------------------------[Arguments]------------------------------! +!---------------------------------[Arguments]----------------------------------! class(Math_Type), intent(in) :: Math real, intent(in) :: x_a, y_a, z_a, x_b, y_b, z_b -!======================================================================! +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) +!==============================================================================! Distance_Squared = (x_a-x_b)*(x_a-x_b) & + (y_a-y_b)*(y_a-y_b) & diff --git a/Sources/Shared/Math_Mod/Fit_Exp_Three_Points.f90 b/Sources/Shared/Math_Mod/Fit_Exp_Three_Points.f90 index ef1a1056a..96c9f258f 100644 --- a/Sources/Shared/Math_Mod/Fit_Exp_Three_Points.f90 +++ b/Sources/Shared/Math_Mod/Fit_Exp_Three_Points.f90 @@ -63,6 +63,8 @@ subroutine Fit_Exp_Three_Points(Math, & !-----------------------------------[Locals]-----------------------------------! integer :: i, j, k real :: a, b, c, d, b_array(N_SAMPLES), e_array(N_SAMPLES) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(x0) ! x0 is kept for symmetry with sister procedure !==============================================================================! !-----------------------------! diff --git a/Sources/Shared/Math_Mod/Gaussian_Elimination.f90 b/Sources/Shared/Math_Mod/Gaussian_Elimination.f90 index 56b5a4f26..a7782779d 100644 --- a/Sources/Shared/Math_Mod/Gaussian_Elimination.f90 +++ b/Sources/Shared/Math_Mod/Gaussian_Elimination.f90 @@ -23,6 +23,8 @@ pure subroutine Gaussian_Elimination(Math, n, a, b, x, invertible) integer, allocatable :: p(:) real :: r, rmax, smax, sum, z integer :: i, k, j, pk +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! allocate(s(n)) diff --git a/Sources/Shared/Math_Mod/Harmonic_Mean.f90 b/Sources/Shared/Math_Mod/Harmonic_Mean.f90 index aea41c309..dd8af6cb2 100644 --- a/Sources/Shared/Math_Mod/Harmonic_Mean.f90 +++ b/Sources/Shared/Math_Mod/Harmonic_Mean.f90 @@ -7,6 +7,8 @@ pure real function Harmonic_Mean(Math, a, b) !---------------------------------[Arguments]----------------------------------! class(Math_Type), intent(in) :: Math real, intent(in) :: a, b +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! Harmonic_Mean = 2.0 / (1.0 / a + 1.0 / b) diff --git a/Sources/Shared/Math_Mod/Invert_3x3_Matrix.f90 b/Sources/Shared/Math_Mod/Invert_3x3_Matrix.f90 index c8afe90e5..979985c20 100644 --- a/Sources/Shared/Math_Mod/Invert_3x3_Matrix.f90 +++ b/Sources/Shared/Math_Mod/Invert_3x3_Matrix.f90 @@ -11,6 +11,8 @@ pure subroutine Invert_3x3_Matrix(Math, a, det) !-----------------------------------[Locals]-----------------------------------! real :: b(3,3) integer :: i +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! det = a(1,1)*(a(2,2)*a(3,3)-a(2,3)*a(3,2)) & diff --git a/Sources/Shared/Math_Mod/Rotate_Vector.f90 b/Sources/Shared/Math_Mod/Rotate_Vector.f90 index a9f28abc3..db82ce2a1 100644 --- a/Sources/Shared/Math_Mod/Rotate_Vector.f90 +++ b/Sources/Shared/Math_Mod/Rotate_Vector.f90 @@ -13,6 +13,8 @@ pure function Rotate_Vector(Math, v, k, theta) !-----------------------------------[Locals]-----------------------------------! real :: k_dot_v real :: k_vec_v(3) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! k_dot_v = dot_product(k(1:3), v(1:3)) diff --git a/Sources/Shared/Math_Mod/Set_Array_Range.f90 b/Sources/Shared/Math_Mod/Set_Array_Range.f90 index f1470a33e..e35ecfc17 100644 --- a/Sources/Shared/Math_Mod/Set_Array_Range.f90 +++ b/Sources/Shared/Math_Mod/Set_Array_Range.f90 @@ -10,6 +10,8 @@ pure subroutine Set_Array_Range(Math, n, minv, maxv, array) !-----------------------------------[Locals]-----------------------------------! integer :: i real :: delta +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! array(1) = minv diff --git a/Sources/Shared/Math_Mod/Signed_Lower_Limit.f90 b/Sources/Shared/Math_Mod/Signed_Lower_Limit.f90 index be2db3914..983cc7d6a 100644 --- a/Sources/Shared/Math_Mod/Signed_Lower_Limit.f90 +++ b/Sources/Shared/Math_Mod/Signed_Lower_Limit.f90 @@ -8,6 +8,8 @@ pure real function Signed_Lower_Limit(Math, a, limit) class(Math_Type), intent(in) :: Math real, intent(in) :: a real, intent(in) :: limit ! lower limit, usually a small number +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! ! Assume it won't change diff --git a/Sources/Shared/Math_Mod/Signed_Upper_Limit.f90 b/Sources/Shared/Math_Mod/Signed_Upper_Limit.f90 index d565e4334..d246a74f0 100644 --- a/Sources/Shared/Math_Mod/Signed_Upper_Limit.f90 +++ b/Sources/Shared/Math_Mod/Signed_Upper_Limit.f90 @@ -8,6 +8,8 @@ pure real function Signed_Upper_Limit(Math, a, limit) class(Math_Type), intent(in) :: Math real, intent(in) :: a real, intent(in) :: limit ! upper limit, usually a big number +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! ! Assume it won't change diff --git a/Sources/Shared/Math_Mod/Smaller_Real.f90 b/Sources/Shared/Math_Mod/Smaller_Real.f90 index e5f9631ff..b171fe777 100644 --- a/Sources/Shared/Math_Mod/Smaller_Real.f90 +++ b/Sources/Shared/Math_Mod/Smaller_Real.f90 @@ -13,6 +13,8 @@ pure logical function Smaller_Real(Math, a, b, tol) real, optional, intent(in) :: tol !-----------------------------------[Locals]-----------------------------------! real :: tolerance +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) !==============================================================================! if( .not. present(tol) ) then diff --git a/Sources/Shared/Math_Mod/Tet_Volume.f90 b/Sources/Shared/Math_Mod/Tet_Volume.f90 index dfd5f15a0..47166dfc0 100644 --- a/Sources/Shared/Math_Mod/Tet_Volume.f90 +++ b/Sources/Shared/Math_Mod/Tet_Volume.f90 @@ -6,12 +6,7 @@ pure real function Tet_Volume(Math, & x4, y4, z4) !------------------------------------------------------------------------------! ! Returns the volume of tethraedra spanned with nodes 1 to 4 ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Math_Type), intent(in) :: Math - real, intent(in) :: x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4 -!==============================================================================! +! ! ! The order of nodes matters here, so you should either be very careful to ! ! send the nodes in the right order (which is a bit of a nuissance) or ! ! use the absolute value of the volume computed here (that is mostly done). ! @@ -25,6 +20,13 @@ pure real function Tet_Volume(Math, & ! 1-----------2 ! ! ! !------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Math_Type), intent(in) :: Math + real, intent(in) :: x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4 +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Math) +!==============================================================================! Tet_Volume = ( ( (y2-y1)*(z3-z1) - (y3-y1)*(z2-z1) ) * (x4-x1) + & ( (x3-x1)*(z2-z1) - (x2-x1)*(z3-z1) ) * (y4-y1) + & diff --git a/Sources/Shared/Message_Mod.f90 b/Sources/Shared/Message_Mod.f90 index d484887b1..43995c604 100644 --- a/Sources/Shared/Message_Mod.f90 +++ b/Sources/Shared/Message_Mod.f90 @@ -1,4 +1,5 @@ #include "../Shared/Assert.h90" +#include "../Shared/Unused.h90" !==============================================================================! module Message_Mod diff --git a/Sources/Shared/Message_Mod/Dashed_Line.f90 b/Sources/Shared/Message_Mod/Dashed_Line.f90 index 88cb7a02c..483ff750f 100644 --- a/Sources/Shared/Message_Mod/Dashed_Line.f90 +++ b/Sources/Shared/Message_Mod/Dashed_Line.f90 @@ -10,6 +10,8 @@ subroutine Dashed_Line(Msg, w) !-----------------------------------[Locals]-----------------------------------! integer :: i character(DL) :: line +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Msg) !==============================================================================! ! _assert_(w <= DL) diff --git a/Sources/Shared/Message_Mod/Error.f90 b/Sources/Shared/Message_Mod/Error.f90 index 1dc02a086..404f3af4e 100644 --- a/Sources/Shared/Message_Mod/Error.f90 +++ b/Sources/Shared/Message_Mod/Error.f90 @@ -1,18 +1,17 @@ !==============================================================================! - subroutine Error(Msg, width, message_text, file, line, one_proc) + subroutine Error(Message, width, message_text, file, line, one_proc) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Message_Type) :: Msg - integer, intent(in) :: width - character(*) :: message_text - character(*), optional :: file - integer, intent(in), optional :: line - logical, optional :: one_proc ! print from one processor only + class(Message_Type) :: Message + integer, intent(in) :: width + character(*), intent(in) :: message_text + character(*), optional, intent(in) :: file + integer, optional, intent(in) :: line + logical, optional, intent(in) :: one_proc ! print from one processor !-----------------------------------[Locals]-----------------------------------! - type(Tokenizer_Type) :: Tok - integer :: w - character(DL) :: header_text + integer :: wd + character(DL) :: header_text !==============================================================================! !-------------------------------! @@ -28,25 +27,25 @@ subroutine Error(Msg, width, message_text, file, line, one_proc) end if ! Adjust width, if necessary - w = max(width, len_trim(header_text)+3) + wd = max(width, len_trim(header_text)+3) !-----------------------------------! ! Print the body of the message ! !-----------------------------------! if(present(one_proc)) then if(one_proc) then - if(this_proc < 2) call Msg % Framed(w, header_text, message_text) + if(First_Proc()) call Message % Framed(wd, header_text, message_text) else - call Msg % Framed(w, header_text, message_text) + call Message % Framed(wd, header_text, message_text) end if else - call Msg % Framed(w, header_text, message_text) + call Message % Framed(wd, header_text, message_text) end if !----------------------------------------! ! Errors are critical by definitiion ! !----------------------------------------! - call Comm_Mod_End + call Global % End_Parallel stop end subroutine diff --git a/Sources/Shared/Message_Mod/Framed.f90 b/Sources/Shared/Message_Mod/Framed.f90 index aa2be9038..1adff6550 100644 --- a/Sources/Shared/Message_Mod/Framed.f90 +++ b/Sources/Shared/Message_Mod/Framed.f90 @@ -1,32 +1,32 @@ !==============================================================================! - subroutine Framed(Msg, width, header_text, message_text, one_proc) + subroutine Framed(Message, width, header_text, message_text, one_proc) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Message_Type) :: Msg - integer, intent(in) :: width - character(*), intent(in) :: header_text - character(*), intent(in) :: message_text - logical, optional :: one_proc + class(Message_Type) :: Message + integer, intent(in) :: width + character(*), intent(in) :: header_text + character(*), intent(in) :: message_text + logical, optional, intent(in) :: one_proc !-----------------------------------[Locals]-----------------------------------! - integer :: w + integer :: wd character(DL) :: line !==============================================================================! ! Check if all processors have to print if(present(one_proc)) then if(one_proc) then - if(this_proc > 1) return + if(.not. First_Proc()) return end if end if ! Adjust width, if necessary - w = max(width, len_trim(header_text)+3) + wd = max(width, len_trim(header_text)+3) !------------------------------! ! Write the top line first ! !------------------------------! - call Msg % Thick_Line(w) + call Message % Thick_Line(wd) !----------------------! ! Write the header ! (you should check it is not too long) @@ -37,17 +37,17 @@ subroutine Framed(Msg, width, header_text, message_text, one_proc) write(line(4:len_trim(header_text)+5), '(a)') trim(header_text) print '(a)', trim(line) - call Msg % Dashed_Line(w) + call Message % Dashed_Line(wd) end if !-----------------------------------------------------------! ! Write the message text wrapping it into desired width ! !-----------------------------------------------------------! - call Msg % Frameless(w, message_text) + call Message % Frameless(wd, message_text) !--------------------------------! ! Write the bottom line last ! !--------------------------------! - call Msg % Thin_Line(w) + call Message % Thin_Line(wd) end subroutine diff --git a/Sources/Shared/Message_Mod/Frameless.f90 b/Sources/Shared/Message_Mod/Frameless.f90 index 4a9d67110..00cd94c50 100644 --- a/Sources/Shared/Message_Mod/Frameless.f90 +++ b/Sources/Shared/Message_Mod/Frameless.f90 @@ -5,10 +5,11 @@ subroutine Frameless(Msg, width, message_text) integer, intent(in) :: width character(*), intent(in) :: message_text !-----------------------------------[Locals]-----------------------------------! - type(Tokenizer_Type) :: Tok - integer :: i - integer :: cur_p, nex_p - character(DL) :: line + integer :: i + integer :: cur_p, nex_p + character(DL) :: out_line +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Msg) !==============================================================================! !---------------------------------------------------! @@ -16,13 +17,13 @@ subroutine Frameless(Msg, width, message_text) ! Load the argument into tokenizer and parse it ! ! ! !---------------------------------------------------! - Tok % whole = message_text - call Tok % Parse() + Line % whole = message_text + call Line % Parse() - ! Initialize the line - line = ' ' - line(2:2) = '#' - cur_p = 4 ! starts at 4 to allow for one leading space in the output + ! Initialize the output line + out_line = ' ' + out_line(2:2) = '#' + cur_p = 4 ! starts at 4 to allow for one leading space in output !-----------------------------------------------------! ! ! @@ -30,16 +31,16 @@ subroutine Frameless(Msg, width, message_text) ! ! !-----------------------------------------------------! i = 1 - do while (i .le. Tok % n_tokens) + do while (i .le. Line % n_tokens) 1 continue - nex_p = cur_p + len_trim(Tok % tokens(i)) + nex_p = cur_p + len_trim(Line % tokens(i)) !-------------------------------------------------! ! Keep on filling up this line, it still fits ! ! (+3 here is to compensate you started at 4) ! !-------------------------------------------------! - if(nex_p < width + 3 .and. Tok % tokens(i) .ne. '\n') then - write(line(cur_p:nex_p), '(a)') trim(Tok % tokens(i)) // ' ' + if(nex_p < width + 3 .and. Line % tokens(i) .ne. '\n') then + write(out_line(cur_p:nex_p), '(a)') trim(Line % tokens(i)) // ' ' !---------------------------------------------------------! ! Line is too long, print it and reset for new tokens ! @@ -47,15 +48,15 @@ subroutine Frameless(Msg, width, message_text) else ! Print what you have up to now - print '(a)', trim(line) + print '(a)', trim(out_line) - ! (Re)initialize the line - line = ' ' - line(2:2) = '#' - cur_p = 4 + ! (Re)initialize the output line + out_line = ' ' + out_line(2:2) = '#' + cur_p = 4 ! If you came here because of new line character, skip it. - if(Tok % tokens(i) .eq. '\n') i = i + 1 + if(Line % tokens(i) .eq. '\n') i = i + 1 goto 1 end if @@ -68,6 +69,6 @@ subroutine Frameless(Msg, width, message_text) ! Print the last line which was still in the forming ! ! ! !--------------------------------------------------------! - print '(a)', trim(line) + print '(a)', trim(out_line) end subroutine diff --git a/Sources/Shared/Message_Mod/Thick_Line.f90 b/Sources/Shared/Message_Mod/Thick_Line.f90 index 84a1b7568..849a5ee6d 100644 --- a/Sources/Shared/Message_Mod/Thick_Line.f90 +++ b/Sources/Shared/Message_Mod/Thick_Line.f90 @@ -10,6 +10,8 @@ subroutine Thick_Line(Msg, w) !-----------------------------------[Locals]-----------------------------------! integer :: i character(DL) :: line +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Msg) !==============================================================================! ! _assert_(w <= DL) diff --git a/Sources/Shared/Message_Mod/Thin_Line.f90 b/Sources/Shared/Message_Mod/Thin_Line.f90 index 01805eb26..dca35dfce 100644 --- a/Sources/Shared/Message_Mod/Thin_Line.f90 +++ b/Sources/Shared/Message_Mod/Thin_Line.f90 @@ -10,6 +10,8 @@ subroutine Thin_Line(Msg, w) !-----------------------------------[Locals]-----------------------------------! integer :: i character(DL) :: line +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Msg) !==============================================================================! ! _assert_(w <= DL) diff --git a/Sources/Shared/Message_Mod/Warning.f90 b/Sources/Shared/Message_Mod/Warning.f90 index 214cf5167..16550409d 100644 --- a/Sources/Shared/Message_Mod/Warning.f90 +++ b/Sources/Shared/Message_Mod/Warning.f90 @@ -1,18 +1,17 @@ !==============================================================================! - subroutine Warning(Msg, width, message_text, file, line, one_proc) + subroutine Warning(Message, width, message_text, file, line, one_proc) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Message_Type) :: Msg + class(Message_Type) :: Message integer, intent(in) :: width character(*) :: message_text character(*), optional :: file integer, intent(in), optional :: line logical, optional :: one_proc ! print from one processor only !-----------------------------------[Locals]-----------------------------------! - type(Tokenizer_Type) :: Tok - integer :: w - character(DL) :: header_text + integer :: wd + character(DL) :: header_text !==============================================================================! !-------------------------------! @@ -26,19 +25,19 @@ subroutine Warning(Msg, width, message_text, file, line, one_proc) end if ! Adjust width, if necessary - w = max(width, len_trim(header_text)+3) + wd = max(width, len_trim(header_text)+3) !-----------------------------------! ! Print the body of the message ! !-----------------------------------! if(present(one_proc)) then if(one_proc) then - if(this_proc < 2) call Msg % Framed(w, header_text, message_text) + if(First_Proc()) call Message % Framed(wd, header_text, message_text) else - call Msg % Framed(w, header_text, message_text) + call Message % Framed(wd, header_text, message_text) end if else - call Msg % Framed(w, header_text, message_text) + call Message % Framed(wd, header_text, message_text) end if diff --git a/Sources/Shared/Metis_Mod.f90 b/Sources/Shared/Metis_Mod.f90 index 80b500797..ec13cfb38 100644 --- a/Sources/Shared/Metis_Mod.f90 +++ b/Sources/Shared/Metis_Mod.f90 @@ -36,12 +36,16 @@ module Metis_Mod imbalance(:) ! allowed imbalance contains + procedure :: Call_Metis procedure :: Create_Metis end type type(Metis_Type) :: Metis + !----------------------------------------! + ! Handles for calls to METIS library ! + !----------------------------------------! integer, parameter :: METIS_OPTION_PTYPE = 1 integer, parameter :: METIS_OPTION_OBJTYPE = 2 integer, parameter :: METIS_OPTION_CTYPE = 3 @@ -69,6 +73,7 @@ module Metis_Mod integer, parameter :: METIS_OPTION_UBVEC = 25 contains +# include "Metis_Mod/Call_Metis.f90" # include "Metis_Mod/Create_Metis.f90" end module diff --git a/Sources/Shared/Metis_Mod/Call_Metis.f90 b/Sources/Shared/Metis_Mod/Call_Metis.f90 new file mode 100644 index 000000000..338488b83 --- /dev/null +++ b/Sources/Shared/Metis_Mod/Call_Metis.f90 @@ -0,0 +1,35 @@ +!==============================================================================! + subroutine Call_Metis(Metis, n_parts, part) +!------------------------------------------------------------------------------! +! Executes a call to METIS for decomposition ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(Metis_Type), intent(inout) :: Metis + integer, intent(in) :: n_parts + integer, dimension(:), intent(out) :: part +!-----------------------------------[Locals]-----------------------------------! +! integer :: s, i, v, v1, v2 +!==============================================================================! + + Metis % options = -1 ! Initialize all to default + Metis % options(METIS_OPTION_DBGLVL) = 0 + + call Metis_PartGraphRecursive( & ! rank intent type METIS + Metis % n_verts, & ! 1. (in), int nvtxs + Metis % n_constrains, & ! 2. (in), int ncon + Metis % row, & ! 3. (in), int(:) xadj + Metis % col, & ! 4. (in), int(:) adjncy + Metis % vert_weights, & ! 5. (in), int(:) vwgt + Metis % vert_data, & ! 6. (in), int(:) vsize + Metis % edge_weights, & ! 7. (in), int(:) adjwgt + n_parts, & ! 8. (in), int(:) nparts + Metis % part_weight, & ! 9. (in), real(:) tpwgts + Metis % imbalance, & ! 10. (in), real(:) ubvec + Metis % options, & ! 11. (in), int(:) options + Metis % return_val, & ! 12. (out) int(:) objval + part(:)) ! 13. (out) int(:) part + + part(:) = part(:) + 1 ! +1, METIS works from zero + + end subroutine diff --git a/Sources/Shared/Metis_Mod/Create_Metis.f90 b/Sources/Shared/Metis_Mod/Create_Metis.f90 index f262dc0b9..2fbd07758 100644 --- a/Sources/Shared/Metis_Mod/Create_Metis.f90 +++ b/Sources/Shared/Metis_Mod/Create_Metis.f90 @@ -1,29 +1,31 @@ !==============================================================================! - subroutine Create_Metis(Metis, face_to_cell, n_parts) + subroutine Create_Metis(Metis, e_f, e_l, edge_conn, n_parts) !------------------------------------------------------------------------------! ! Prepares all the arrays for a call to METIS function(s) ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Metis_Type) :: Metis - integer, allocatable, intent(in), dimension(:,:) :: face_to_cell - integer, optional, intent(in) :: n_parts + class(Metis_Type), intent(out) :: Metis + integer, intent(in) :: e_f, e_l + integer, dimension(:,:), intent(in) :: edge_conn + integer, intent(in) :: n_parts !-----------------------------------[Locals]-----------------------------------! integer :: s, i, v, v1, v2 !==============================================================================! Assert(n_parts > 0) + Assert(e_l > e_f) + Assert(e_f >= lbound(edge_conn, 2)) + Assert(e_l <= ubound(edge_conn, 2)) !------------------------------------------------------------! ! Number of vertices and number of edges for first level ! !------------------------------------------------------------! Metis % n_verts = 0 Metis % n_edges = 0 - do s = 1, size(face_to_cell, 2) - if(face_to_cell(2, s) > 0) then - Metis % n_edges = Metis % n_edges + 1 - Metis % n_verts = max(Metis % n_verts, face_to_cell(2, s)) - end if + do s = e_f, e_l + Metis % n_edges = Metis % n_edges + 1 + Metis % n_verts = max(Metis % n_verts, edge_conn(2, s)) end do Assert(Metis % n_verts > 0) Assert(Metis % n_edges > 0) @@ -40,13 +42,11 @@ subroutine Create_Metis(Metis, face_to_cell, n_parts) ! Form edge connectivity ! !----------------------------! i = 0 - do s = 1, size(face_to_cell, 2) - if(face_to_cell(2, s) > 0) then - i = i + 1 - Metis % edges_v(1:2, i) = face_to_cell(1:2, s) - Assert(Metis % edges_v(1,i) > 0) - Assert(Metis % edges_v(2,i) > 0) - end if + do s = e_f, e_l + i = i + 1 + Metis % edges_v(1:2, i) = edge_conn(1:2, s) + Assert(Metis % edges_v(1,i) > 0) + Assert(Metis % edges_v(2,i) > 0) end do !------------------------------! diff --git a/Sources/Shared/Polyhedron_Mod.f90 b/Sources/Shared/Polyhedron_Mod.f90 index 189b60ae3..2689a25be 100644 --- a/Sources/Shared/Polyhedron_Mod.f90 +++ b/Sources/Shared/Polyhedron_Mod.f90 @@ -1,4 +1,5 @@ #include "../Shared/Assert.h90" +#include "../Shared/Unused.h90" !==============================================================================! module Polyhedron_Mod diff --git a/Sources/Shared/Polyhedron_Mod/Allocate_Polyhedron.f90 b/Sources/Shared/Polyhedron_Mod/Allocate_Polyhedron.f90 index 47a2e97b3..6d8697668 100644 --- a/Sources/Shared/Polyhedron_Mod/Allocate_Polyhedron.f90 +++ b/Sources/Shared/Polyhedron_Mod/Allocate_Polyhedron.f90 @@ -5,9 +5,9 @@ subroutine Allocate_Polyhedron(Pol, n_faces, n_nodes) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Polyhedron_Type) :: Pol - integer, intent(in) :: n_faces - integer, intent(in) :: n_nodes + class(Polyhedron_Type), intent(out) :: Pol + integer, intent(in) :: n_faces + integer, intent(in) :: n_nodes !==============================================================================! allocate(Pol % faces_n_nodes(n_faces)) diff --git a/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Centroid.f90 b/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Centroid.f90 index df18305c7..b25f39753 100644 --- a/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Centroid.f90 +++ b/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Centroid.f90 @@ -1,13 +1,12 @@ !==============================================================================! - subroutine Calculate_Cell_Centroid(Pol, cell, xc, yc, zc) + pure subroutine Calculate_Cell_Centroid(Pol, xc, yc, zc) !------------------------------------------------------------------------------! ! Calculate cell's centroid, this information is not stored in Polyledron ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Polyhedron_Type) :: Pol - integer, intent(in) :: cell - real, intent(out) :: xc, yc, zc + class(Polyhedron_Type), intent(in) :: Pol + real, intent(out) :: xc, yc, zc !-----------------------------------[Locals]-----------------------------------! integer :: i !==============================================================================! diff --git a/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Volume.f90 b/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Volume.f90 index 33401083e..c68186d7b 100644 --- a/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Volume.f90 +++ b/Sources/Shared/Polyhedron_Mod/Calculate_Cell_Volume.f90 @@ -1,12 +1,12 @@ !==============================================================================! - subroutine Calculate_Cell_Volume(Pol, vol) + pure subroutine Calculate_Cell_Volume(Pol, vol) !------------------------------------------------------------------------------! ! Calculate cell's volume, this information is not stored in Polyhedron ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Polyhedron_Type) :: Pol - real, intent(out) :: vol + class(Polyhedron_Type), intent(in) :: Pol + real, intent(out) :: vol !-----------------------------------[Locals]-----------------------------------! integer :: i_nod, j_nod, i, j, s real :: dv, xc, yc, zc, xf, yf, zf @@ -17,7 +17,7 @@ subroutine Calculate_Cell_Volume(Pol, vol) ! Calculate cell's centroid (maybe taking it from ... ! ... Grid would be easier albeit less general?) - call Pol % Calculate_Cell_Centroid(s, xc, yc, zc) + call Pol % Calculate_Cell_Centroid(xc, yc, zc) do s = 1, Pol % n_faces diff --git a/Sources/Shared/Polyhedron_Mod/Calculate_Face_Centroid.f90 b/Sources/Shared/Polyhedron_Mod/Calculate_Face_Centroid.f90 index d9add5566..79b69b030 100644 --- a/Sources/Shared/Polyhedron_Mod/Calculate_Face_Centroid.f90 +++ b/Sources/Shared/Polyhedron_Mod/Calculate_Face_Centroid.f90 @@ -1,13 +1,13 @@ !==============================================================================! - subroutine Calculate_Face_Centroid(Pol, face, xf, yf, zf) + pure subroutine Calculate_Face_Centroid(Pol, face, xf, yf, zf) !------------------------------------------------------------------------------! ! Calculate face's centroid, this information is not stored in Polyhedron ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Polyhedron_Type) :: Pol - integer, intent(in) :: face - real, intent(out) :: xf, yf, zf + class(Polyhedron_Type), intent(in) :: Pol + integer, intent(in) :: face + real, intent(out) :: xf, yf, zf !-----------------------------------[Locals]-----------------------------------! integer :: i_nod, i !==============================================================================! diff --git a/Sources/Shared/Polyhedron_Mod/Create_Sdodecahedron.f90 b/Sources/Shared/Polyhedron_Mod/Create_Sdodecahedron.f90 index 66d0b3dd3..922779f7d 100644 --- a/Sources/Shared/Polyhedron_Mod/Create_Sdodecahedron.f90 +++ b/Sources/Shared/Polyhedron_Mod/Create_Sdodecahedron.f90 @@ -27,7 +27,7 @@ subroutine Create_Sdodecahedron(Pol) xn = yv1*zv2-zv1*yv2 yn = zv1*xv2-xv1*zv2 zn = xv1*yv2-yv1*xv2 - dmod = (xn**2.0d0+yn**2.0d0+zn**2.0d0)**0.5d0 + dmod = (xn**2.0+yn**2.0+zn**2.0)**0.5 xns(is) = xn/dmod yns(is) = yn/dmod zns(is) = zn/dmod diff --git a/Sources/Shared/Polyhedron_Mod/Create_Sicosahedron.f90 b/Sources/Shared/Polyhedron_Mod/Create_Sicosahedron.f90 index 496310792..d3b89325d 100644 --- a/Sources/Shared/Polyhedron_Mod/Create_Sicosahedron.f90 +++ b/Sources/Shared/Polyhedron_Mod/Create_Sicosahedron.f90 @@ -27,7 +27,7 @@ subroutine Create_Sicosahedron(Pol) xn = yv1*zv2-zv1*yv2 yn = zv1*xv2-xv1*zv2 zn = xv1*yv2-yv1*xv2 - dmod = (xn**2.0d0+yn**2.0d0+zn**2.0d0)**0.5d0 + dmod = (xn**2.0+yn**2.0+zn**2.0)**0.5 xns(is) = xn/dmod yns(is) = yn/dmod zns(is) = zn/dmod diff --git a/Sources/Shared/Polyhedron_Mod/Extract_From_Grid.f90 b/Sources/Shared/Polyhedron_Mod/Extract_From_Grid.f90 index 7cf8b19df..8f3458d86 100644 --- a/Sources/Shared/Polyhedron_Mod/Extract_From_Grid.f90 +++ b/Sources/Shared/Polyhedron_Mod/Extract_From_Grid.f90 @@ -3,17 +3,17 @@ subroutine Extract_From_Grid(Pol, Grid, cell, phi_n) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Polyhedron_Type) :: Pol - type(Grid_Type) :: Grid - integer, intent(in) :: cell - real, optional :: phi_n(:) + class(Polyhedron_Type), intent(out) :: Pol + type(Grid_Type), target, intent(in) :: Grid + integer, intent(in) :: cell + real, optional, intent(in) :: phi_n(:) !------------------------------[Local parameters]------------------------------! logical, parameter :: DEBUG = .false. ! if true, a lot of files are created !-----------------------------------[Locals]-----------------------------------! integer, pointer, contiguous :: glo(:) integer, pointer, contiguous :: local_node(:) ! local to polyhedron integer :: local_face_nodes(MAX_ISOAP_VERTS) - integer :: i_nod, i_fac, i_ver, i_iso, l_nod + integer :: i_nod, i_fac, l_nod integer :: s, n, faces_n_nodes real :: dx, dy, dz, sx, sy, sz !==============================================================================! @@ -97,11 +97,12 @@ subroutine Extract_From_Grid(Pol, Grid, cell, phi_n) dy = Grid % yf(s) - Grid % yc(cell) dz = Grid % zf(s) - Grid % zc(cell) - ! They might be in the wrong order, correct if needed - ! (If the face is oriented outwards to current cell, - ! the nodes have to sorted in reverse order because - ! ISOAP library requies faces to point inwards) - if(sx*dx + sy*dy + sz*dz > 0) then + ! Faces' nodes might be in the wrong order, correct here if needed. + ! (If the face is oriented outwards to current cell,the nodes have to + ! sorted in reverse order because ISOAP requies faces to point inwards. + ! But then again, this seems to make the extracted iso-surface to point + ! from VOF = 1 towards VOF = 0, which is not in line with T-Flows.) + if(sx*dx + sy*dy + sz*dz < 0) then call Sort % Reverse_Order_Int(local_face_nodes(1:faces_n_nodes)) end if diff --git a/Sources/Shared/Polyhedron_Mod/Func_1.f90 b/Sources/Shared/Polyhedron_Mod/Func_1.f90 index 84858c939..5e92a83dc 100644 --- a/Sources/Shared/Polyhedron_Mod/Func_1.f90 +++ b/Sources/Shared/Polyhedron_Mod/Func_1.f90 @@ -9,6 +9,8 @@ function Func_1(Pol, x, y, z) class(Polyhedron_Type) :: Pol real :: Func_1 real :: x, y, z +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Pol) !==============================================================================! Func_1=-1.0*((x-0.5)**2+(y-0.5)**2+(z-0.5)**2-0.325**2) diff --git a/Sources/Shared/Polyhedron_Mod/Func_2.f90 b/Sources/Shared/Polyhedron_Mod/Func_2.f90 index 7ec0ba316..c7cc0d396 100644 --- a/Sources/Shared/Polyhedron_Mod/Func_2.f90 +++ b/Sources/Shared/Polyhedron_Mod/Func_2.f90 @@ -9,6 +9,8 @@ function Func_2(Pol, x, y, z) class(Polyhedron_Type) :: Pol real :: Func_2 real :: x, y, z +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Pol) !==============================================================================! Func_2=(0.1)**2-((0.2)-((x-0.5)**2+(z-0.5)**2)**0.5)**2- & diff --git a/Sources/Shared/Polyhedron_Mod/Func_3.f90 b/Sources/Shared/Polyhedron_Mod/Func_3.f90 index d1620ac64..623464ad5 100644 --- a/Sources/Shared/Polyhedron_Mod/Func_3.f90 +++ b/Sources/Shared/Polyhedron_Mod/Func_3.f90 @@ -9,6 +9,8 @@ function Func_3(Pol, x, y, z) class(Polyhedron_Type) :: Pol real :: Func_3 real :: x, y, z +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Pol) !==============================================================================! x=x-1.25 diff --git a/Sources/Shared/Profiler_Mod.f90 b/Sources/Shared/Profiler_Mod.f90 index 61bedb762..ca3a0fa45 100644 --- a/Sources/Shared/Profiler_Mod.f90 +++ b/Sources/Shared/Profiler_Mod.f90 @@ -2,6 +2,7 @@ module Profiler_Mod !----------------------------------[Modules]-----------------------------------! use Comm_Mod + use Control_Mod !------------------------------------------------------------------------------! implicit none !==============================================================================! @@ -13,9 +14,9 @@ module Profiler_Mod !-------------------! type Profiler_Type - integer, private :: n_functions = 0 - integer, private :: currently_running = 0 - integer, private :: previously_running = 0 + integer, private :: n_functs = 0 + integer, private :: curr_running = 0 + integer, private :: prev_running(MAX_FUNCT) = 0 character(DL), private :: funct_name(MAX_FUNCT) integer(DP), private :: i_time_prev ! system clock at prev diff --git a/Sources/Shared/Profiler_Mod/Start.f90 b/Sources/Shared/Profiler_Mod/Start.f90 index 1bda8c45c..d0677a45c 100644 --- a/Sources/Shared/Profiler_Mod/Start.f90 +++ b/Sources/Shared/Profiler_Mod/Start.f90 @@ -1,56 +1,73 @@ !==============================================================================! - subroutine Start(Profiler, f_name) + subroutine Start(Prof, f_name) !------------------------------------------------------------------------------! ! This subroutine is called whenever new function is invoked ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Profiler_Type), target :: Profiler + class(Profiler_Type), target :: Prof character(len=*) :: f_name !-----------------------------------[Locals]-----------------------------------! integer :: i_fun ! function counter !==============================================================================! - !-----------------------------------------------------! - ! Store the function which was previously running ! - !-----------------------------------------------------! - Profiler % previously_running = Profiler % currently_running - - !----------------------------------------------! - ! If called for the first time, get system ! - ! clock clock rate and initial clock count ! - !----------------------------------------------! - if(Profiler % previously_running .eq. 0) then - call system_clock(count_rate = Profiler % sys_count_rate) + !---------------------------------------------------------------------------! + ! If profiles is called for the first time, get system clock count rate ! + !---------------------------------------------------------------------------! + if(Prof % n_functs .eq. 0) then + call system_clock(count_rate = Prof % sys_count_rate) end if !-------------------------------------------------------! + ! ! ! Determine the function which is currently running ! + ! (In other words, the caller function.) ! + ! ! !-------------------------------------------------------! - ! Check if this function was called before - do i_fun = 1, Profiler % n_functions - if(f_name .eq. Profiler % funct_name(i_fun)) then ! found the function - Profiler % currently_running = i_fun - goto 1 - end if + !----------------------------------------------! + ! Check if this function was called before ! + !----------------------------------------------! + do i_fun = 1, Prof % n_functs + if(f_name .eq. Prof % funct_name(i_fun)) goto 1 end do + !-----------------------------------------------------------------! + ! If you happen to be here, the function wasn't called before ! + !-----------------------------------------------------------------! + ! It wasn't called before, add it to the suite of analyzed function - Profiler % n_functions = Profiler % n_functions + 1 - Profiler % funct_name(Profiler % n_functions) = f_name + Prof % n_functs = Prof % n_functs + 1 + Prof % funct_name(Prof % n_functs) = f_name ! Initialize times spent in the new function - Profiler % funct_time(Profiler % n_functions) = 0.0 + Prof % funct_time(Prof % n_functs) = 0.0 - ! Currently running function is the new one - Profiler % currently_running = Profiler % n_functions + ! Store currenlty running function to i_fun + i_fun = Prof % n_functs + !--------------------------------------------------------------------------! + ! ! + ! Meeting point: you are here no matter if function was called before, ! + ! or if it was called for the first timei. Also important to note, ! + ! variable i_fun stores the currenly invoked function at this point. ! + ! ! + !--------------------------------------------------------------------------! 1 continue + !-----------------------------------------------------! + ! Store the function which was previously running ! + !-----------------------------------------------------! + Prof % prev_running(i_fun) = Prof % curr_running + !-------------------------------------------------------------------! ! Update the timer in the function which was previously running ! !-------------------------------------------------------------------! - call Profiler % Update_By_Rank(Profiler % previously_running) + call Prof % Update_By_Rank(Prof % prev_running(i_fun)) + + !---------------------------------------! + ! Set the currentl running function ! + !---------------------------------------! + Prof % curr_running = i_fun end subroutine diff --git a/Sources/Shared/Profiler_Mod/Statistics.f90 b/Sources/Shared/Profiler_Mod/Statistics.f90 index 386523ef2..417db279e 100644 --- a/Sources/Shared/Profiler_Mod/Statistics.f90 +++ b/Sources/Shared/Profiler_Mod/Statistics.f90 @@ -1,37 +1,47 @@ !==============================================================================! - subroutine Statistics(Profiler, indent) + subroutine Statistics(Prof, indent) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Profiler_Type), target :: Profiler - integer, intent(in) :: indent ! 34 for Main_Pro, 1 for Main_con + class(Profiler_Type), target :: Prof + integer, intent(in) :: indent ! 34 for Main_Pro, 1 for Main_con !-----------------------------------[Locals]-----------------------------------! integer :: i_fun real :: total_time, t_temp, percent_time integer :: hours, minutes, seconds character(DL) :: line, n_temp - logical :: swap + character(SL) :: pinfo + logical :: swap, in_sec !==============================================================================! + ! Only Process has a control file + in_sec = .false. + if(PROGRAM_NAME .eq. 'Process') then + call Control % Profiler_Info(pinfo, verbose=.false.) + if(pinfo == 'SECONDS') then + in_sec = .true. + end if + end if + ! Compute average time spent in functions over all processors - if(n_proc > 1) then - do i_fun=1, Profiler % n_functions - call Comm_Mod_Global_Sum_Real(Profiler % funct_time(i_fun)) - Profiler % funct_time(i_fun) = Profiler % funct_time(i_fun) / n_proc + if(Parallel_Run()) then + do i_fun=1, Prof % n_functs + call Global % Sum_Real(Prof % funct_time(i_fun)) + Prof % funct_time(i_fun) = Prof % funct_time(i_fun) / N_Procs() end do end if ! Perform bubble sort do swap = .false. - do i_fun=1, Profiler % n_functions-1 - if(Profiler % funct_time(i_fun+1) > Profiler % funct_time(i_fun)) then - t_temp = Profiler % funct_time(i_fun) - n_temp = Profiler % funct_name(i_fun) - Profiler % funct_time(i_fun) = Profiler % funct_time(i_fun+1) - Profiler % funct_name(i_fun) = Profiler % funct_name(i_fun+1) - Profiler % funct_time(i_fun+1) = t_temp - Profiler % funct_name(i_fun+1) = n_temp + do i_fun=1, Prof % n_functs-1 + if(Prof % funct_time(i_fun+1) > Prof % funct_time(i_fun)) then + t_temp = Prof % funct_time(i_fun) + n_temp = Prof % funct_name(i_fun) + Prof % funct_time(i_fun) = Prof % funct_time(i_fun+1) + Prof % funct_name(i_fun) = Prof % funct_name(i_fun+1) + Prof % funct_time(i_fun+1) = t_temp + Prof % funct_name(i_fun+1) = n_temp swap = .true. end if end do @@ -40,21 +50,21 @@ subroutine Statistics(Profiler, indent) 1 continue total_time = 0.0 - do i_fun = 1, Profiler % n_functions - total_time = total_time + Profiler % funct_time(i_fun) + do i_fun = 1, Prof % n_functs + total_time = total_time + Prof % funct_time(i_fun) end do - if(this_proc < 2) then + if(First_Proc()) then line( 1:160) = ' ' - line( 1+indent:63+indent) = & - '#=============================================================#' + line( 1+indent:65+indent) = & + '#===============================================================#' print '(a)', trim(line) - line( 1+indent:63+indent) = & - '# CPU usage statistics #' + line( 1+indent:65+indent) = & + '# CPU usage statistics #' print '(a)', trim(line) - line( 1+indent:63+indent) = & - '#-------------------------------------------------------------#' + line( 1+indent:65+indent) = & + '#---------------------------------------------------------------#' print '(a)', trim(line) line( 1:160) = ' ' line( 1+indent:30+indent) = '# Total CPU time: ' @@ -69,36 +79,69 @@ subroutine Statistics(Profiler, indent) write(line(36+indent:36+indent), '(a1)') ':' write(line(37+indent:38+indent), '(i2.2)') seconds write(line(40+indent:50+indent), '(a11)') '[hhh:mm:ss]' - line(63+indent:63+indent) = '#' + line(65+indent:65+indent) = '#' print '(a)', trim(line) - line( 1+indent:63+indent) = & - '#-------------------------------------------+-----------------#' + line( 1+indent:65+indent) = & + '#---------------------------------------------+-----------------#' print '(a)', trim(line) - line( 1+indent:63+indent) = & - '# Description of the activity: | Spent time: #' + line( 1+indent:65+indent) = & + '# Description of the activity: | Spent time: #' print '(a)', trim(line) - line( 1+indent:63+indent) = & - '#-------------------------------------------+-----------------#' + line( 1+indent:65+indent) = & + '#---------------------------------------------+-----------------#' print '(a)', trim(line) - do i_fun = 1, Profiler % n_functions + do i_fun = 1, Prof % n_functs line( 1:160) = ' ' line( 1+indent: 1+indent) = '#' - line(63+indent:63+indent) = '#' + line(65+indent:65+indent) = '#' line( 3+indent: 3+indent) = '-' - line( 5+indent: 5+indent+len_trim(Profiler % funct_name(i_fun))) & - = Profiler % funct_name(i_fun)(1:123) - line(45+indent:45+indent) = '|' - percent_time = Profiler % funct_time(i_fun) / total_time * 100.0 - write(line(50+indent:55+indent), '(f6.2)') percent_time - line(57+indent:57+indent) = '%' + line( 5+indent: 5+indent+len_trim(Prof % funct_name(i_fun))) & + = Prof % funct_name(i_fun)(1:123) + line(47+indent:47+indent) = '|' + percent_time = Prof % funct_time(i_fun) / total_time * 100.0 + + ! Write time in elapsed seconds + if(in_sec) then + ! I stick to kiss principle here: keep it simple and stupid + if(Prof % funct_time(1) < 10) then + write(line(53+indent:56+indent), '(f4.2)') Prof % funct_time(i_fun) + line(58+indent:60+indent) = '[s]' + else if(Prof % funct_time(1) < 100) then + write(line(52+indent:56+indent), '(f5.2)') Prof % funct_time(i_fun) + line(58+indent:60+indent) = '[s]' + else if(Prof % funct_time(1) < 1000) then + write(line(51+indent:56+indent), '(f6.2)') Prof % funct_time(i_fun) + line(58+indent:60+indent) = '[s]' + else if(Prof % funct_time(1) < 10000) then + write(line(51+indent:57+indent), '(f7.2)') Prof % funct_time(i_fun) + line(59+indent:61+indent) = '[s]' + else if(Prof % funct_time(1) < 100000) then + write(line(50+indent:57+indent), '(f8.2)') Prof % funct_time(i_fun) + line(59+indent:61+indent) = '[s]' + else if(Prof % funct_time(1) < 1000000) then + write(line(50+indent:58+indent), '(f9.2)') Prof % funct_time(i_fun) + line(60+indent:62+indent) = '[s]' + else if(Prof % funct_time(1) < 10000000) then + write(line(49+indent:58+indent), '(f10.2)') Prof % funct_time(i_fun) + line(60+indent:62+indent) = '[s]' + else if(Prof % funct_time(1) < 100000000) then + write(line(49+indent:59+indent), '(f11.2)') Prof % funct_time(i_fun) + line(61+indent:63+indent) = '[s]' + end if + + ! Write time in percentages + else + write(line(52+indent:57+indent), '(f6.2)') percent_time + line(59+indent:59+indent) = '%' + end if if(percent_time > 0.01) then print '(a)', trim(line) end if end do - line( 1+indent:63+indent) = & - '#-------------------------------------------+-----------------#' + line( 1+indent:65+indent) = & + '#---------------------------------------------+-----------------#' print '(a)', trim(line) print *, '' diff --git a/Sources/Shared/Profiler_Mod/Stop.f90 b/Sources/Shared/Profiler_Mod/Stop.f90 index ec14ce3f2..34ff5836f 100644 --- a/Sources/Shared/Profiler_Mod/Stop.f90 +++ b/Sources/Shared/Profiler_Mod/Stop.f90 @@ -1,44 +1,54 @@ !==============================================================================! - subroutine Stop(Profiler, f_name) + subroutine Stop(Prof, f_name) !------------------------------------------------------------------------------! ! Stops a function by her name ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Profiler_Type), target :: Profiler + class(Profiler_Type), target :: Prof character(len=*) :: f_name !-----------------------------------[Locals]-----------------------------------! integer :: i_fun !==============================================================================! !----------------------------------------------------------! + ! ! ! Find the rank (number) of function which is stopping ! + ! ! !----------------------------------------------------------! - ! Browse through stored functions - do i_fun = 1, Profiler % n_functions - if(f_name .eq. Profiler % funct_name(i_fun)) then - goto 2 - end if + !-------------------------------------! + ! Browse through stored functions ! + !-------------------------------------! + do i_fun = 1, Prof % n_functs + if(f_name .eq. Prof % funct_name(i_fun)) goto 2 end do - ! If here, Profiler_Start wasn't invoked for this function - print *, 'CRITICAL ERROR in ''Profiler_End'':' - print *, 'For function ''', trim(f_name), ''', ''Cpu_Ti' // & - 'mer_Start'' wasn''t invoked. Exiting!' - stop + !----------------------------------------------! + ! If you happen to be here, Profiler_Start ! + ! wasn't invoked for this function ! + !----------------------------------------------! + call Message % Error(72, & + 'For function or section: "' // trim(f_name) // & + '", Profiler % Start was not invoked. This ' // & + ' error is critical. Exiting!', & + file=__FILE__, line=__LINE__, one_proc=.true.) - ! Function has been found, continue + !------------------------------------------------------------------------! + ! ! + ! If here, function has been found and variable i_fun holds its rank ! + ! ! + !------------------------------------------------------------------------! 2 continue !-------------------------------------------------------------! ! Update the time for the function which is being stopped ! !-------------------------------------------------------------! - call Profiler % Update_By_Rank(i_fun) + call Prof % Update_By_Rank(i_fun) !-------------------------------------------------------! ! Restart the function which was previously running ! !-------------------------------------------------------! - Profiler % currently_running = Profiler % previously_running + Prof % curr_running = Prof % prev_running(i_fun) end subroutine diff --git a/Sources/Shared/Profiler_Mod/Update_By_Rank.f90 b/Sources/Shared/Profiler_Mod/Update_By_Rank.f90 index 33080d9d1..35f293f51 100644 --- a/Sources/Shared/Profiler_Mod/Update_By_Rank.f90 +++ b/Sources/Shared/Profiler_Mod/Update_By_Rank.f90 @@ -1,28 +1,28 @@ !==============================================================================! - subroutine Update_By_Rank(Profiler, i_fun) + subroutine Update_By_Rank(Prof, i_fun) !------------------------------------------------------------------------------! ! Updates function's timer by her rank (number) ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Profiler_Type), target :: Profiler + class(Profiler_Type), target :: Prof integer, intent(in) :: i_fun !-----------------------------------[Locals]-----------------------------------! real(DP) :: wall_time !==============================================================================! ! Store the last time which was recorded - Profiler % i_time_prev = Profiler % i_time_curr + Prof % i_time_prev = Prof % i_time_curr ! Refresh the value of time_curr - call system_clock(Profiler % i_time_curr) + call system_clock(Prof % i_time_curr) ! Calculate how much wall time has passed - wall_time = real(Profiler % i_time_curr - Profiler % i_time_prev) & - / real(Profiler % sys_count_rate) + wall_time = real(Prof % i_time_curr - Prof % i_time_prev) & + / real(Prof % sys_count_rate) if(i_fun > 0) then - Profiler % funct_time(i_fun) = Profiler % funct_time(i_fun) + wall_time + Prof % funct_time(i_fun) = Prof % funct_time(i_fun) + wall_time end if end subroutine diff --git a/Sources/Shared/Region_Mod.f90 b/Sources/Shared/Region_Mod.f90 new file mode 100644 index 000000000..af2c6a494 --- /dev/null +++ b/Sources/Shared/Region_Mod.f90 @@ -0,0 +1,53 @@ +!==============================================================================! + module Region_Mod +!------------------------------------------------------------------------------! +! This is used to store regions (boundary conditions) within a Grid_Type ! +!------------------------------------------------------------------------------! +!----------------------------------[Modules]-----------------------------------! + use Const_Mod +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + !---------------------------------------------------------! + ! Constants for identification of boundary conditions ! + !---------------------------------------------------------! + integer, parameter :: INFLOW = 10007 + integer, parameter :: WALL = 10009 + integer, parameter :: OUTFLOW = 10037 + integer, parameter :: SYMMETRY = 10039 + integer, parameter :: CONVECT = 10061 + integer, parameter :: WALLFL = 10067 + integer, parameter :: PRESSURE = 10069 + integer, parameter :: INSIDE = 10079 + integer, parameter :: BUFFER = 10091 + integer, parameter :: PERIODIC_X = 10093 + integer, parameter :: PERIODIC_Y = 10099 + integer, parameter :: PERIODIC_Z = 10103 + integer, parameter :: UNDEFINED = 10111 + + !-----------------! + ! Region type ! + !-----------------! + type Region_Type + + ! Name of the boundary conditions specified in grid generation + ! It ranges through number of boundary conditions (aka regions) + character(SL), allocatable :: name(:) + + ! Boundary types, ranging through all regions + integer, allocatable :: type(:) + + ! Boundary condition ranging through boundary cells. + ! Values start from one, zero is internal cell + ! (Follows nomenclature from "../Shared/Comm_Mod_Par.f90") + integer, allocatable :: at_cell(:) ! region at cell + integer, allocatable :: at_face(:) ! region at face (for periodicity) + integer, allocatable :: f_cell(:) ! first (bnd) cell for region + integer, allocatable :: l_cell(:) ! last (bnd) cell for region + integer, allocatable :: f_face(:) ! first (bnd) cell for region + integer, allocatable :: l_face(:) ! last (bnd) cell for region + + end type + + end module diff --git a/Sources/Shared/Sort_Mod.f90 b/Sources/Shared/Sort_Mod.f90 index f840e3244..e54b3c020 100644 --- a/Sources/Shared/Sort_Mod.f90 +++ b/Sources/Shared/Sort_Mod.f90 @@ -1,3 +1,5 @@ +#include "../Shared/Unused.h90" + !==============================================================================! module Sort_Mod !------------------------------------------------------------------------------! diff --git a/Sources/Shared/Sort_Mod/Int_By_Index.f90 b/Sources/Shared/Sort_Mod/Int_By_Index.f90 index 455d87030..6a9af0c25 100644 --- a/Sources/Shared/Sort_Mod/Int_By_Index.f90 +++ b/Sources/Shared/Sort_Mod/Int_By_Index.f90 @@ -12,6 +12,8 @@ pure subroutine Int_By_Index(Sort, n, x, indx) !-----------------------------------[Locals]-----------------------------------! integer :: i integer, allocatable :: work(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Sort) !==============================================================================! allocate(work(n)); work = 0 diff --git a/Sources/Shared/Sort_Mod/Real_By_Index.f90 b/Sources/Shared/Sort_Mod/Real_By_Index.f90 index 5ba63b7fd..5b4a6f695 100644 --- a/Sources/Shared/Sort_Mod/Real_By_Index.f90 +++ b/Sources/Shared/Sort_Mod/Real_By_Index.f90 @@ -12,6 +12,8 @@ pure subroutine Real_By_Index(Sort, n, x, indx) !-----------------------------------[Locals]-----------------------------------! integer :: i real, allocatable :: work(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Sort) !==============================================================================! allocate(work(n)); work = 0.0 diff --git a/Sources/Shared/Sort_Mod/Reverse_Order_Int.f90 b/Sources/Shared/Sort_Mod/Reverse_Order_Int.f90 index bd77e91a1..81a60cf26 100644 --- a/Sources/Shared/Sort_Mod/Reverse_Order_Int.f90 +++ b/Sources/Shared/Sort_Mod/Reverse_Order_Int.f90 @@ -9,6 +9,8 @@ pure subroutine Reverse_Order_Int(Sort, a) integer, intent(inout) :: a(:) !-----------------------------------[Locals]-----------------------------------! integer :: i, j, n +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Sort) !==============================================================================! n = size(a, 1) diff --git a/Sources/Shared/Sort_Mod/Reverse_Order_Real.f90 b/Sources/Shared/Sort_Mod/Reverse_Order_Real.f90 index 12566cf73..3f7f6cd7c 100644 --- a/Sources/Shared/Sort_Mod/Reverse_Order_Real.f90 +++ b/Sources/Shared/Sort_Mod/Reverse_Order_Real.f90 @@ -9,6 +9,8 @@ pure subroutine Reverse_Order_Real(Sort, a) real, intent(inout) :: a(:) !-----------------------------------[Locals]-----------------------------------! integer :: i, j, n +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Sort) !==============================================================================! n = size(a, 1) diff --git a/Sources/Shared/Sort_Mod/Unique_Int.f90 b/Sources/Shared/Sort_Mod/Unique_Int.f90 index 3c5717543..aeb7ee342 100644 --- a/Sources/Shared/Sort_Mod/Unique_Int.f90 +++ b/Sources/Shared/Sort_Mod/Unique_Int.f90 @@ -13,6 +13,8 @@ pure subroutine Unique_Int(Sort, values, nu) !-----------------------------------[Locals]-----------------------------------! integer :: i, min_val, max_val integer, allocatable :: unique(:) +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Sort) !==============================================================================! ! Set initial size of unique list ... diff --git a/Sources/Shared/Stl_Mod/Create_From_File.f90 b/Sources/Shared/Stl_Mod/Create_From_File.f90 index 0be505a00..dbc6e7781 100644 --- a/Sources/Shared/Stl_Mod/Create_From_File.f90 +++ b/Sources/Shared/Stl_Mod/Create_From_File.f90 @@ -84,7 +84,7 @@ subroutine Create_From_File(Stl, file_name) end do Stl % n_boddies = maxval(Stl % body_c) - if(this_proc < 2) then + if(First_Proc()) then print '(a,i3)', ' # Number of boddies in the STL file: ', Stl % n_boddies end if diff --git a/Sources/Shared/Stl_Mod/Read_Stl_Ascii.f90 b/Sources/Shared/Stl_Mod/Read_Stl_Ascii.f90 index 2f21805c1..4d0ceebeb 100644 --- a/Sources/Shared/Stl_Mod/Read_Stl_Ascii.f90 +++ b/Sources/Shared/Stl_Mod/Read_Stl_Ascii.f90 @@ -7,7 +7,7 @@ subroutine Read_Stl_Ascii(Stl) !---------------------------------[Arguments]----------------------------------! class(Stl_Type) :: Stl !-----------------------------------[Locals]-----------------------------------! - integer :: fu, v, f, i_ver, n + integer :: fu, v, f, i_ver !==============================================================================! call File % Open_For_Reading_Ascii(Stl % name, fu) @@ -22,7 +22,7 @@ subroutine Read_Stl_Ascii(Stl) if(Line % tokens(1) .eq. 'endsolid') exit if(Line % tokens(1) .eq. 'facet') f = f + 1 end do - if(this_proc < 2) print '(a,i9)', ' # Number of facets on the STL: ', f + if(First_Proc()) print '(a,i9)', ' # Number of facets on the STL: ', f call Stl % Allocate_Stl(f) !------------------------------------------------! @@ -51,7 +51,7 @@ subroutine Read_Stl_Ascii(Stl) call File % Read_Line(fu) ! 'endloop' end if end do - if(this_proc < 2) print '(a)', ' # Read all STL facets!' + if(First_Proc()) print '(a)', ' # Read all STL facets!' close(fu) diff --git a/Sources/Shared/Stl_Mod/Read_Stl_Binary.f90 b/Sources/Shared/Stl_Mod/Read_Stl_Binary.f90 index 97bc16294..254b442bd 100644 --- a/Sources/Shared/Stl_Mod/Read_Stl_Binary.f90 +++ b/Sources/Shared/Stl_Mod/Read_Stl_Binary.f90 @@ -20,7 +20,7 @@ subroutine Read_Stl_Binary(Stl) call File % Read_Binary_Int4_Array(fu, 1) f = int4_array(1) - if(this_proc < 2) print '(a,i9)', ' # Number of facets on the STL: ', f + if(First_Proc()) print '(a,i9)', ' # Number of facets on the STL: ', f call Stl % Allocate_Stl(f) !------------------------------------------------! @@ -42,6 +42,6 @@ subroutine Read_Stl_Binary(Stl) read(fu) byte read(fu) byte end do - if(this_proc < 2) print '(a)', ' # Read all STL facets!' + if(First_Proc()) print '(a)', ' # Read all STL facets!' end subroutine diff --git a/Sources/Shared/String_Mod.f90 b/Sources/Shared/String_Mod.f90 index 63eafe74b..ccc76db85 100644 --- a/Sources/Shared/String_Mod.f90 +++ b/Sources/Shared/String_Mod.f90 @@ -1,7 +1,10 @@ +#include "../Shared/Unused.h90" + !==============================================================================! module String_Mod !------------------------------------------------------------------------------! ! Procedures for handling string. For now To_Upper_Case and To_Lower_Case ! +! and a function which returns a string with only first letter in upper. ! !------------------------------------------------------------------------------! implicit none !==============================================================================! @@ -12,6 +15,7 @@ module String_Mod type String_Type contains + procedure :: First_Upper procedure :: To_Lower_Case procedure :: To_Upper_Case @@ -22,6 +26,7 @@ module String_Mod contains +# include "String_Mod/First_Upper.f90" # include "String_Mod/To_Lower_Case.f90" # include "String_Mod/To_Upper_Case.f90" diff --git a/Sources/Shared/String_Mod/First_Upper.f90 b/Sources/Shared/String_Mod/First_Upper.f90 new file mode 100644 index 000000000..2f9ff6b78 --- /dev/null +++ b/Sources/Shared/String_Mod/First_Upper.f90 @@ -0,0 +1,36 @@ +!==============================================================================! + pure function First_Upper(String, char_array) result(char_manip) +!------------------------------------------------------------------------------! +! Returns a string with first letter from the upper case. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + class(String_Type), intent(in) :: String + character(len=*), intent(in) :: char_array + character(:), allocatable :: char_manip +!-----------------------------------[Locals]-----------------------------------! + integer :: i, value +!------------------------[Avoid unused parent warning]-------------------------! + Unused(String) +!==============================================================================! + + ! Copy the string from the argument to the local which you will manipulate + char_manip = trim(char_array) + + ! Then do the necessary manipulations. First the entire string to lower ... + do i = 1, len_trim(char_manip) + value = ichar(char_manip(i:i)) + if(value >= 65 .and. value <= 90) then + char_manip(i:i) = char(value+32) + end if + end do + + ! ... and finally the first character to upper case + if(len_trim(char_manip) > 0) then + value = ichar(char_manip(1:1)) + if (value >= 97 .and. value <= 122) then + char_manip(1:1) = char(value-32) + end if + end if + + end function diff --git a/Sources/Shared/String_Mod/To_Lower_Case.f90 b/Sources/Shared/String_Mod/To_Lower_Case.f90 index c65d93c09..fe72b3a2d 100644 --- a/Sources/Shared/String_Mod/To_Lower_Case.f90 +++ b/Sources/Shared/String_Mod/To_Lower_Case.f90 @@ -1,14 +1,16 @@ !==============================================================================! - subroutine To_Lower_Case(String, char_array) + pure subroutine To_Lower_Case(String, char_array) !------------------------------------------------------------------------------! -! Transforms String to lowercase. ! +! Transforms string to lowercase. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(String_Type) :: String - character(len=*) :: char_array + class(String_Type), intent(in) :: String + character(len=*), intent(inout) :: char_array !-----------------------------------[Locals]-----------------------------------! integer :: i, value +!------------------------[Avoid unused parent warning]-------------------------! + Unused(String) !==============================================================================! do i = 1, len_trim(char_array) diff --git a/Sources/Shared/String_Mod/To_Upper_Case.f90 b/Sources/Shared/String_Mod/To_Upper_Case.f90 index f56f31e25..d3c8c440b 100644 --- a/Sources/Shared/String_Mod/To_Upper_Case.f90 +++ b/Sources/Shared/String_Mod/To_Upper_Case.f90 @@ -1,14 +1,16 @@ !==============================================================================! subroutine To_Upper_Case(String, char_array) !------------------------------------------------------------------------------! -! Transforms String to uppercase. ! +! Transforms string to uppercase. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(String_Type) :: String - character(len=*) :: char_array + class(String_Type), intent(in) :: String + character(len=*), intent(inout) :: char_array !-----------------------------------[Locals]-----------------------------------! integer :: i, value +!------------------------[Avoid unused parent warning]-------------------------! + Unused(String) !==============================================================================! do i = 1, len_trim(char_array) diff --git a/Sources/Shared/Tokenizer_Mod.f90 b/Sources/Shared/Tokenizer_Mod.f90 index 34411c02c..4f84bcab8 100644 --- a/Sources/Shared/Tokenizer_Mod.f90 +++ b/Sources/Shared/Tokenizer_Mod.f90 @@ -1,10 +1,12 @@ +#include "../Shared/Assert.h90" + !==============================================================================! module Tokenizer_Mod !------------------------------------------------------------------------------! ! Holds functionality to parse lines into tokens. Tokenizes lines. ! !------------------------------------------------------------------------------! !----------------------------------[Modules]-----------------------------------! - use Const_Mod + use Assert_Mod !------------------------------------------------------------------------------! implicit none !------------------------------[Local parameters]------------------------------! @@ -27,6 +29,11 @@ module Tokenizer_Mod end type + !---------------------------! + ! Singleton object Line ! + !---------------------------! + type(Tokenizer_Type) :: Line + contains # include "Tokenizer_Mod/Parse.f90" diff --git a/Sources/Shared/Tokenizer_Mod/Parse.f90 b/Sources/Shared/Tokenizer_Mod/Parse.f90 index 90cea73b0..e5a6b7dfc 100644 --- a/Sources/Shared/Tokenizer_Mod/Parse.f90 +++ b/Sources/Shared/Tokenizer_Mod/Parse.f90 @@ -3,7 +3,7 @@ subroutine Parse(Tok) !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - class(Tokenizer_Type) :: Tok + class(Tokenizer_Type), intent(inout) :: Tok !-----------------------------------[Locals]-----------------------------------! integer :: i, l !==============================================================================! @@ -19,10 +19,11 @@ subroutine Parse(Tok) Tok % n_tokens = 1 Tok % s(1)=1 end if - do i = 1, MAX_TOKENS*2 - 2 + do i = 1, len(Tok % whole) - 1 if( Tok % whole(i: i ) < '!' .and. & Tok % whole(i+1:i+1) >= '!') then Tok % n_tokens = Tok % n_tokens + 1 + Assert(Tok % n_tokens <= MAX_TOKENS) Tok % s(Tok % n_tokens) = i+1 end if if( Tok % whole(i :i ) >= '!' .and. & diff --git a/Sources/Shared/Unused.h90 b/Sources/Shared/Unused.h90 new file mode 100644 index 000000000..29e94e7fd --- /dev/null +++ b/Sources/Shared/Unused.h90 @@ -0,0 +1,9 @@ +!==============================================================================! +! Definition of the macro which avoids too many workings while compiling. ! +!------------------------------------------------------------------------------! + +# if T_FLOWS_DEBUG == 1 +# define Unused(p) associate(p => p); end associate +# else +# define Unused(p) +# endif diff --git a/Sources/Shared/Vect_Mod.f90 b/Sources/Shared/Vect_Mod.f90 new file mode 100644 index 000000000..7da50d52b --- /dev/null +++ b/Sources/Shared/Vect_Mod.f90 @@ -0,0 +1,60 @@ +#include "../Shared/Unused.h90" + +!==============================================================================! + module Vect_Mod +!------------------------------------------------------------------------------! +! Module for OpenMP functionality. ! +! ! +! Some OpenMP functions you get with Omp_Lib: ! +! ! +! - int omp_get_max_threads() ! +! Returns max possible (generally set by OMP_NUM_THREADS). ! +! ! +! - int omp_get_num_threads() ! +! Returns number of threads in current team. ! +! ! +! - int omp_get_thread_num() ! +! Gets current thread number. It is between 0 and omp_get_num_threads()-1 ! +! ! +! - int omp_set_num_threads(num_threads) ! +! Sets the number of threads overriding the OMP_NUM_THREADS. ! +! ! +! I will try to encapsulate those as it is done in Comm_Mod/Type ! +!------------------------------------------------------------------------------! +!----------------------------------[Modules]-----------------------------------! + use Omp_Lib ! for OpenMP functionality + use Region_Mod + use Assert_Mod +!------------------------------------------------------------------------------! + implicit none +!==============================================================================! + + !---------------! + ! Vect type ! + !---------------! + type Vect_Type ! used inside the Grid_Type + + ! Number of threads + integer :: n_threads + + ! Desired number of threads read from control file + integer :: d_threads + + type(Region_Type) :: thread + + ! Thread for each cell and face + integer, allocatable :: cell_thread(:) + integer, allocatable :: face_thread(:) + + contains + procedure :: Get_Max_Threads + procedure :: Set_Num_Threads + + end type + + contains + +# include "Vect_Mod/Get_Max_Threads.f90" +# include "Vect_Mod/Set_Num_Threads.f90" + + end module diff --git a/Sources/Shared/Vect_Mod/Get_Max_Threads.f90 b/Sources/Shared/Vect_Mod/Get_Max_Threads.f90 new file mode 100644 index 000000000..431338835 --- /dev/null +++ b/Sources/Shared/Vect_Mod/Get_Max_Threads.f90 @@ -0,0 +1,17 @@ +!==============================================================================! + integer function Get_Max_Threads(Vect) +!------------------------------------------------------------------------------! + implicit none +!------------------------------------------------------------------------------! + class(Vect_Type) :: Vect +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Vect) +!==============================================================================! + + Get_Max_Threads = 1 +# ifdef _OPENMP + Get_Max_Threads = omp_get_max_threads() +# endif + + end function + diff --git a/Sources/Shared/Vect_Mod/Set_Num_Threads.f90 b/Sources/Shared/Vect_Mod/Set_Num_Threads.f90 new file mode 100644 index 000000000..9ec8a86a9 --- /dev/null +++ b/Sources/Shared/Vect_Mod/Set_Num_Threads.f90 @@ -0,0 +1,19 @@ +!==============================================================================! + subroutine Set_Num_Threads(Vect, n) +!------------------------------------------------------------------------------! + implicit none +!------------------------------------------------------------------------------! + class(Vect_Type) :: Vect + integer, intent(in) :: n +!------------------------[Avoid unused parent warning]-------------------------! + Unused(Vect) +!==============================================================================! + +# ifdef _OPENMP + call omp_set_num_threads(n) +# else + Unused(n) +# endif + + end subroutine + diff --git a/Sources/Shared/Work_Mod/Check_Usage/Finalize_Work.f90 b/Sources/Shared/Work_Mod/Check_Usage/Finalize_Work.f90 index 1f1b83254..27fd7f9b3 100644 --- a/Sources/Shared/Work_Mod/Check_Usage/Finalize_Work.f90 +++ b/Sources/Shared/Work_Mod/Check_Usage/Finalize_Work.f90 @@ -10,7 +10,7 @@ subroutine Finalize_Work(Work) character(DL) :: line !==============================================================================! - if(this_proc < 2) then + if(First_Proc()) then line( 1:160) = ' ' write(line(T+1:T+33),'(a)') ' #==============================#' diff --git a/Sources/Utilities/Check_Isoap.f90 b/Sources/Utilities/Check_Isoap.f90 index 3b45eb31b..59b164280 100644 --- a/Sources/Utilities/Check_Isoap.f90 +++ b/Sources/Utilities/Check_Isoap.f90 @@ -9,8 +9,6 @@ program Test !------------------------------------------------------------------------------! type(Polyhedron_Type) :: Pol type(Iso_Polygons_Type) :: Iso -!------------------------------[Local parameters]------------------------------! - integer, parameter :: NS = 200, NV = 240 !-----------------------------------[Locals]-----------------------------------! integer :: icellgeom, ifunc, ifile character(80) :: arg diff --git a/Sources/Utilities/Dimensional_Solvers/Bicg.f90 b/Sources/Utilities/Dimensional_Solvers/Bicg.f90 deleted file mode 100644 index 4cde16ead..000000000 --- a/Sources/Utilities/Dimensional_Solvers/Bicg.f90 +++ /dev/null @@ -1,202 +0,0 @@ -!==============================================================================! - subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned BiCG method ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Work_Mod, only: p1 => r_cell_11, & - p2 => r_cell_12, & - q1 => r_cell_13, & - q2 => r_cell_14, & - r1 => r_cell_15, & - r2 => r_cell_16 -!------------------------------------------------------------------------------! -! When using Work_Mod, calling sequence should be outlined ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Compute_Energy (uses r_cell_01..03) ! -! | | ! -! +----> Compute_Momentum (does not use Work_Mod) ! -! | | ! -! +----> Compute_Scalar (uses r_cell_04) ! -! | ! -! +----> Bicg (safe to use r_cell_11..16) ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Turb_Mod_Main (does not use Work_Mod) ! -! | ! -! +---> Turb_Mod_Compute_Variable (does not use Work_Mod) ! -! | | ! -! +---> Turb_Mod_Compute_Stress (uses r_cell_01..09) ! -! | ! -! +----> Bicg (safe to use r_cell_11..16) ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter -!==============================================================================! - - ! Take some aliases - D => Nat % D - nt = A % pnt_grid % n_cells - ni = A % pnt_grid % n_cells - A % pnt_grid % Comm % n_buff_cells - nb = A % pnt_grid % n_bnd_cells - - res = 0.0 - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter = 0 - goto 1 - end if - - !----------------! - ! r = b - Ax ! - !----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter = 0 - goto 1 - end if - - !-----------------------! - ! Choose initial r~ ! - !-----------------------! - do i = 1, ni - r2(i) = r1(i) - end do - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !------------------------! - ! solve M z = r ! - ! solve M^T z~ = r~ ! don't have M^T!!! - ! (q instead of z) ! - !------------------------! - call Nat % Prec_Solve(ni, A, D, q1(1:nt), r1(1:nt), prec) - call Nat % Prec_Solve(ni, A, D, q2(1:nt), r2(1:nt), prec) - - !------------------! - ! rho = (z,r~) ! - !------------------! - rho = dot_product(q1(1:ni), r2(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - p1(1:ni) = q1(1:ni) - p2(1:ni) = q2(1:ni) - else - beta = rho / rho_old - p1(1:ni) = q1(1:ni) + beta * p1(1:ni) - p2(1:ni) = q2(1:ni) + beta * p2(1:ni) - end if - - !---------------! - ! q = A p ! - ! q~= A^T p~ ! don't have A^T - !---------------! - call A % pnt_grid % Exchange_Cells_Real(p1(-nb:ni)) - call A % pnt_grid % Exchange_Cells_Real(p2(-nb:ni)) - do i = 1, ni - q1(i) = 0.0 - q2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q1(i) = q1(i) + A % val(j) * p1(k) - q2(i) = q2(i) + A % val(j) * p2(k) - end do - end do - - !----------------------! - ! alfa = rho/(p,q) ! - !----------------------! - alfa = 0.0 - alfa = alfa + dot_product(p2(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa = rho / alfa - - !--------------------! - ! x = x + alfa p ! - ! r = r - alfa q ! - !--------------------! - x (1:ni) = x (1:ni) + alfa*p1(1:ni) - r1(1:ni) = r1(1:ni) - alfa*q1(1:ni) - r2(1:ni) = r2(1:ni) - alfa*q2(1:ni) - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old = rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call A % pnt_grid % Exchange_Cells_Real(x(-nb:ni)) - - fin_res = res - niter = iter - - end subroutine diff --git a/Sources/Utilities/Dimensional_Solvers/Cg.f90 b/Sources/Utilities/Dimensional_Solvers/Cg.f90 deleted file mode 100644 index 3d93bed2c..000000000 --- a/Sources/Utilities/Dimensional_Solvers/Cg.f90 +++ /dev/null @@ -1,181 +0,0 @@ -!==============================================================================! - subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned CG method ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Work_Mod, only: p1 => r_cell_01, & - q1 => r_cell_02, & - r1 => r_cell_03 -!------------------------------------------------------------------------------! -! When using Work_Mod, calling sequence should be outlined ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Compute_Pressure (does not use Work_Mod) ! -! | ! -! +----> Cg (safe to use r_cell_01..03) ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Turb_Mod_Main (does not use Work_Mod) ! -! | ! -! +---> Turb_Mod_Compute_F22 (does not use Work_Mod) ! -! | ! -! +----> Cg (safe to use r_cell_01..03) ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter -!==============================================================================! - - ! Take some aliases - D => Nat % D - nt = A % pnt_grid % n_cells - ni = A % pnt_grid % n_cells - A % pnt_grid % Comm % n_buff_cells - nb = A % pnt_grid % n_bnd_cells - - res = 0.0 - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter = 0 - goto 1 - end if - - !----------------! - ! r = b - Ax ! - !----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter = 0 - goto 1 - end if - - !-----------! - ! p = r ! - !-----------! - p1(1:ni) = r1(1:ni) - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !----------------------! - ! solve Mz = r ! - ! (q instead of z) ! - !----------------------! - call Nat % Prec_Solve(ni, A, D, q1(1:nt), r1(1:nt), prec) - - !-----------------! - ! rho = (r,z) ! - !-----------------! - rho = dot_product(r1(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - p1(1:ni) = q1(1:ni) - else - beta = rho / rho_old - p1(1:ni) = q1(1:ni) + beta * p1(1:ni) - end if - - !------------! - ! q = Ap ! - !------------! - call A % pnt_grid % Exchange_Cells_Real(p1(-nb:ni)) - do i = 1, ni - q1(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q1(i) = q1(i) + A % val(j) * p1(k) - end do - end do - - !------------------------! - ! alfa = (r,z)/(p,q) ! - !------------------------! - alfa = dot_product(p1(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa = rho/alfa - - !---------------------! - ! x = x + alfa p ! - ! r = r - alfa Ap ! - !---------------------! - x (1:ni) = x (1:ni) + alfa * p1(1:ni) - r1(1:ni) = r1(1:ni) - alfa * q1(1:ni) - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old = rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call A % pnt_grid % Exchange_Cells_Real(x(-nb:ni)) - - fin_res = res - niter = iter - - end subroutine diff --git a/Sources/Utilities/Dimensional_Solvers/Cgs.f90 b/Sources/Utilities/Dimensional_Solvers/Cgs.f90 deleted file mode 100644 index 3012685d9..000000000 --- a/Sources/Utilities/Dimensional_Solvers/Cgs.f90 +++ /dev/null @@ -1,203 +0,0 @@ -!==============================================================================! - subroutine Cgs(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned CGS method ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Work_Mod, only: p1 => r_cell_01, & - p2 => r_cell_02, & - q1 => r_cell_03, & - q2 => r_cell_04, & - r1 => r_cell_06, & - r2 => r_cell_07, & - u1 => r_cell_08, & - u2 => r_cell_09, & - v2 => r_cell_10, & - u1_plus_q1 => r_cell_11 -!------------------------------------------------------------------------------! -! When using Work_Mod, calling sequence should be outlined, but this ! -! procedure is never called, so it doesn't make much sense to do it. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter -!==============================================================================! - - ! Take some aliases - D => Nat % D - nt = A % pnt_grid % n_cells - ni = A % pnt_grid % n_cells - A % pnt_grid % Comm % n_buff_cells - nb = A % pnt_grid % n_bnd_cells - - res = 0.0 - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter=0 - goto 1 - end if - - !-----------------! - ! r1 = b - Ax ! - !-----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter=0 - goto 1 - end if - - !-------------! - ! r2 = r1 ! - !-------------! - r2(1:ni) = r1(1:ni) - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !-------------------! - ! rho = (r2,z1) ! - !-------------------! - rho = dot_product(r1(1:ni), r2(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - u1(1:ni) = r1(1:ni) - u2(1:ni) = u1(1:ni) - else - beta = rho / rho_old - u1(1:ni) = r1(1:ni) + beta * q1(1:ni) - u2(1:ni) = u1(1:ni) + beta * (q1(1:ni) + beta*u2(1:ni)) - end if - - !---------------------! - ! Solve M p2 = u2 ! - !---------------------! - call Nat % Prec_Solve(ni, A, D, p2(1:nt), u2(1:nt), prec) - - !--------------! - ! v2 = Ap2 ! - !--------------! - call A % pnt_grid % Exchange_Cells_Real(p2(-nb:ni)) - do i = 1, ni - v2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - v2(i) = v2(i) + A % val(j) * p2(k) - end do - alfa = alfa + r2(i) * v2(i) - end do - - !------------------------! - ! alfa = rho/(r2,v2) ! - !------------------------! - alfa = dot_product(r2(1:ni), v2(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa=rho / alfa - - !-------------------------! - ! q1 = u1 - alfa * v2 ! - !-------------------------! - q1(1:ni) = u1(1:ni) - alfa * v2(1:ni) - - !-------------------------! - ! solve Mp1 = u1 + q1 ! - !-------------------------! - u1_plus_q1(1:ni) = u1(1:ni) + q1(1:ni) - call Nat % Prec_Solve(ni, A, D, p1(1:nt), u1_plus_q1(1:nt), prec) - - !---------------------! - ! x = x + alfa p1 ! - !---------------------! - x(1:ni) = x(1:ni) + alfa * p1(1:ni) - - !---------------! - ! q2 = A p1 ! - !---------------! - call A % pnt_grid % Exchange_Cells_Real(p1(-nb:ni)) - do i = 1, ni - q2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q2(i) = q2(i) + A % val(j) * p1(k) - end do - end do - - !---------------------! - ! r = r - alfa q2 ! - !---------------------! - r1(1:ni) = r1(1:ni) - alfa * q2(1:ni) - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old=rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call A % pnt_grid % Exchange_Cells_Real(x(-nb:ni)) - - fin_res = res - niter = iter - - end subroutine diff --git a/Sources/Utilities/Normalized_Solvers/Bicg.f90 b/Sources/Utilities/Normalized_Solvers/Bicg.f90 deleted file mode 100644 index 8fe36b315..000000000 --- a/Sources/Utilities/Normalized_Solvers/Bicg.f90 +++ /dev/null @@ -1,234 +0,0 @@ -!==============================================================================! - subroutine Bicg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned BiCG method ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Work_Mod, only: p1 => r_cell_11, & - p2 => r_cell_12, & - q1 => r_cell_13, & - q2 => r_cell_14, & - r1 => r_cell_15, & - r2 => r_cell_16 -!------------------------------------------------------------------------------! -! When using Work_Mod, calling sequence should be outlined ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Compute_Energy (uses r_cell_01..03) ! -! | | ! -! +----> Compute_Momentum (does not use Work_Mod) ! -! | | ! -! +----> Compute_Scalar (uses r_cell_04) ! -! | ! -! +----> Bicg (safe to use r_cell_11..17) ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Turb_Mod_Main (does not use Work_Mod) ! -! | ! -! +---> Turb_Mod_Compute_Variable (does not use Work_Mod) ! -! | | ! -! +---> Turb_Mod_Compute_Stress (uses r_cell_01..09) ! -! | ! -! +----> Bicg (safe to use r_cell_11..16) ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter - real :: sum_a, fn - integer :: sum_n -!==============================================================================! - - ! Take some aliases - D => Nat % D - nt = A % pnt_grid % n_cells - ni = A % pnt_grid % n_cells - A % pnt_grid % Comm % n_buff_cells - nb = A % pnt_grid % n_bnd_cells - - res = 0.0 - - !--------------------------! - ! Normalize the system ! - !--------------------------! - sum_a = 0.0 - sum_n = 0 - do i = 1, ni - sum_a = sum_a + A % val(A % dia(i)) - sum_n = sum_n + 1 - end do - call Comm_Mod_Global_Sum_Real(sum_a) - call Comm_Mod_Global_Sum_Int (sum_n) ! this is stored somewhere, check - sum_a = sum_a / sum_n - fn = 1.0 / sum_a - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) * fn - end do - b(i) = b(i) * fn - end do - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter = 0 - goto 1 - end if - - !----------------! - ! r = b - Ax ! - !----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter = 0 - goto 1 - end if - - !-----------------------! - ! Choose initial r~ ! - !-----------------------! - do i = 1, ni - r2(i) = r1(i) - end do - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !------------------------! - ! solve M z = r ! - ! solve M^T z~ = r~ ! don't have M^T!!! - ! (q instead of z) ! - !------------------------! - call Nat % Prec_Solve(ni, A, D, q1(1:nt), r1(1:nt), prec) - call Nat % Prec_Solve(ni, A, D, q2(1:nt), r2(1:nt), prec) - - !------------------! - ! rho = (z,r~) ! - !------------------! - rho = dot_product(q1(1:ni), r2(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - p1(1:ni) = q1(1:ni) - p2(1:ni) = q2(1:ni) - else - beta = rho / rho_old - p1(1:ni) = q1(1:ni) + beta * p1(1:ni) - p2(1:ni) = q2(1:ni) + beta * p2(1:ni) - end if - - !---------------! - ! q = A p ! - ! q~= A^T p~ ! don't have A^T - !---------------! - call A % pnt_grid % Exchange_Cells_Real(p1(-nb:ni)) - call A % pnt_grid % Exchange_Cells_Real(p2(-nb:ni)) - do i = 1, ni - q1(i) = 0.0 - q2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q1(i) = q1(i) + A % val(j) * p1(k) - q2(i) = q2(i) + A % val(j) * p2(k) - end do - end do - - !----------------------! - ! alfa = rho/(p,q) ! - !----------------------! - alfa = 0.0 - alfa = alfa + dot_product(p2(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa = rho / alfa - - !--------------------! - ! x = x + alfa p ! - ! r = r - alfa q ! - !--------------------! - x (1:ni) = x (1:ni) + alfa*p1(1:ni) - r1(1:ni) = r1(1:ni) - alfa*q1(1:ni) - r2(1:ni) = r2(1:ni) - alfa*q2(1:ni) - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old = rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call A % pnt_grid % Exchange_Cells_Real(x(-nb:ni)) - - !-----------------------------! - ! De-normalize the system ! - !-----------------------------! - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) / fn - end do - b(i) = b(i) / fn - end do - - fin_res = res - niter = iter - - end subroutine diff --git a/Sources/Utilities/Normalized_Solvers/Cg.f90 b/Sources/Utilities/Normalized_Solvers/Cg.f90 deleted file mode 100644 index 48427f5f3..000000000 --- a/Sources/Utilities/Normalized_Solvers/Cg.f90 +++ /dev/null @@ -1,213 +0,0 @@ -!==============================================================================! - subroutine Cg(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned CG method ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Work_Mod, only: p1 => r_cell_01, & - q1 => r_cell_02, & - r1 => r_cell_03 -!------------------------------------------------------------------------------! -! When using Work_Mod, calling sequence should be outlined ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Compute_Pressure (does not use Work_Mod) ! -! | ! -! +----> Cg (safe to use r_cell_01..03) ! -! ! -! Main_Pro (allocates Work_Mod) ! -! | ! -! +----> Turb_Mod_Main (does not use Work_Mod) ! -! | ! -! +---> Turb_Mod_Compute_F22 (does not use Work_Mod) ! -! | ! -! +----> Cg (safe to use r_cell_01..04) ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter - real :: sum_a, fn - integer :: sum_n -!==============================================================================! - - ! Take some aliases - D => Nat % D - nt = A % pnt_grid % n_cells - ni = A % pnt_grid % n_cells - A % pnt_grid % Comm % n_buff_cells - nb = A % pnt_grid % n_bnd_cells - - res = 0.0 - - !--------------------------! - ! Normalize the system ! - !--------------------------! - sum_a = 0.0 - sum_n = 0 - do i = 1, ni - sum_a = sum_a + A % val(A % dia(i)) - sum_n = sum_n + 1 - end do - call Comm_Mod_Global_Sum_Real(sum_a) - call Comm_Mod_Global_Sum_Int (sum_n) ! this is stored somewhere, check - sum_a = sum_a / sum_n - fn = 1.0 / sum_a - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) * fn - end do - b(i) = b(i) * fn - end do - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter = 0 - goto 1 - end if - - !----------------! - ! r = b - Ax ! - !----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter = 0 - goto 1 - end if - - !-----------! - ! p = r ! - !-----------! - p1(1:ni) = r1(1:ni) - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !----------------------! - ! solve Mz = r ! - ! (q instead of z) ! - !----------------------! - call Nat % Prec_Solve(ni, A, D, q1(1:nt), r1(1:nt), prec) - - !-----------------! - ! rho = (r,z) ! - !-----------------! - rho = dot_product(r1(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - p1(1:ni) = q1(1:ni) - else - beta = rho / rho_old - p1(1:ni) = q1(1:ni) + beta * p1(1:ni) - end if - - !------------! - ! q = Ap ! - !------------! - call A % pnt_grid % Exchange_Cells_Real(p1(-nb:ni)) - do i = 1, ni - q1(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q1(i) = q1(i) + A % val(j) * p1(k) - end do - end do - - !------------------------! - ! alfa = (r,z)/(p,q) ! - !------------------------! - alfa = dot_product(p1(1:ni), q1(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa = rho/alfa - - !---------------------! - ! x = x + alfa p ! - ! r = r - alfa Ap ! - !---------------------! - x (1:ni) = x (1:ni) + alfa * p1(1:ni) - r1(1:ni) = r1(1:ni) - alfa * q1(1:ni) - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old = rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call A % pnt_grid % Exchange_Cells_Real(x(-nb:ni)) - - !-----------------------------! - ! De-normalize the system ! - !-----------------------------! - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) / fn - end do - b(i) = b(i) / fn - end do - - fin_res = res - niter = iter - - end subroutine diff --git a/Sources/Utilities/Normalized_Solvers/Cgs.f90 b/Sources/Utilities/Normalized_Solvers/Cgs.f90 deleted file mode 100644 index 84d12ac58..000000000 --- a/Sources/Utilities/Normalized_Solvers/Cgs.f90 +++ /dev/null @@ -1,235 +0,0 @@ -!==============================================================================! - subroutine Cgs(Nat, A, x, b, prec, miter, niter, tol, fin_res, norm) -!------------------------------------------------------------------------------! -! Solves the linear systems of equations by a preconditioned CGS method ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Work_Mod, only: p1 => r_cell_01, & - p2 => r_cell_02, & - q1 => r_cell_03, & - q2 => r_cell_04, & - r1 => r_cell_06, & - r2 => r_cell_07, & - u1 => r_cell_08, & - u2 => r_cell_09, & - v2 => r_cell_10, & - u1_plus_q1 => r_cell_11 -!------------------------------------------------------------------------------! -! When using Work_Mod, calling sequence should be outlined, but this ! -! procedure is never called, so it doesn't make much sense to do it. ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - class(Native_Type), target :: Nat - type(Matrix_Type) :: A - real :: x(-Nat % pnt_grid % n_bnd_cells : & - Nat % pnt_grid % n_cells) - real :: b( Nat % pnt_grid % n_cells) - character(SL) :: prec ! preconditioner - integer :: miter ! maximum and actual ... - integer :: niter ! ... number of iterations - real :: tol ! tolerance - real :: fin_res ! final residual - real, optional :: norm ! normalization -!-----------------------------------[Locals]-----------------------------------! - type(Matrix_Type), pointer :: D - integer :: nt, ni, nb - real :: alfa, beta, rho, rho_old, bnrm2, res - integer :: i, j, k, iter - real :: sum_a, fn - integer :: sum_n -!==============================================================================! - - ! Take some aliases - D => Nat % D - nt = A % pnt_grid % n_cells - ni = A % pnt_grid % n_cells - A % pnt_grid % Comm % n_buff_cells - nb = A % pnt_grid % n_bnd_cells - - res = 0.0 - - !--------------------------! - ! Normalize the system ! - !--------------------------! - sum_a = 0.0 - sum_n = 0 - do i = 1, ni - sum_a = sum_a + A % val(A % dia(i)) - sum_n = sum_n + 1 - end do - call Comm_Mod_Global_Sum_Real(sum_a) - call Comm_Mod_Global_Sum_Int (sum_n) ! this is stored somewhere, check - sum_a = sum_a / sum_n - fn = 1.0 / sum_a - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) * fn - end do - b(i) = b(i) * fn - end do - - !---------------------! - ! Preconditioning ! - !---------------------! - call Nat % Prec_Form(ni, A, D, prec) - - !-----------------------------------! - ! This is quite tricky point. ! - ! What if bnrm2 is very small ? ! - !-----------------------------------! - if(.not. present(norm)) then - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt)) - else - bnrm2 = Nat % Normalized_Root_Mean_Square(ni, b(1:nt), A, x(1:nt), norm) - end if - - if(bnrm2 < tol) then - iter=0 - goto 1 - end if - - !-----------------! - ! r1 = b - Ax ! - !-----------------! - call Nat % Residual_Vector(ni, r1(1:nt), b(1:nt), A, x(1:nt)) - - !--------------------------------! - ! Calculate initial residual ! - !--------------------------------! - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - - if(res < tol) then - iter = 0 - goto 1 - end if - - !-------------! - ! r2 = r1 ! - !-------------! - r2(1:ni) = r1(1:ni) - - !---------------! - ! ! - ! Main loop ! - ! ! - !---------------! - do iter = 1, miter - - !-------------------! - ! rho = (r2,z1) ! - !-------------------! - rho = dot_product(r1(1:ni), r2(1:ni)) - call Comm_Mod_Global_Sum_Real(rho) - - if(iter .eq. 1) then - u1(1:ni) = r1(1:ni) - u2(1:ni) = u1(1:ni) - else - beta = rho / rho_old - u1(1:ni) = r1(1:ni) + beta * q1(1:ni) - u2(1:ni) = u1(1:ni) + beta * (q1(1:ni) + beta*u2(1:ni)) - end if - - !---------------------! - ! Solve M p2 = u2 ! - !---------------------! - call Nat % Prec_Solve(ni, A, D, p2(1:nt), u2(1:nt), prec) - - !--------------! - ! v2 = Ap2 ! - !--------------! - call A % pnt_grid % Exchange_Cells_Real(p2(-nb:ni)) - do i = 1, ni - v2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - v2(i) = v2(i) + A % val(j) * p2(k) - end do - alfa = alfa + r2(i) * v2(i) - end do - - !------------------------! - ! alfa = rho/(r2,v2) ! - !------------------------! - alfa = dot_product(r2(1:ni), v2(1:ni)) - call Comm_Mod_Global_Sum_Real(alfa) - alfa=rho / alfa - - !-------------------------! - ! q1 = u1 - alfa * v2 ! - !-------------------------! - q1(1:ni) = u1(1:ni) - alfa * v2(1:ni) - - !-------------------------! - ! solve Mp1 = u1 + q1 ! - !-------------------------! - u1_plus_q1(1:ni) = u1(1:ni) + q1(1:ni) - call Nat % Prec_Solve(ni, A, D, p1(1:nt), u1_plus_q1(1:nt), prec) - - !---------------------! - ! x = x + alfa p1 ! - !---------------------! - x(1:ni) = x(1:ni) + alfa * p1(1:ni) - - !---------------! - ! q2 = A p1 ! - !---------------! - call A % pnt_grid % Exchange_Cells_Real(p1(-nb:ni)) - do i = 1, ni - q2(i) = 0.0 - do j = A % row(i), A % row(i+1)-1 - k = A % col(j) - q2(i) = q2(i) + A % val(j) * p1(k) - end do - end do - - !---------------------! - ! r = r - alfa q2 ! - !---------------------! - r1(1:ni) = r1(1:ni) - alfa * q2(1:ni) - - !-----------------------! - ! Check convergence ! - !-----------------------! - if(.not. present(norm)) then - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt)) - else - res = Nat % Normalized_Root_Mean_Square(ni, r1(1:nt), A, x(1:nt), norm) - end if - - if(res < tol) goto 1 - - rho_old = rho - - end do ! iter - - ! Correct the number of executed iterations, because - ! Fortran goes one number up do loop's upper limit - iter = iter - 1 - - !----------------------------------! - ! ! - ! Convergence has been reached ! - ! ! - !----------------------------------! -1 continue - - !-------------------------------------------! - ! Refresh the solution vector's buffers ! - !-------------------------------------------! - call A % pnt_grid % Exchange_Cells_Real(x(-nb:ni)) - - !-----------------------------! - ! De-normalize the system ! - !-----------------------------! - do i = 1, nt - do j = A % row(i), A % row(i+1)-1 - A % val(j) = A % val(j) / fn - end do - b(i) = b(i) / fn - end do - - fin_res = res - niter = iter - - end subroutine diff --git a/Tests/Functionality/Communication/User_Mod/Beginning_Of_Time_Step.f90 b/Tests/Functionality/Communication/User_Mod/Beginning_Of_Time_Step.f90 index 1e1346172..a6d546675 100644 --- a/Tests/Functionality/Communication/User_Mod/Beginning_Of_Time_Step.f90 +++ b/Tests/Functionality/Communication/User_Mod/Beginning_Of_Time_Step.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: G type(Var_Type), pointer :: u, v, w, t, phi @@ -54,7 +52,7 @@ subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, n, time) call Work % Disconnect_Real_Cell(var) - call Comm_Mod_End + call Global % End_Parallel stop end subroutine diff --git a/Tests/Functionality/Eddies/control b/Tests/Functionality/Eddies/control index f0b0e84af..18f3c4d49 100644 --- a/Tests/Functionality/Eddies/control +++ b/Tests/Functionality/Eddies/control @@ -1,56 +1,53 @@ #---------- # Prologue #--------- -#PROBLEM_NAME cube-x -#PROBLEM_NAME cube-y - PROBLEM_NAME cube-z - HEAT_TRANSFER no +# PROBLEM_NAME cube-x +# PROBLEM_NAME cube-y + PROBLEM_NAME cube-z + HEAT_TRANSFER no -NUMBER_OF_TIME_STEPS 240 -RESULTS_SAVE_INTERVAL 1 -BACKUP_SAVE_INTERVAL 30 + NUMBER_OF_TIME_STEPS 240 + RESULTS_SAVE_INTERVAL 1 + BACKUP_SAVE_INTERVAL 30 -TIME_STEP 0.02 - -#LOAD_BACKUP_NAME backstep_orthogonal-ts.backup + TIME_STEP 0.02 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-2 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-2 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Functionality/Gradients/User_Mod/Initialize_Variables.f90 b/Tests/Functionality/Gradients/User_Mod/Initialize_Variables.f90 index 446057595..ae94aa128 100644 --- a/Tests/Functionality/Gradients/User_Mod/Initialize_Variables.f90 +++ b/Tests/Functionality/Gradients/User_Mod/Initialize_Variables.f90 @@ -18,7 +18,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) character(8) :: name = 'check_xx' real, contiguous, pointer :: phi_f(:), phi_n(:), phi_c(:) real, contiguous, pointer :: phi_x(:), phi_y(:), phi_z(:) - integer, contiguous, pointer :: c_at_bnd(:), c_cnt(:) + integer, contiguous, pointer :: c_computed(:), c_visited(:) !------------------------------[Local parameters]------------------------------! integer, parameter :: YES = 1 integer, parameter :: NO = YES-1 @@ -27,7 +27,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) call Work % Connect_Real_Face(phi_f) call Work % Connect_Real_Node(phi_n) call Work % Connect_Real_Cell(phi_x, phi_y, phi_z, phi_c) - call Work % Connect_Int_Cell (c_at_bnd, c_cnt) + call Work % Connect_Int_Cell (c_computed, c_visited) ! Take aliases Grid => Flow % pnt_grid @@ -38,17 +38,6 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) Flow % gauss_miter = 100 Flow % gauss_tol = 1e-3 - !----------------------------! - ! Find cells at boundary ! - !----------------------------! - c_at_bnd(:) = NO - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1, s) - c2 = Grid % faces_c(2, s) - - if(c2 < 0) c_at_bnd(c1) = YES - end do - !----------------------------------------------------------------------! ! ! ! Test 1: ! @@ -58,7 +47,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! ! !----------------------------------------------------------------------! - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# Performing Test 1 - least square cell based method' print *, '#--------------------------------------------------------------' @@ -92,7 +81,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! ! !---------------------------------------------------------! - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# Performing Test 2 - Gaussian method from poor initial guess' print *, '#--------------------------------------------------------------' @@ -122,7 +111,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! ! !---------------------------------------------------------! - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# Performing Test 3 - Gaussian method from better initial guess' print *, '#--------------------------------------------------------------' @@ -180,7 +169,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! ! !-------------------------------------------------------------------------! - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# Performing Test 4 - Gaussian method from an elaborate guess' print *, '#--------------------------------------------------------------' @@ -214,107 +203,83 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) t % grad_method = LEAST_SQUARES call Flow % Grad_Variable(t) - !--------------------------------------------------------------------! - ! Step 1: Extrapolate interior gradient values to boundary cells ! - ! using only values from interior cells - which are good ! - ! This step will leave the boundary cells surrounded by ! - ! other boundary cells unchanged (reset to zero, really) ! - !--------------------------------------------------------------------! - c_cnt(:) = 0 - do c = 1, Grid % n_cells + !-----------------------------------------------------------------------! + ! Extrapolate interior gradient values to boundary cells using only ! + ! values which are known, either from interior cells, or cells near ! + ! boundaries computed in previous iterations. ! + !-----------------------------------------------------------------------! - ! Cell is at the boundary, intervene here - if(c_at_bnd(c) .eq. YES) then + ! First assume all are computed although you know the cells near the + ! bounderies are not computed well; but they will be treated below + c_computed(:) = YES - ! Nullify its gradients, and the counter - ! for cells from which you interpolate + ! Mark cells which are not computed for the 1st time + ! At this point, these are cells near the boundaries + do s = 1, Grid % n_faces + c1 = Grid % faces_c(1, s) + c2 = Grid % faces_c(2, s) + if(c2 < 0) c_computed(c1) = NO + end do + + call Grid % Exchange_Cells_Int(c_computed) + + ! Nullify gradients for cells near boundaries + ! (where gradients are not computed properly), + ! and initialize c_visited + do c = 1, Grid % n_cells + if(c_computed(c) .eq. NO) then ! if not computed t % x(c) = 0.0 t % y(c) = 0.0 t % z(c) = 0.0 - c_cnt(c) = 0 ! probably not needed, initialized above - - ! Browse through this cell's faces - do i_fac = 1, Grid % cells_n_faces(c) - s_prim = Grid % cells_f(i_fac, c) - c1_prim = Grid % faces_c(1, s_prim) - c2_prim = Grid % faces_c(2, s_prim) - - ! Consider c1_prim if it is not cell at boundary - if(c_at_bnd(c1_prim) .eq. NO) then - t % x(c) = t % x(c) + t % x(c1_prim) - t % y(c) = t % y(c) + t % y(c1_prim) - t % z(c) = t % z(c) + t % z(c1_prim) - c_cnt(c) = c_cnt(c) + 1 - end if - - ! Consider c2_prim if it is not cell at boundary - ! and not a boundary cell. - if(c_at_bnd(c2_prim) .eq. NO .and. & - c2_prim .gt. 0) then - t % x(c) = t % x(c) + t % x(c2_prim) - t % y(c) = t % y(c) + t % y(c2_prim) - t % z(c) = t % z(c) + t % z(c2_prim) - c_cnt(c) = c_cnt(c) + 1 - end if - - end do - - ! Work out the average - if(c_cnt(c) .gt. 0) then - t % x(c) = t % x(c) / c_cnt(c) - t % y(c) = t % y(c) / c_cnt(c) - t % z(c) = t % z(c) / c_cnt(c) - end if - - end if ! c at bnd - + c_visited(c) = 0 + end if end do - !-----------------------------------------------------------------------! - ! Step 2: Previous step left the cells at boundary, which are only ! - ! surrounded by other cells at boundary, untreated. Here, ! - ! you are less selective and extrapolate even from cells at ! - ! boundaries, which were interpolated in the Step 1 above. ! - !-----------------------------------------------------------------------! - do c = 1, Grid % n_cells - - ! Cell is at the boundary, and hasn't been treated yet - if(c_at_bnd(c) .eq. YES .and. c_cnt(c) .eq. 0) then - - ! Browse through this cell's faces - do i_fac = 1, Grid % cells_n_faces(c) - s_prim = Grid % cells_f(i_fac, c) - c1_prim = Grid % faces_c(1, s_prim) - c2_prim = Grid % faces_c(2, s_prim) - - if(c1_prim .ne. c .and. & ! skip your own self - c_cnt(c1_prim) .gt. 0) then ! consider only cells with values - t % x(c) = t % x(c) + t % x(c1_prim) - t % y(c) = t % y(c) + t % y(c1_prim) - t % z(c) = t % z(c) + t % z(c1_prim) - c_cnt(c) = c_cnt(c) + 1 + !------------------------------------------------! + ! Extrapolate in several iterations, as long ! + ! as there are cells which are not computed. ! + !------------------------------------------------! + do iter = 1, 3 + + ! Browse through faces to find the cells which need ... + ! ... updating, and accumulate gradients in them as well + do s = 1, Grid % n_faces + c1 = Grid % faces_c(1, s) + c2 = Grid % faces_c(2, s) + + if(c2 > 0) then + if(c_computed(c1) .eq. NO .and. c_computed(c2) .eq. YES) then + t % x(c1) = t % x(c1) + t % x(c2) + t % y(c1) = t % y(c1) + t % y(c2) + t % z(c1) = t % z(c1) + t % z(c2) + c_visited(c1) = c_visited(c1) + 1 end if - if(c2_prim .ne. c .and. & ! skip your own self - c2_prim .gt. 0 .and. & ! consider only cells with values - c_cnt(c2_prim) .gt. 0) then ! don't use boundary cells - t % x(c) = t % x(c) + t % x(c2_prim) - t % y(c) = t % y(c) + t % y(c2_prim) - t % z(c) = t % z(c) + t % z(c2_prim) - c_cnt(c) = c_cnt(c) + 1 + if(c_computed(c2) .eq. NO .and. c_computed(c1) .eq. YES) then + t % x(c2) = t % x(c2) + t % x(c1) + t % y(c2) = t % y(c2) + t % y(c1) + t % z(c2) = t % z(c2) + t % z(c1) + c_visited(c2) = c_visited(c2) + 1 end if - - end do - - if(c_cnt(c) .gt. 0) then - t % x(c) = t % x(c) / c_cnt(c) - t % y(c) = t % y(c) / c_cnt(c) - t % z(c) = t % z(c) / c_cnt(c) end if + end do + + ! Browse throough cells, and calculate final values ... + ! ... of gradients in the cells which have been visited + do c = 1, Grid % n_cells + if(c_visited(c) > 0) then + t % x(c) = t % x(c) / c_visited(c) + t % y(c) = t % y(c) / c_visited(c) + t % z(c) = t % z(c) / c_visited(c) + c_visited(c) = 0 + c_computed(c) = YES ! mark it as computed for the next iteration + end if + end do + call Grid % Exchange_Cells_Real(t % x) + call Grid % Exchange_Cells_Real(t % y) + call Grid % Exchange_Cells_Real(t % z) - end if ! c at bnd - - end do + end do ! iter ! Save the initial guess that you got call Grid % Save_Debug_Vtu( & @@ -343,7 +308,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! ! !----------------------------------------------------------------------! - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# Performing Test 5 - Field % Grad_Gauss_Pressure ' print *, '#--------------------------------------------------------------' @@ -372,6 +337,9 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) call Work % Disconnect_Real_Face(phi_f) call Work % Disconnect_Real_Node(phi_n) call Work % Disconnect_Real_Cell(phi_x, phi_y, phi_z, phi_c) - call Work % Disconnect_Int_Cell (c_at_bnd, c_cnt) + call Work % Disconnect_Int_Cell (c_computed, c_visited) + + call Global % End_Parallel + stop end subroutine diff --git a/Tests/Functionality/Gradients/control b/Tests/Functionality/Gradients/control index 144d593a0..166a6452f 100644 --- a/Tests/Functionality/Gradients/control +++ b/Tests/Functionality/Gradients/control @@ -7,26 +7,26 @@ # This is just to give it temperature # as dependendent variable to work on -HEAT_TRANSFER yes + HEAT_TRANSFER yes # Do not compute anything except what # is in User_Mod_Initialize_Variables -NUMBER_OF_TIME_STEPS 0 + NUMBER_OF_TIME_STEPS 0 # Boundary conditions are mandatory -BOUNDARY_CONDITION top - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20.0 + BOUNDARY_CONDITION top + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20.0 -BOUNDARY_CONDITION bottom - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10.0 + BOUNDARY_CONDITION bottom + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10.0 -BOUNDARY_CONDITION side - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 15.0 + BOUNDARY_CONDITION side + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 15.0 diff --git a/Tests/Functionality/Omp/User_Mod/Beginning_Of_Simulation.f90 b/Tests/Functionality/Omp/User_Mod/Beginning_Of_Simulation.f90 new file mode 100644 index 000000000..4d7c9f080 --- /dev/null +++ b/Tests/Functionality/Omp/User_Mod/Beginning_Of_Simulation.f90 @@ -0,0 +1,128 @@ +!==============================================================================! + subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm) +!------------------------------------------------------------------------------! +! This function is called at the beginning of simulation. ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm +!------------------------------[Local parameters]------------------------------! + integer, parameter :: ITERS = 6000 +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + real, contiguous, pointer :: c_val1(:), c_val2(:) + real, contiguous, pointer :: f_val1(:), f_val2(:), f_val(:), sur(:) + integer, contiguous, pointer :: faces_c(:,:) + real :: tmp + integer :: c, c1, c2, s, i, thr + character(SL) :: st +!==============================================================================! + + call Profiler % Stop('Main') + + call Message % Framed(60, & + 'Greetings ...', '... from '//__FILE__, & + one_proc=.true.) + + !$omp parallel + print *, 'Hello from ', omp_get_thread_num()+1 + !$omp end parallel + + call Work % Connect_Real_Cell(c_val1, c_val2) + call Work % Connect_Real_Face(f_val1, f_val2, f_val) + + Grid => Flow % pnt_Grid + faces_c => Grid % faces_c + sur => Grid % s + + do c = 1, Grid % n_cells + call random_number(tmp); c_val1(c) = 10.0 * tmp + call random_number(tmp); c_val2(c) = 10.0 * tmp + end do + do s = 1, Grid % n_faces + c1 = Grid % faces_c(1, s) + c2 = Grid % faces_c(2, s) + f_val1(s) = c_val1(c1) + f_val2(s) = c_val2(c2) + end do + + !-----------------------------------! + ! Test implicit loop over faces ! + !-----------------------------------! + call Profiler % Start('Implicit Loop Over Faces') + do i = 1, ITERS + + !$omp parallel do & + !$omp private(s, c1, c2) & + !$omp shared (faces_c, sur, f_val, c_val1, c_val2) + do s = Faces_In_Domain() + c1 = faces_c(1, s) + c2 = faces_c(2, s) + f_val(s) = c_val1(c1) * sur(s) & + + c_val2(c2) * sur(s) + end do + !$omp end parallel do + end do + call Profiler % Stop('Implicit Loop Over Faces') + + !-----------------------------------! + ! Test explicit loop over faces ! + ! (Important: set thr private) ! + !-----------------------------------! + call Profiler % Start('Explicit Loop Over Faces') + do i = 1, ITERS + + !$omp parallel & + !$omp private(s, c1, c2, thr) & + !$omp shared (faces_c, sur, f_val, c_val1, c_val2) + thr = omp_get_thread_num() + 1 + do s = Grid % Vect % thread % f_face(thr), & + Grid % Vect % thread % l_face(thr) + c1 = faces_c(1, s) + c2 = faces_c(2, s) + f_val(s) = c_val1(c1) * sur(s) & + + c_val2(c2) * sur(s) + end do + !$omp end parallel + end do + call Profiler % Stop('Explicit Loop Over Faces') + + !------------------------------------! + ! Test unwrapped loop over faces ! + !------------------------------------! + call Profiler % Start('Unwrapped Loop Over Faces') + do i = 1, ITERS + + !$omp parallel do & + !$omp private(s, c1, c2) & + !$omp shared (faces_c, f_val1, f_val2, c_val1, c_val2) + do s = Faces_In_Domain() + c1 = faces_c(1, s) + c2 = faces_c(2, s) + f_val1(s) = c_val1(c1) + f_val2(s) = c_val2(c2) + end do + !$omp end parallel do + + !$omp parallel do private(s) shared (sur, f_val, f_val1, f_val2) + do s = Faces_In_Domain() + f_val(s) = f_val1(s) * sur(s) & + + f_val2(s) * sur(s) + end do + !$omp end parallel do + + end do + call Profiler % Stop('Unwrapped Loop Over Faces') + + call Work % Disconnect_Real_Cell(c_val1, c_val2) + call Work % Disconnect_Real_Face(f_val1, f_val2, f_val) + + call Profiler % Statistics(indent=34) + + call Global % End_Parallel + stop + + end subroutine diff --git a/Tests/Functionality/Omp/backstep_orthogonal.dom b/Tests/Functionality/Omp/backstep_orthogonal.dom new file mode 100644 index 000000000..3d77a9863 --- /dev/null +++ b/Tests/Functionality/Omp/backstep_orthogonal.dom @@ -0,0 +1,112 @@ +#-------------------------------------------# +# +# 7-----------8----------------------16 +# /| /| /| +# 5-----------6----------------------15 | +# | | (1) | | (2) | | +# | 3 - - - - | 4- - - - - - - - - - -|14 +# |/ |/| |/| +# 1-----------2----------------------13 | +# | | (3) | | +# |11---------------------|12 +# |/ |/ +# 9----------------------10 +# +#-------------------------------------------# +# Nodes (cells), boundary cells and sides # +#-------------------------------------------# + 4000000 1333333 12000000 + +#----------# +# Points # +#----------# +16 + 1 0.0 0.0 0.0 + 2 2.0 0.0 0.0 + 3 0.0 1.0 0.0 + 4 2.0 1.0 0.0 + 5 0.0 0.0 1.0 + 6 2.0 0.0 1.0 + 7 0.0 1.0 1.0 + 8 2.0 1.0 1.0 + 9 2.0 0.0 -1.0 + 10 13.0 0.0 -1.0 + 11 2.0 1.0 -1.0 + 12 13.0 1.0 -1.0 + 13 13.0 0.0 0.0 + 14 13.0 1.0 0.0 + 15 13.0 0.0 1.0 + 16 13.0 1.0 1.0 + +#----------# +# Blocks # +#----------# +3 + 1 161 12 81 + 1.0 1.0 1.0 + 1 2 3 4 5 6 7 8 + 2 681 12 81 + 0.6 1.0 1.0 + 2 13 4 14 6 15 8 16 + 3 681 12 81 + 0.6 1.0 1.0 + 9 10 11 12 2 13 4 14 + +#--------# +# # +#--------# + 0 + 0 + +#-----------------------# +# Boundary conditions # +#-----------------------# + 8 + +# low_wal in blocks 1-3 + 1 Kmin + 1 low_wall + 2 Kmin + 3 low_wall + 3 Imin + 3 low_wall +# top_wal in blocks 1-2 + 4 Kmax + 1 top_wall + 5 Kmax + 2 top_wall +# inflow + 6 Imin + 1 in +# outflow + 7 Imax + 2 out + 8 Imax + 3 out + +#-----------------------# +# Periodic boundaries # +#-----------------------# + 3 + 1 1 2 6 5 + 3 4 8 7 + 2 9 10 13 2 + 11 12 14 4 + 3 2 13 15 6 + 4 14 16 8 + +#-------------------# +# Copy boundaries # +#-------------------# + 0 + +#------------# +# Refinement # +#------------# + 0 + +#-----------# +# Smoothing # +#-----------# + 0 + diff --git a/Tests/Functionality/Omp/control b/Tests/Functionality/Omp/control new file mode 100644 index 000000000..1e825d8e6 --- /dev/null +++ b/Tests/Functionality/Omp/control @@ -0,0 +1,77 @@ +#------------------------------------------ +# A couple of things specific to this case +#------------------------------------------ + MAX_THREADS 4 + PROFILER_INFO seconds + +#---------- +# Prologue +#--------- + PROBLEM_NAME backstep_orthogonal + HEAT_TRANSFER no + + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 120 0 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 + SAVE_RESULTS_AT_BOUNDARIES no + +#------------------- +# Monitoring points +#------------------- + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 + + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + +#----------------- +# Physical models +#----------------- + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 + +#---------------------- +# Numerical parameters +#---------------------- + PRESSURE_MOMENTUM_COUPLING piso + + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + + TIME_INTEGRATION_SCHEME linear + + ADVECTION_SCHEME_FOR_MOMENTUM minmod + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + +#------------------------ +# Linear solver settings +#------------------------ + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MIN_SIMPLE_ITERATIONS 1 + +#--------------------- +# Boundary conditions +#--------------------- + BOUNDARY_CONDITION low_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 + + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 + + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES z u + FILE profile.dat + + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 1.0 0.0 0.0 diff --git a/Tests/Functionality/Omp/generate.scr b/Tests/Functionality/Omp/generate.scr new file mode 100644 index 000000000..c83123bd6 --- /dev/null +++ b/Tests/Functionality/Omp/generate.scr @@ -0,0 +1,4 @@ +backstep_orthogonal +1 2 +skip +skip diff --git a/Tests/Functionality/Omp/profile.dat b/Tests/Functionality/Omp/profile.dat new file mode 100644 index 000000000..d27e467a3 --- /dev/null +++ b/Tests/Functionality/Omp/profile.dat @@ -0,0 +1,212 @@ +#==================# +# Number of points # +#==================# + 200 +#===========# +# Direction # +#===========# +# z +#==================# +# coordinate U V W # +#==================# + 0.000000 0.000000 + 0.005000 0.029850 + 0.010000 0.059400 + 0.015000 0.088650 + 0.020000 0.117600 + 0.025000 0.146250 + 0.030000 0.174600 + 0.035000 0.202650 + 0.040000 0.230400 + 0.045000 0.257850 + 0.050000 0.285000 + 0.055000 0.311850 + 0.060000 0.338400 + 0.065000 0.364650 + 0.070000 0.390600 + 0.075000 0.416250 + 0.080000 0.441600 + 0.085000 0.466650 + 0.090000 0.491400 + 0.095000 0.515850 + 0.100000 0.540000 + 0.105000 0.563850 + 0.110000 0.587400 + 0.115000 0.610650 + 0.120000 0.633600 + 0.125000 0.656250 + 0.130000 0.678600 + 0.135000 0.700650 + 0.140000 0.722400 + 0.145000 0.743850 + 0.150000 0.765000 + 0.155000 0.785850 + 0.160000 0.806400 + 0.165000 0.826650 + 0.170000 0.846600 + 0.175000 0.866250 + 0.180000 0.885600 + 0.185000 0.904650 + 0.190000 0.923400 + 0.195000 0.941850 + 0.200000 0.960000 + 0.205000 0.977850 + 0.210000 0.995400 + 0.215000 1.012650 + 0.220000 1.029600 + 0.225000 1.046250 + 0.230000 1.062600 + 0.235000 1.078650 + 0.240000 1.094400 + 0.245000 1.109850 + 0.250000 1.125000 + 0.255000 1.139850 + 0.260000 1.154400 + 0.265000 1.168650 + 0.270000 1.182600 + 0.275000 1.196250 + 0.280000 1.209600 + 0.285000 1.222650 + 0.290000 1.235400 + 0.295000 1.247850 + 0.300000 1.260000 + 0.305000 1.271850 + 0.310000 1.283400 + 0.315000 1.294650 + 0.320000 1.305600 + 0.325000 1.316250 + 0.330000 1.326600 + 0.335000 1.336650 + 0.340000 1.346400 + 0.345000 1.355850 + 0.350000 1.365000 + 0.355000 1.373850 + 0.360000 1.382400 + 0.365000 1.390650 + 0.370000 1.398600 + 0.375000 1.406250 + 0.380000 1.413600 + 0.385000 1.420650 + 0.390000 1.427400 + 0.395000 1.433850 + 0.400000 1.440000 + 0.405000 1.445850 + 0.410000 1.451400 + 0.415000 1.456650 + 0.420000 1.461600 + 0.425000 1.466250 + 0.430000 1.470600 + 0.435000 1.474650 + 0.440000 1.478400 + 0.445000 1.481850 + 0.450000 1.485000 + 0.455000 1.487850 + 0.460000 1.490400 + 0.465000 1.492650 + 0.470000 1.494600 + 0.475000 1.496250 + 0.480000 1.497600 + 0.485000 1.498650 + 0.490000 1.499400 + 0.495000 1.499850 + 0.500000 1.500000 + 0.505000 1.499850 + 0.510000 1.499400 + 0.515000 1.498650 + 0.520000 1.497600 + 0.525000 1.496250 + 0.530000 1.494600 + 0.535000 1.492650 + 0.540000 1.490400 + 0.545000 1.487850 + 0.550000 1.485000 + 0.555000 1.481850 + 0.560000 1.478400 + 0.565000 1.474650 + 0.570000 1.470600 + 0.575000 1.466250 + 0.580000 1.461600 + 0.585000 1.456650 + 0.590000 1.451400 + 0.595000 1.445850 + 0.600000 1.440000 + 0.605000 1.433850 + 0.610000 1.427400 + 0.615000 1.420650 + 0.620000 1.413600 + 0.625000 1.406250 + 0.630000 1.398600 + 0.635000 1.390650 + 0.640000 1.382400 + 0.645000 1.373850 + 0.650000 1.365000 + 0.655000 1.355850 + 0.660000 1.346400 + 0.665000 1.336650 + 0.670000 1.326600 + 0.675000 1.316250 + 0.680000 1.305600 + 0.685000 1.294650 + 0.690000 1.283400 + 0.695000 1.271850 + 0.700000 1.260000 + 0.705000 1.247850 + 0.710000 1.235400 + 0.715000 1.222650 + 0.720000 1.209600 + 0.725000 1.196250 + 0.730000 1.182600 + 0.735000 1.168650 + 0.740000 1.154400 + 0.745000 1.139850 + 0.750000 1.125000 + 0.755000 1.109850 + 0.760000 1.094400 + 0.765000 1.078650 + 0.770000 1.062600 + 0.775000 1.046250 + 0.780000 1.029600 + 0.785000 1.012650 + 0.790000 0.995400 + 0.795000 0.977850 + 0.800000 0.960000 + 0.805000 0.941850 + 0.810000 0.923400 + 0.815000 0.904650 + 0.820000 0.885600 + 0.825000 0.866250 + 0.830000 0.846600 + 0.835000 0.826650 + 0.840000 0.806400 + 0.845000 0.785850 + 0.850000 0.765000 + 0.855000 0.743850 + 0.860000 0.722400 + 0.865000 0.700650 + 0.870000 0.678600 + 0.875000 0.656250 + 0.880000 0.633600 + 0.885000 0.610650 + 0.890000 0.587400 + 0.895000 0.563850 + 0.900000 0.540000 + 0.905000 0.515850 + 0.910000 0.491400 + 0.915000 0.466650 + 0.920000 0.441600 + 0.925000 0.416250 + 0.930000 0.390600 + 0.935000 0.364650 + 0.940000 0.338400 + 0.945000 0.311850 + 0.950000 0.285000 + 0.955000 0.257850 + 0.960000 0.230400 + 0.965000 0.202650 + 0.970000 0.174600 + 0.975000 0.146250 + 0.980000 0.117600 + 0.985000 0.088650 + 0.990000 0.059400 + 0.995000 0.029850 + 1.000000 0.000000 diff --git a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Stretched_Mesh/control b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Stretched_Mesh/control index 14d25e4db..c5a9749cb 100644 --- a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Stretched_Mesh/control +++ b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Stretched_Mesh/control @@ -1,60 +1,56 @@ #---------- # Prologue #---------- + PROBLEM_NAME chan - PROBLEM_NAME chan + HEAT_TRANSFER yes - HEAT_TRANSFER yes - - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 18000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 6000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME chan-ts012000.backup + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 18000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 6000 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0000422 - DYNAMIC_VISCOSITY 3.e-5 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0000422 + DYNAMIC_VISCOSITY 3.e-5 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL hybrid_les_rans + TURBULENCE_MODEL hybrid_les_rans - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 8.28 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 8.28 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_MOMENTUM central + ADVECTION_SCHEME_FOR_ENERGY smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 #-------------------- # Initial conditions @@ -63,7 +59,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 1.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/End_Of_Time_Step.f90 b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/End_Of_Time_Step.f90 index ea456bc59..19d35c9ac 100644 --- a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! 1st step for turbulence statist. integer, intent(in) :: n_stat_p ! 1st step for particle statistics - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w @@ -30,10 +28,10 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & w => Flow % w ! If not time for disturbing the velocity field, return - if(mod(n,100) .ne. 0) return + if(mod(Time % Curr_Dt(), 100) .ne. 0) return ! If too late to disturb, get out too - if(n > 1000) return + if(Time % Curr_Dt() > 1000) return ! Minimum and maximum size of eddies rmin = 0.2 @@ -106,7 +104,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & vmax = max(vmax, abs(v % n(c))) vmax = max(vmax, abs(w % n(c))) end do - call Comm_Mod_Global_Max_Real(vmax) + call Global % Max_Real(vmax) do c = 1, Grid % n_cells v % n(c) = v % n(c) / vmax / 10.0 w % n(c) = w % n(c) / vmax / 10.0 diff --git a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/Save_Results.f90 b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/Save_Results.f90 index a42049ef6..8abb06cc2 100644 --- a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/Save_Results.f90 +++ b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -35,7 +34,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -44,30 +43,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Flow % Alias_Energy (t) ! Take constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') ! Set file names for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -173,36 +172,36 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p (pl)) - call Comm_Mod_Global_Sum_Real(vv_p (pl)) - call Comm_Mod_Global_Sum_Real(ww_p (pl)) - call Comm_Mod_Global_Sum_Real(uw_p (pl)) - call Comm_Mod_Global_Sum_Real(uw_mod_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p (pl)) - call Comm_Mod_Global_Sum_Real(eps_p (pl)) - call Comm_Mod_Global_Sum_Real(vis_t_p (pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(uu_p (pl)) + call Global % Sum_Real(vv_p (pl)) + call Global % Sum_Real(ww_p (pl)) + call Global % Sum_Real(uw_p (pl)) + call Global % Sum_Real(uw_mod_p(pl)) + call Global % Sum_Real(kin_p (pl)) + call Global % Sum_Real(eps_p (pl)) + call Global % Sum_Real(vis_t_p (pl)) + call Global % Sum_Real(y_plus_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p (pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p (pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -244,7 +243,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if return @@ -259,12 +258,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux > 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if do s = 1, Grid % n_faces @@ -282,11 +281,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -458,6 +457,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) write(6, *) '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) write(6, *) '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/control b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/control index 2b4d93214..cd3a4a6f3 100644 --- a/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/control +++ b/Tests/Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh/control @@ -1,60 +1,56 @@ #---------- # Prologue #---------- + PROBLEM_NAME chan - PROBLEM_NAME chan + HEAT_TRANSFER yes - HEAT_TRANSFER yes - - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 18000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 6000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME chan-ts012000.backup + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 18000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 6000 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0000422 - DYNAMIC_VISCOSITY 3.e-5 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0000422 + DYNAMIC_VISCOSITY 3.e-5 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL hybrid_les_rans + TURBULENCE_MODEL hybrid_les_rans - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 8.28 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 8.28 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_MOMENTUM central + ADVECTION_SCHEME_FOR_ENERGY smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 #-------------------- # Initial conditions @@ -63,7 +59,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 1.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e09 b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e09 index 94a98fac7..0850c61d0 100644 --- a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e09 +++ b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e09 @@ -1,62 +1,62 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1200 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^9 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.000206 - DYNAMIC_VISCOSITY 0.000146 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.000206 + DYNAMIC_VISCOSITY 0.000146 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL hybrid_les_rans - HYBRID_LES_RANS_SWITCH switch_velocity + TURBULENCE_MODEL hybrid_les_rans + HYBRID_LES_RANS_SWITCH switch_velocity #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e10 b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e10 index 9bce24af3..86baa6a46 100644 --- a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e10 +++ b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e10 @@ -1,65 +1,65 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 2400 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 2400 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts001200.backup + LOAD_BACKUP_NAME cylinder-ts001200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^6 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.000065 - DYNAMIC_VISCOSITY 0.0000462 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.000065 + DYNAMIC_VISCOSITY 0.0000462 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL hybrid_les_rans - HYBRID_LES_RANS_SWITCH switch_velocity + TURBULENCE_MODEL hybrid_les_rans + HYBRID_LES_RANS_SWITCH switch_velocity #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e11 b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e11 index dde720dff..b70c60ac0 100644 --- a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e11 +++ b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e11 @@ -1,65 +1,65 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 3600 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 3600 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts002400.backup + LOAD_BACKUP_NAME cylinder-ts002400.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^11 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0000206 - DYNAMIC_VISCOSITY 0.0000146 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0000206 + DYNAMIC_VISCOSITY 0.0000146 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL hybrid_les_rans - HYBRID_LES_RANS_SWITCH switch_velocity + TURBULENCE_MODEL hybrid_les_rans + HYBRID_LES_RANS_SWITCH switch_velocity #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e12 b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e12 index 9f9ce3bf5..41976bfd4 100644 --- a/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e12 +++ b/Tests/Hybrid_Les_Rans/Cylinder/control-ra-1e12 @@ -1,65 +1,65 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 4800 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 4800 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts003600.backup + LOAD_BACKUP_NAME cylinder-ts003600.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^8 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0000065 - DYNAMIC_VISCOSITY 0.00000462 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0000065 + DYNAMIC_VISCOSITY 0.00000462 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL hybrid_les_rans - HYBRID_LES_RANS_SWITCH switch_velocity + TURBULENCE_MODEL hybrid_les_rans + HYBRID_LES_RANS_SWITCH switch_velocity #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/End_Of_Time_Step.f90 b/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/End_Of_Time_Step.f90 index 04b31ef17..d1dbd2fe8 100644 --- a/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! Append viscous forces to pressure drops. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! 1st step for turbulence statist. integer, intent(in) :: n_stat_p ! 1st step for particle statistics - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk @@ -82,17 +80,17 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & end do if( abs(bulk % flux_x_o) >= TINY ) then - call Comm_Mod_Global_Sum_Real(tau_wall_x) + call Global % Sum_Real(tau_wall_x) bulk % p_drop_x = bulk % p_drop_x & + tau_wall_x / Grid % tot_vol ! [kg/m^2/s^2] end if if( abs(bulk % flux_y_o) >= TINY ) then - call Comm_Mod_Global_Sum_Real(tau_wall_y) + call Global % Sum_Real(tau_wall_y) bulk % p_drop_y = bulk % p_drop_y & + tau_wall_y / Grid % tot_vol ! [kg/m^2/s^2] end if if( abs(bulk % flux_z_o) >= TINY ) then - call Comm_Mod_Global_Sum_Real(tau_wall_z) + call Global % Sum_Real(tau_wall_z) bulk % p_drop_z = bulk % p_drop_z & + tau_wall_z / Grid % tot_vol ! [kg/m^2/s^2] end if diff --git a/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/Save_Results.f90 b/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/Save_Results.f90 index 6bfad3126..c64bdd260 100644 --- a/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/Save_Results.f90 +++ b/Tests/Laminar/Accuracy_Test/Channel_Re_2000/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -27,7 +26,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -38,17 +37,17 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call File % Set_Name(coord_name, extension='.1d') ! Set file name for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=exist) if(.not. exist) then - if(this_proc < 2) then + if(First_Proc()) then print *, '# Critial error: chan.1d file does not exist' end if stop @@ -92,12 +91,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do i = 1, n-1 - call Comm_Mod_Global_Sum_Int (n_count(i)) - call Comm_Mod_Global_Sum_Real(y_p(i)) - call Comm_Mod_Global_Sum_Real(u_p(i)) + call Global % Sum_Int (n_count(i)) + call Global % Sum_Real(y_p(i)) + call Global % Sum_Real(u_p(i)) end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n-1 if(n_count(i) .ne. 0) then @@ -125,6 +124,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(ind) deallocate(y_f) - if(this_proc < 2) write(*,*) '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) write(*,*) '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Laminar/Accuracy_Test/Channel_Re_2000/control b/Tests/Laminar/Accuracy_Test/Channel_Re_2000/control index f5f6677cf..afca7035e 100644 --- a/Tests/Laminar/Accuracy_Test/Channel_Re_2000/control +++ b/Tests/Laminar/Accuracy_Test/Channel_Re_2000/control @@ -1,55 +1,49 @@ - PROBLEM_NAME chan - - TIME_STEP 5.e-2 - NUMBER_OF_TIME_STEPS 14000 - RESULTS_SAVE_INTERVAL 9999999 # no saves during this test - BACKUP_SAVE_INTERVAL 9999999 # no backups during this test - - POINT_FOR_MONITORING_PLANES 6.0 0.5 3.0 - MASS_FLOW_RATES 3.1415926 0.0 0.0 - - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 5.e-4 - TURBULENCE_MODEL none - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - - TIME_INTEGRATION_SCHEME parabolic - TIME_INTEGRATION_FOR_ADVECTION fully_implicit - TIME_INTEGRATION_FOR_DIFFUSION fully_implicit - TIME_INTEGRATION_FOR_CROSS_DIFFUSION fully_implicit - - PRESSURE_MOMENTUM_COUPLING simple - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-8 - MAX_SIMPLE_ITERATIONS 999 - MIN_SIMPLE_ITERATIONS 2 - - ADVECTION_SCHEME_FOR_MOMENTUM central - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-8 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 999 - #NORMALIZATION_FOR_PRESSURE_SOLVER 1e-6 # IS NOT USED ANYWHERE - - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 999 - #NORMALIZATION_FOR_PRESSURE_SOLVER 1e-6 + PROBLEM_NAME chan + + TIME_STEP 5.e-2 + NUMBER_OF_TIME_STEPS 14000 + RESULTS_SAVE_INTERVAL 9999999 # no saves during this test + BACKUP_SAVE_INTERVAL 9999999 # no backups during this test + + POINT_FOR_MONITORING_PLANES 6.0 0.5 3.0 + MASS_FLOW_RATES 3.1415926 0.0 0.0 + + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 5.e-4 + TURBULENCE_MODEL none + + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + + TIME_INTEGRATION_SCHEME parabolic + + PRESSURE_MOMENTUM_COUPLING simple + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-8 + MAX_SIMPLE_ITERATIONS 999 + MIN_SIMPLE_ITERATIONS 2 + + ADVECTION_SCHEME_FOR_MOMENTUM central + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-8 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 999 + + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 999 #-------------------- # Initial conditions #-------------------- INITIAL_CONDITION - VARIABLES u v w - VALUES 1.16 0. 0. + VARIABLES u v w + VALUES 1.16 0.0 0.0 #--------------------- # Boundary conditions #--------------------- BOUNDARY_CONDITION wall - TYPE wall - VARIABLES u v w - VALUES 0. 0. 0. + VARIABLES u v w + VALUES 0.0 0.0 0.0 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 diff --git a/Tests/Laminar/Backstep/Nonorthogonal/control b/Tests/Laminar/Backstep/Nonorthogonal/control index 1c19b7935..d8e1da492 100644 --- a/Tests/Laminar/Backstep/Nonorthogonal/control +++ b/Tests/Laminar/Backstep/Nonorthogonal/control @@ -1,57 +1,56 @@ #---------- # Prologue -#--------- - PROBLEM_NAME backstep_nonorthogonal - HEAT_TRANSFER no +#---------- + PROBLEM_NAME backstep_nonorthogonal + HEAT_TRANSFER no - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 300 - SAVE_RESULTS_AT_BOUNDARIES no + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 + SAVE_RESULTS_AT_BOUNDARIES no -# LOAD_BACKUP_NAME backstep_orthogonal-ts000001.backup + PROFILER_INFO seconds #------------------- -# Monitoring points +# Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 1 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MIN_SIMPLE_ITERATIONS 1 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Backstep/Orthogonal/Solvers_Scaling/control b/Tests/Laminar/Backstep/Orthogonal/Solvers_Scaling/control index 9f6196d80..bbfdb8082 100644 --- a/Tests/Laminar/Backstep/Orthogonal/Solvers_Scaling/control +++ b/Tests/Laminar/Backstep/Orthogonal/Solvers_Scaling/control @@ -1,78 +1,78 @@ #---------- # Prologue #--------- - PROBLEM_NAME backstep_orthogonal - HEAT_TRANSFER no + PROBLEM_NAME backstep_orthogonal + HEAT_TRANSFER no - TIME_STEP 0.00375 # 0.02 0.01 0.005 0.00375 0.0025 - NUMBER_OF_TIME_STEPS 12 - RESULTS_SAVE_INTERVAL 99999 - BACKUP_SAVE_INTERVAL 99999 - SAVE_RESULTS_AT_BOUNDARIES no + TIME_STEP 0.00375 # 0.02 0.01 0.005 0.00375 0.0025 + NUMBER_OF_TIME_STEPS 12 + RESULTS_SAVE_INTERVAL 99999 + BACKUP_SAVE_INTERVAL 99999 + SAVE_RESULTS_AT_BOUNDARIES no - SAVE_INITIAL_CONDITION no + SAVE_INITIAL_CONDITION no #------------------- -# Monitoring points +# Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 3 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 3 #------------------------ # Linear solver settings #------------------------ - LINEAR_SOLVERS petsc - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 99 - MAX_ITERATIONS_FOR_POTENTIAL_SOLVER 99 - - PETSC_OPTIONS_FOR_PRESSURE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-6 # 1.0e-3 was also working - - PETSC_OPTIONS_FOR_WALL_DISTANCE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-6 # 1.0e-3 was also working - - PETSC_OPTIONS_FOR_MOMENTUM - SOLVER bicg - PREC asm - PREC_OPTS - TOLERANCE 1.0e-6 # 1.0e-5 was also working + LINEAR_SOLVERS petsc + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 99 + MAX_ITERATIONS_FOR_POTENTIAL_SOLVER 99 + + PETSC_OPTIONS_FOR_PRESSURE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-6 # 1.0e-3 was also working + + PETSC_OPTIONS_FOR_WALL_DISTANCE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-6 # 1.0e-3 was also working + + PETSC_OPTIONS_FOR_MOMENTUM + SOLVER bicg + PREC asm + PREC_OPTS + TOLERANCE 1.0e-6 # 1.0e-5 was also working #-------------------- # Initial conditions diff --git a/Tests/Laminar/Backstep/Orthogonal/control b/Tests/Laminar/Backstep/Orthogonal/control index 2da30fe4f..eb57b7197 100644 --- a/Tests/Laminar/Backstep/Orthogonal/control +++ b/Tests/Laminar/Backstep/Orthogonal/control @@ -1,57 +1,52 @@ #---------- # Prologue -#--------- - PROBLEM_NAME backstep_orthogonal - HEAT_TRANSFER no +#---------- + PROBLEM_NAME backstep_orthogonal + HEAT_TRANSFER no - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 300 - SAVE_RESULTS_AT_BOUNDARIES no + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 + SAVE_RESULTS_AT_BOUNDARIES no -#LOAD_BACKUP_NAME backstep_orthogonal-ts000001.backup + PROFILER_INFO seconds #------------------- -# Monitoring points +# Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 1.0 - -TURBULENCE_MODEL none + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM minmod + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM minmod + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 1 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MIN_SIMPLE_ITERATIONS 1 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Backstep/Orthogonal_With_Eddies/control b/Tests/Laminar/Backstep/Orthogonal_With_Eddies/control index 7356a26f7..144b5ed0e 100644 --- a/Tests/Laminar/Backstep/Orthogonal_With_Eddies/control +++ b/Tests/Laminar/Backstep/Orthogonal_With_Eddies/control @@ -1,58 +1,56 @@ #---------- # Prologue #--------- - PROBLEM_NAME backstep_orthogonal - HEAT_TRANSFER no + PROBLEM_NAME backstep_orthogonal + HEAT_TRANSFER no - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 300 - RESULTS_SAVE_INTERVAL 15 - BACKUP_SAVE_INTERVAL 60 - SAVE_RESULTS_AT_BOUNDARIES no + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 300 + RESULTS_SAVE_INTERVAL 15 + BACKUP_SAVE_INTERVAL 60 + SAVE_RESULTS_AT_BOUNDARIES no -#LOAD_BACKUP_NAME backstep_orthogonal-ts.backup + PROFILER_INFO seconds #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 2.5e-3 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 2.5e-3 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM minmod - - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + ADVECTION_SCHEME_FOR_MOMENTUM minmod + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Backstep/Polyhedral/control b/Tests/Laminar/Backstep/Polyhedral/control index 27b3ca1e3..235dd2cf4 100644 --- a/Tests/Laminar/Backstep/Polyhedral/control +++ b/Tests/Laminar/Backstep/Polyhedral/control @@ -1,57 +1,55 @@ #---------- # Prologue #--------- - PROBLEM_NAME backstep_polyhedral_dual - HEAT_TRANSFER no + PROBLEM_NAME backstep_polyhedral_dual + HEAT_TRANSFER no - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 300 - SAVE_RESULTS_AT_BOUNDARIES no + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 + SAVE_RESULTS_AT_BOUNDARIES no -# LOAD_BACKUP_NAME backstep_orthogonal-ts000001.backup + PROFILER_INFO seconds #------------------- -# Monitoring points +# Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM minmod - - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + ADVECTION_SCHEME_FOR_MOMENTUM minmod + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 1 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MIN_SIMPLE_ITERATIONS 1 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Hydrostatic/control b/Tests/Laminar/Cavity/Hydrostatic/control index 949162976..48769810b 100644 --- a/Tests/Laminar/Cavity/Hydrostatic/control +++ b/Tests/Laminar/Cavity/Hydrostatic/control @@ -1,62 +1,57 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 18 + NUMBER_OF_TIME_STEPS 18 - RESULTS_SAVE_INTERVAL 6 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 6 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 5.0 + TIME_STEP 5.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.01 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.01 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - - GRAVITATIONAL_VECTOR 0 0 -1 + GRAVITATIONAL_VECTOR 0 0 -1 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - - TIME_INTEGRATION_SCHEME linear + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM central #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-9 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-15 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-9 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-15 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 720 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 36 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 720 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 36 - MAX_SIMPLE_ITERATIONS 24 + MAX_SIMPLE_ITERATIONS 24 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control index a44b36893..0d44e6056 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control @@ -1,57 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 180 + NUMBER_OF_TIME_STEPS 180 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.01 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.01 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING simple + TURBULENCE_MODEL none + PRESSURE_MOMENTUM_COUPLING simple #---------------------- # Numerical parameters #---------------------- + LINEAR_SOLVERS petsc + PRESSURE_MOMENTUM_COUPLING simple - LINEAR_SOLVERS petsc - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_piso b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_piso index 04df9d68c..230cfaa2e 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_piso +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_piso @@ -1,57 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 1 + NUMBER_OF_TIME_STEPS 1 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0e+12 + TIME_STEP 1.0e+12 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.01 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.01 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING piso + TURBULENCE_MODEL none + PRESSURE_MOMENTUM_COUPLING piso #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.9 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.9 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_SIMPLE_ITERATIONS 60 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MAX_SIMPLE_ITERATIONS 60 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_simple b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_simple index d587d61f5..26ca1bcf3 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_simple +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0100/control_simple @@ -1,56 +1,54 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 180 + NUMBER_OF_TIME_STEPS 180 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.01 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.01 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING simple + TURBULENCE_MODEL none + PRESSURE_MOMENTUM_COUPLING simple #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control index 144ef9064..1e316fe18 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control @@ -1,56 +1,54 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 180 + NUMBER_OF_TIME_STEPS 180 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.0025 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.0025 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING simple + TURBULENCE_MODEL none + PRESSURE_MOMENTUM_COUPLING simple #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_piso b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_piso index eea9c413b..911af1c96 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_piso +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_piso @@ -1,57 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 1 + NUMBER_OF_TIME_STEPS 1 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0e+12 + TIME_STEP 1.0e+12 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.0025 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.0025 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING piso + TURBULENCE_MODEL none + PRESSURE_MOMENTUM_COUPLING piso #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.9 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.9 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_SIMPLE_ITERATIONS 120 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MAX_SIMPLE_ITERATIONS 120 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_simple b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_simple index 144ef9064..1e316fe18 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_simple +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_0400/control_simple @@ -1,56 +1,54 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 180 + NUMBER_OF_TIME_STEPS 180 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.0025 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.0025 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING simple + TURBULENCE_MODEL none + PRESSURE_MOMENTUM_COUPLING simple #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control index b11af422e..c91d6600b 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control @@ -1,56 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 180 + NUMBER_OF_TIME_STEPS 180 + TIME_STEP 1.0 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0 +# Keep the line below, it is needed by test_build.sh script for backup tests +# LOAD_BACKUP_NAME cavity-ts000180.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - -TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions @@ -71,3 +70,4 @@ TURBULENCE_MODEL none TYPE inflow VARIABLES u v w VALUES 1.0 0.0 0.0 +:q1 :q! diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_piso b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_piso index 0c6673d54..7a901851c 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_piso +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_piso @@ -1,58 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 1 + NUMBER_OF_TIME_STEPS 1 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0e+12 + TIME_STEP 1.0e+12 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING piso + PRESSURE_MOMENTUM_COUPLING piso #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_SIMPLE_ITERATIONS 240 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MAX_SIMPLE_ITERATIONS 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_simple b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_simple index b11af422e..4b391f635 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_simple +++ b/Tests/Laminar/Cavity/Lid_Driven/Hexahedral/Re_1000/control_simple @@ -1,56 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no + PROBLEM_NAME cavity + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 180 + NUMBER_OF_TIME_STEPS 180 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 180 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 180 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 -TURBULENCE_MODEL none - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Lid_Driven/Skewed/control b/Tests/Laminar/Cavity/Lid_Driven/Skewed/control index 433d948b3..bbb731aef 100644 --- a/Tests/Laminar/Cavity/Lid_Driven/Skewed/control +++ b/Tests/Laminar/Cavity/Lid_Driven/Skewed/control @@ -24,23 +24,23 @@ #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION top_wall - TYPE inflow - VARIABLES u v w - VALUES 1.0 0.0 0.0 - - BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 - - BOUNDARY_CONDITION west_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 - - BOUNDARY_CONDITION east_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION top_wall + TYPE inflow + VARIABLES u v w + VALUES 1.0 0.0 0.0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 + + BOUNDARY_CONDITION west_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 + + BOUNDARY_CONDITION east_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.1 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.1 index cca28824d..d2045007e 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.1 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.1 @@ -1,87 +1,87 @@ #------- # Intro #------- - PROBLEM_NAME left + PROBLEM_NAME left - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) * 0.1 = 0.00264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.00264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) * 0.1 = 0.00264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.00264575131 #-------------------- # Initial conditions #-------------------- INITIAL_CONDITION - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.2 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.2 index 204b05c75..aa99bc7f9 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.2 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.2 @@ -1,95 +1,95 @@ #------- # Intro #------- - PROBLEM_NAME middle + PROBLEM_NAME middle - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions #-------------------- INITIAL_CONDITION - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.3 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.3 index f6c63e472..4d6608f3f 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.3 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e3/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME right + PROBLEM_NAME right - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) * 0.1 = 0.00264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.00264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) * 0.1 = 0.00264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.00264575131 #-------------------- # Initial conditions @@ -37,48 +37,48 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 BOUNDARY_CONDITION RIGHT TYPE wall diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.1 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.1 index dabab14e3..185df8cee 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.1 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.1 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME left + PROBLEM_NAME left - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - # lambda = sqrt(Pr / Ra) * 0.1 = 0.000264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00377964473 - THERMAL_CONDUCTIVITY 0.000264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + # lambda = sqrt(Pr / Ra) * 0.1 = 0.000264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00377964473 + THERMAL_CONDUCTIVITY 0.000264575131 #-------------------- # Initial conditions @@ -37,48 +37,48 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 BOUNDARY_CONDITION RIGHT TYPE wall diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.2 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.2 index ad76fde62..5ab923bd4 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.2 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.2 @@ -1,36 +1,36 @@ #------- # Intro #------- - PROBLEM_NAME middle + PROBLEM_NAME middle - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - # lambda = sqrt(Pr / Ra) = 0.00264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00377964473 - THERMAL_CONDUCTIVITY 0.00264575131 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + # lambda = sqrt(Pr / Ra) = 0.00264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00377964473 + THERMAL_CONDUCTIVITY 0.00264575131 #-------------------- # Initial conditions @@ -42,54 +42,54 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.3 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.3 index 30bb64e92..c15509517 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.3 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_0.1/Ra_10e5/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME right + PROBLEM_NAME right - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - # lambda = sqrt(Pr / Ra) * 0.1 = 0.000264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00377964473 - THERMAL_CONDUCTIVITY 0.000264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + # lambda = sqrt(Pr / Ra) * 0.1 = 0.000264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00377964473 + THERMAL_CONDUCTIVITY 0.000264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 1.0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 1.0 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.1 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.1 index 64902cfaf..877d8ed56 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.1 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.1 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME left + PROBLEM_NAME left - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.2 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.2 index 204b05c75..400fae6ec 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.2 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.2 @@ -1,36 +1,36 @@ #------- # Intro #------- - PROBLEM_NAME middle + PROBLEM_NAME middle - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions @@ -42,54 +42,54 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.3 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.3 index 6711b26e8..af45d75f5 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.3 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e3/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME right + PROBLEM_NAME right - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 1.0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 1.0 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.1 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.1 index 761a365f2..338590eb5 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.1 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.1 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME left + PROBLEM_NAME left - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00264575131 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00264575131 - THERMAL_CONDUCTIVITY 0.00377964473 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00264575131 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00264575131 + THERMAL_CONDUCTIVITY 0.00377964473 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.2 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.2 index 2c20c3d07..78cae1eee 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.2 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.2 @@ -1,36 +1,36 @@ #------- # Intro #------- - PROBLEM_NAME middle + PROBLEM_NAME middle - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00264575131 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00264575131 - THERMAL_CONDUCTIVITY 0.00377964473 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00264575131 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00264575131 + THERMAL_CONDUCTIVITY 0.00377964473 #-------------------- # Initial conditions @@ -42,54 +42,54 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.3 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.3 index b0730636e..2a1d5b8f2 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.3 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_1.0/Ra_10e5/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME right + PROBLEM_NAME right - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00264575131 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00264575131 - THERMAL_CONDUCTIVITY 0.00377964473 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00264575131 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00264575131 + THERMAL_CONDUCTIVITY 0.00377964473 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 1.0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 1.0 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.1 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.1 index a474823b5..1550ab259 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.1 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.1 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME left + PROBLEM_NAME left - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) * 10 = 0.264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) * 10 = 0.264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.2 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.2 index 204b05c75..365209832 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.2 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.2 @@ -1,36 +1,36 @@ #------- # Intro #------- - PROBLEM_NAME middle + PROBLEM_NAME middle - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions @@ -42,54 +42,54 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.3 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.3 index 9e7e6aa0c..82e201baa 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.3 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e3/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME right + PROBLEM_NAME right - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 - # lambda = sqrt(Pr / Ra) * 10 = 0.264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0377964473 - THERMAL_CONDUCTIVITY 0.264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.0377964473 + # lambda = sqrt(Pr / Ra) * 10 = 0.264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0377964473 + THERMAL_CONDUCTIVITY 0.264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 1.0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 1.0 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.1 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.1 index 695d7ea03..505f1270d 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.1 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.1 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME left + PROBLEM_NAME left - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - # lambda = sqrt(Pr / Ra) * 10 = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + # lambda = sqrt(Pr / Ra) * 10 = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.2 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.2 index ad76fde62..5ab923bd4 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.2 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.2 @@ -1,36 +1,36 @@ #------- # Intro #------- - PROBLEM_NAME middle + PROBLEM_NAME middle - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - # lambda = sqrt(Pr / Ra) = 0.00264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00377964473 - THERMAL_CONDUCTIVITY 0.00264575131 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + # lambda = sqrt(Pr / Ra) = 0.00264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00377964473 + THERMAL_CONDUCTIVITY 0.00264575131 #-------------------- # Initial conditions @@ -42,54 +42,54 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.3 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.3 index 9f9d4e61e..edbd295a0 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.3 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/K_10.0/Ra_10e5/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME right + PROBLEM_NAME right - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - # lambda = sqrt(Pr / Ra) * 10 = 0.0264575131 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00377964473 - THERMAL_CONDUCTIVITY 0.0264575131 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + # lambda = sqrt(Pr / Ra) * 10 = 0.0264575131 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00377964473 + THERMAL_CONDUCTIVITY 0.0264575131 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 1.0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 1.0 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/User_Mod/End_Of_Time_Step.f90 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/User_Mod/End_Of_Time_Step.f90 index c69d5def7..15761e304 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! start time step for Turb. stat. integer, intent(in) :: n_stat_p ! start time step for Swarm. stat. - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: t @@ -39,7 +37,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. this_proc) then + if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. This_Proc()) then if( Var_Mod_Bnd_Cond_Type(t,c2) .eq. WALL ) then area = area + Grid % s(s) @@ -53,15 +51,15 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !-----------------------------------------------! ! Integrate (summ) heated area, and heat up ! !-----------------------------------------------! - call Comm_Mod_Global_Sum_Real(area) - call Comm_Mod_Global_Sum_Real(nu) + call Global % Sum_Real(area) + call Global % Sum_Real(nu) !-------------------------------------------------! ! Compute averaged Nussel number and print it ! !-------------------------------------------------! nu = nu / area - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #===========================================' print '(a)', ' # Output from user function, Nusslet number!' print '(a)', ' #-------------------------------------------' diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/control.0 b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/control.0 index 76ade5c0e..f7ad64259 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/control.0 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Conjugate/control.0 @@ -1,17 +1,17 @@ - NUMBER_OF_DOMAINS 3 + NUMBER_OF_DOMAINS 3 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 999999 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 999999 - TIME_STEP 0.1 + TIME_STEP 0.1 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - # Connection between left and the middle: - INTERFACE_CONDITION left middle - BOUNDARY_CONDITIONS right left + # Connection between left and the middle: + INTERFACE_CONDITION left middle + BOUNDARY_CONDITIONS right left - # Connection between middle and the right - INTERFACE_CONDITION middle right - BOUNDARY_CONDITIONS right left + # Connection between middle and the right + INTERFACE_CONDITION middle right + BOUNDARY_CONDITIONS right left diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e3/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e3/control index f14997616..fe22d337c 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e3/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e3/control @@ -1,73 +1,71 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cavity + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 600 + NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 300 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e3 + # mu = sqrt(Pr / Ra) = 0.02664582518 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.03752933125 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.02664582518 + THERMAL_CONDUCTIVITY 0.03752933125 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e3 - # mu = sqrt(Pr / Ra) = 0.02664582518 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.03752933125 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.02664582518 - THERMAL_CONDUCTIVITY 0.03752933125 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e4/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e4/control index 05a4dad92..909ff61cc 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e4/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e4/control @@ -1,73 +1,71 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cavity + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 600 + NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 300 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e4 + # mu = sqrt(Pr / Ra) = 0.00842614977 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.01186781658 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00842614977 + THERMAL_CONDUCTIVITY 0.01186781658 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e4 - # mu = sqrt(Pr / Ra) = 0.00842614977 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.01186781658 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00842614977 - THERMAL_CONDUCTIVITY 0.01186781658 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e5/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e5/control index 4d3f4e97b..fe27021e3 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e5/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e5/control @@ -1,73 +1,71 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cavity + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 600 + NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 300 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00266458251 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00375293312 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00266458251 + THERMAL_CONDUCTIVITY 0.00375293312 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00266458251 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00375293312 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00266458251 - THERMAL_CONDUCTIVITY 0.00375293312 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e6/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e6/control index 00e7e62a9..da8dcbc05 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e6/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e6/control @@ -1,73 +1,71 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cavity + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 600 + NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 300 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e6 + # mu = sqrt(Pr / Ra) = 0.000842614977 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.001186781658 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.000842614977 + THERMAL_CONDUCTIVITY 0.001186781658 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e6 - # mu = sqrt(Pr / Ra) = 0.000842614977 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.001186781658 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.000842614977 - THERMAL_CONDUCTIVITY 0.001186781658 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e7/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e7/control index 549f019c5..bceec1798 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e7/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e7/control @@ -1,73 +1,71 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cavity + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 600 + NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 300 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e7 + # mu = sqrt(Pr / Ra) = 0.000266458251 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.000375293312 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.000266458251 + THERMAL_CONDUCTIVITY 0.000375293312 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e7 - # mu = sqrt(Pr / Ra) = 0.000266458251 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.000375293312 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.000266458251 - THERMAL_CONDUCTIVITY 0.000375293312 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e8/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e8/control index 8a3f48b18..50ce9e10b 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e8/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Ra_10e8/control @@ -1,73 +1,71 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cavity + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 600 + NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 300 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 1.0 + TIME_STEP 1.0 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e8 + # mu = sqrt(Pr / Ra) = 0.0000842614977 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.0001186781658 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.0000842614977 + THERMAL_CONDUCTIVITY 0.0001186781658 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e8 - # mu = sqrt(Pr / Ra) = 0.0000842614977 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.0001186781658 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.0000842614977 - THERMAL_CONDUCTIVITY 0.0001186781658 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Simulation.f90 b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Simulation.f90 index bead8290b..e444b39fd 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Simulation.f90 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Simulation.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of simulation. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid integer :: i, fu @@ -44,7 +42,7 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, n, time) close(fu) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #============================================' print '(a)', ' # Output from user function, read properties!' print '(a)', ' #--------------------------------------------' diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Time_Step.f90 b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Time_Step.f90 index 095f8231d..f182abde1 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Time_Step.f90 +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/User_Mod/Beginning_Of_Time_Step.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Swarm_Type), target :: Swarm !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/control b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/control index 04082c07f..ca335eb70 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Direct/Variable_Properties_Air/control @@ -1,72 +1,72 @@ #------- # Intro #------- - PROBLEM_NAME air + PROBLEM_NAME air - HEAT_TRANSFER yes + HEAT_TRANSFER yes - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 6000 - RESULTS_SAVE_INTERVAL 120 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 6000 + RESULTS_SAVE_INTERVAL 120 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - GRAVITATIONAL_VECTOR 0.0, 0.0, -9.81 + GRAVITATIONAL_VECTOR 0.0, 0.0, -9.81 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #-------------------- # Initial conditions #-------------------- - INITIAL_CONDITION - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20 + INITIAL_CONDITION + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20 #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 30 + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 30 diff --git a/Tests/Laminar/Cavity/Thermally_Driven/Skewed/control b/Tests/Laminar/Cavity/Thermally_Driven/Skewed/control index 8c2e63dc9..28a65f079 100644 --- a/Tests/Laminar/Cavity/Thermally_Driven/Skewed/control +++ b/Tests/Laminar/Cavity/Thermally_Driven/Skewed/control @@ -1,75 +1,73 @@ #---------- # Prologue #---------- - PROBLEM_NAME skewed - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME skewed + HEAT_TRANSFER yes + BUOYANCY thermal - NUMBER_OF_TIME_STEPS 1 + NUMBER_OF_TIME_STEPS 1 - RESULTS_SAVE_INTERVAL 3 - BACKUP_SAVE_INTERVAL 3 + RESULTS_SAVE_INTERVAL 3 + BACKUP_SAVE_INTERVAL 3 - TIME_STEP 1.0e+12 + TIME_STEP 1.0e+12 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 4 - MONITORING_POINT_001 0.5 0.1 0.95 - MONITORING_POINT_002 0.5 0.1 0.85 - MONITORING_POINT_003 0.5 0.1 0.75 - MONITORING_POINT_004 0.5 0.1 0.65 + NUMBER_OF_MONITORING_POINTS 4 + MONITORING_POINT_001 0.5 0.1 0.95 + MONITORING_POINT_002 0.5 0.1 0.85 + MONITORING_POINT_003 0.5 0.1 0.75 + MONITORING_POINT_004 0.5 0.1 0.65 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + # Properties based on Pr and Ra numbers: + # Pr = 0.71 + # Ra = 10e3 + # mu = 1.0 / sqrt(Pr * Ra) = 0.03752933125 + # lambda = sqrt(Pr / Ra) = 0.02664582518 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.03752933125 + THERMAL_CONDUCTIVITY 0.02664582518 - # Properties based on Pr and Ra numbers: - # Pr = 0.71 - # Ra = 10e3 - # mu = 1.0 / sqrt(Pr * Ra) = 0.03752933125 - # lambda = sqrt(Pr / Ra) = 0.02664582518 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.03752933125 - THERMAL_CONDUCTIVITY 0.02664582518 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 120 - MIN_SIMPLE_ITERATIONS 24 - MAX_SIMPLE_ITERATIONS 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 120 + MIN_SIMPLE_ITERATIONS 24 + MAX_SIMPLE_ITERATIONS 120 - REFERENCE_TEMPERATURE 0.5 + REFERENCE_TEMPERATURE 0.5 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Channel/control b/Tests/Laminar/Channel/control index 09a87d2bd..465cf2440 100644 --- a/Tests/Laminar/Channel/control +++ b/Tests/Laminar/Channel/control @@ -1,12 +1,12 @@ -PROBLEM_NAME channel_dual + PROBLEM_NAME channel_dual -NUMBER_OF_TIME_STEPS 120 + NUMBER_OF_TIME_STEPS 120 -MASS_FLOW_RATES 1.0 0.0 0.0 + MASS_FLOW_RATES 1.0 0.0 0.0 -BOUNDARY_CONDITION walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Convective_Outflow/control b/Tests/Laminar/Convective_Outflow/control index 5c772cdca..773ae7838 100644 --- a/Tests/Laminar/Convective_Outflow/control +++ b/Tests/Laminar/Convective_Outflow/control @@ -37,26 +37,26 @@ #----------------------------------------------------------- # Numerical parameters #----------------------------------------------------------- - PRESSURE_MOMENTUM_COUPLING piso + PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.999 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.999 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 200 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-5 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 200 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-5 #----------------------------------------------------------- # Linear solver settings #----------------------------------------------------------- - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #----------------------------------------------------------- # Boundary conditions diff --git a/Tests/Laminar/Copy_Inlet/control.0 b/Tests/Laminar/Copy_Inlet/control.0 index dacdf024c..79d8bc0a2 100644 --- a/Tests/Laminar/Copy_Inlet/control.0 +++ b/Tests/Laminar/Copy_Inlet/control.0 @@ -1,13 +1,13 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 - NUMBER_OF_TIME_STEPS 300 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 300 + NUMBER_OF_TIME_STEPS 300 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 - TIME_STEP 0.04 + TIME_STEP 0.04 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION channel backstep - BOUNDARY_CONDITIONS periodic_x in + INTERFACE_CONDITION channel backstep + BOUNDARY_CONDITIONS periodic_x in diff --git a/Tests/Laminar/Copy_Inlet/control.1 b/Tests/Laminar/Copy_Inlet/control.1 index 064a3b1fa..9992b16ed 100644 --- a/Tests/Laminar/Copy_Inlet/control.1 +++ b/Tests/Laminar/Copy_Inlet/control.1 @@ -1,52 +1,52 @@ #---------- # Prologue #--------- - PROBLEM_NAME channel - HEAT_TRANSFER no + PROBLEM_NAME channel + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 300 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 300 - TIME_STEP 0.04 + NUMBER_OF_TIME_STEPS 300 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 + + TIME_STEP 0.04 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 -1.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 -1.5 0.5 0.5 - POINT_FOR_MONITORING_PLANES -1.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES -1.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none - MASS_FLOW_RATES 2.0 0.0 0.0 + TURBULENCE_MODEL none + MASS_FLOW_RATES 2.0 0.0 0.0 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Copy_Inlet/control.2 b/Tests/Laminar/Copy_Inlet/control.2 index ad7fd7bd7..41f649b99 100644 --- a/Tests/Laminar/Copy_Inlet/control.2 +++ b/Tests/Laminar/Copy_Inlet/control.2 @@ -1,57 +1,55 @@ #---------- # Prologue #--------- - PROBLEM_NAME backstep - HEAT_TRANSFER no + PROBLEM_NAME backstep + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 300 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 300 - TIME_STEP 0.04 + NUMBER_OF_TIME_STEPS 300 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 300 -#LOAD_BACKUP_NAME backstep_orthogonal-ts.backup + TIME_STEP 0.04 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_MOMENTUM minmod - - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 400 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 400 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m1-p2-s1 b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m1-p2-s1 index 9b8328448..006b9321e 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m1-p2-s1 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m1-p2-s1 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,63 +24,63 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 - TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME parabolic + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m2-p3-s2 b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m2-p3-s2 index c3dc2de02..6a5855fa1 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m2-p3-s2 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m2-p3-s2 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,63 +24,63 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 - TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME parabolic + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m3-p4-s3 b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m3-p4-s3 index e3c46f16f..a04b9db89 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m3-p4-s3 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m3-p4-s3 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,63 +24,63 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 - TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME parabolic + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m4-p5-s4 b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m4-p5-s4 index 3a8e9e6a0..41ed14900 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m4-p5-s4 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m4-p5-s4 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,63 +24,63 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 - TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME parabolic + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m5-p6-s5 b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m5-p6-s5 index edb815049..1b494352b 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m5-p6-s5 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m5-p6-s5 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,63 +24,63 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 - TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME parabolic + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m6-p7-s6 b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m6-p7-s6 index bff83b4fa..c3bd756ed 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m6-p7-s6 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_A/control-m6-p7-s6 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,64 +24,64 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + TIME_INTEGRATION_SCHEME parabolic + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m1-p2-s1-g2 b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m1-p2-s1-g2 index b194ad434..81d13cea5 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m1-p2-s1-g2 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m1-p2-s1-g2 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,66 +24,66 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-2 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-2 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m2-p3-s2-g3 b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m2-p3-s2-g3 index e4f016ae1..ec496b6ce 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m2-p3-s2-g3 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m2-p3-s2-g3 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,66 +24,66 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m3-p4-s3-g4 b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m3-p4-s3-g4 index 7a69b8282..c7c020e7e 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m3-p4-s3-g4 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m3-p4-s3-g4 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,66 +24,66 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-4 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-4 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m4-p5-s4-g5 b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m4-p5-s4-g5 index 6dff896c6..c39b95af3 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m4-p5-s4-g5 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m4-p5-s4-g5 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,66 +24,66 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-5 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-5 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m5-p6-s5-g6 b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m5-p6-s5-g6 index 899961fd7..8f6b666bd 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m5-p6-s5-g6 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m5-p6-s5-g6 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,66 +24,66 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-6 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-6 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m6-p7-s6-g7 b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m6-p7-s6-g7 index bc6df3816..7777c23a6 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m6-p7-s6-g7 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_B/control-m6-p7-s6-g7 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,66 +24,66 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-7 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-7 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m1-p2-s1-g2 b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m1-p2-s1-g2 index 8d28099ab..91f42f42d 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m1-p2-s1-g2 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m1-p2-s1-g2 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-2 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-2 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m2-p3-s2-g3 b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m2-p3-s2-g3 index f6de771c7..f601b48e7 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m2-p3-s2-g3 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m2-p3-s2-g3 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m3-p4-s3-g4 b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m3-p4-s3-g4 index 8f678ce7e..1cfecab93 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m3-p4-s3-g4 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m3-p4-s3-g4 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-4 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-4 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m4-p5-s4-g5 b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m4-p5-s4-g5 index 3a6de347f..d73eeb774 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m4-p5-s4-g5 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m4-p5-s4-g5 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-5 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-5 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m5-p6-s5-g6 b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m5-p6-s5-g6 index 946b98914..89c7c1aa3 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m5-p6-s5-g6 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m5-p6-s5-g6 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-6 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-6 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m6-p7-s6-g7 b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m6-p7-s6-g7 index 8b501589a..5136ee096 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m6-p7-s6-g7 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_C/control-m6-p7-s6-g7 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-7 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-7 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m1-p2-s1-g2 b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m1-p2-s1-g2 index ce2fa00b0..92135f9cb 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m1-p2-s1-g2 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m1-p2-s1-g2 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-1 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-2 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-1 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m2-p3-s2-g3 b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m2-p3-s2-g3 index f6de771c7..f601b48e7 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m2-p3-s2-g3 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m2-p3-s2-g3 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-2 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-2 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m3-p4-s3-g4 b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m3-p4-s3-g4 index f07525687..f41519ed2 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m3-p4-s3-g4 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m3-p4-s3-g4 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m4-p5-s4-g5 b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m4-p5-s4-g5 index d7e92a50b..ad8bc5725 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m4-p5-s4-g5 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m4-p5-s4-g5 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m5-p6-s5-g6 b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m5-p6-s5-g6 index 547af2747..d098d9c85 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m5-p6-s5-g6 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m5-p6-s5-g6 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m6-p7-s6-g7 b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m6-p7-s6-g7 index dcd0aab7c..4142b4253 100644 --- a/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m6-p7-s6-g7 +++ b/Tests/Laminar/Cylinder/Horizontal/Re_100_D/control-m6-p7-s6-g7 @@ -1,7 +1,7 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #----------------------- # Physical properties @@ -11,7 +11,7 @@ # nu = 2.0e-3 # Re = U * D / nu = 100 #----------------------- - DYNAMIC_VISCOSITY 2.0e-3 + DYNAMIC_VISCOSITY 2.0e-3 #--------------------------------------- # Time stepping @@ -24,67 +24,67 @@ # dt = 0.0005 # N = 12000 give 6 flow through times #--------------------------------------- - TIME_STEP 0.0005 - NUMBER_OF_TIME_STEPS 12000 + TIME_STEP 0.0005 + NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 + SAVE_RESULTS_AT_BOUNDARIES no #----------------------------- # Monitoring points and plane #----------------------------- - POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.1 0.2 0.2 + POINT_FOR_MONITORING_PLANES 1.1 0.2 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.1 0.2 0.2 #---------------------- # Numerical parameters #---------------------- - CHOI_CORRECTION yes - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 + CHOI_CORRECTION yes + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.e-3 - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_POTENTIAL_SOLVER 1.e-6 - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 240 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 240 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Laminar/Cylinder/Vertical/User_Mod/Beginning_Of_Iteration.f90 b/Tests/Laminar/Cylinder/Vertical/User_Mod/Beginning_Of_Iteration.f90 index 973af91cc..fe10fe5d1 100644 --- a/Tests/Laminar/Cylinder/Vertical/User_Mod/Beginning_Of_Iteration.f90 +++ b/Tests/Laminar/Cylinder/Vertical/User_Mod/Beginning_Of_Iteration.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi @@ -44,11 +42,11 @@ subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) end if end do - call Comm_Mod_Global_Sum_Real(area_in) - call Comm_Mod_Global_Sum_Real(vol_in) + call Global % Sum_Real(area_in) + call Global % Sum_Real(vol_in) vel_in = vol_in / area_in - ! if(this_proc < 2) then + ! if(First_Proc()) then ! print *, '@ User_Mod_Beginning_Of_Time_Step' ! print *, '@ average inflow velocity = ', vel_in ! end if diff --git a/Tests/Laminar/Cylinder/Vertical/User_Mod/Save_Results.f90 b/Tests/Laminar/Cylinder/Vertical/User_Mod/Save_Results.f90 index 4843fc144..e8f1ed462 100644 --- a/Tests/Laminar/Cylinder/Vertical/User_Mod/Save_Results.f90 +++ b/Tests/Laminar/Cylinder/Vertical/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -29,7 +28,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -41,11 +40,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Turb % Alias_Heat_Fluxes (ut, vt, wt) ! Take constant physical properties - call Control_Mod_Mass_Density (rho_const) - call Control_Mod_Dynamic_Viscosity (mu_const) + call Control % Mass_Density (rho_const) + call Control % Dynamic_Viscosity (mu_const) nu_const = mu_const / rho_const - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(k_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(k_const) d = 1.0 ! characteristic dim. t_wall = 50.0 ! temp. at the wal @@ -82,15 +81,15 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(nuss_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(nuss_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait nuss_mean = nuss_mean / n_points end if - if(this_proc < 2) then + if(First_Proc()) then print *, 't_ref = ', Flow % t_ref print *, 'alfa_const = ', alfa_const print *, 'ra = ', ra diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e05 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e05 index 6352e6e2b..3df43207a 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e05 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e05 @@ -1,61 +1,61 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1200 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^5 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0206 - DYNAMIC_VISCOSITY 0.0146 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0206 + DYNAMIC_VISCOSITY 0.0146 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e06 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e06 index 7123b8b87..c6898bddb 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e06 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e06 @@ -1,64 +1,63 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 2400 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 2400 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts001200.backup + LOAD_BACKUP_NAME cylinder-ts001200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^6 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0065 - DYNAMIC_VISCOSITY 0.00462 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0065 + DYNAMIC_VISCOSITY 0.00462 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions @@ -67,7 +66,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e07 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e07 index 1a4bc1501..413726e5f 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e07 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e07 @@ -1,64 +1,63 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 3600 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 3600 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts002400.backup + LOAD_BACKUP_NAME cylinder-ts002400.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^7 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.00206 - DYNAMIC_VISCOSITY 0.00146 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.00206 + DYNAMIC_VISCOSITY 0.00146 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions @@ -67,7 +66,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e08 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e08 index e505203fe..fed524d6f 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e08 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e08 @@ -1,64 +1,63 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 4800 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 4800 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts003600.backup + LOAD_BACKUP_NAME cylinder-ts003600.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^8 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.00065 - DYNAMIC_VISCOSITY 0.000462 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.00065 + DYNAMIC_VISCOSITY 0.000462 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions @@ -67,7 +66,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e5 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e5 index 22521babb..709513847 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e5 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e5 @@ -1,63 +1,60 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1200 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME cylinder-ts000600.backup + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^5 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0206 - DYNAMIC_VISCOSITY 0.0146 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0206 + DYNAMIC_VISCOSITY 0.0146 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + PRESSURE_MOMENTUM_COUPLING simple - TIME_INTEGRATION_SCHEME parabolic + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 160 + MIN_SIMPLE_ITERATIONS 6 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 160 #-------------------- # Initial conditions @@ -66,7 +63,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e6 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e6 index bd797998f..25a0c465e 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e6 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e6 @@ -1,63 +1,62 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 2400 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 2400 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts001200.backup + LOAD_BACKUP_NAME cylinder-ts001200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^6 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.0065 - DYNAMIC_VISCOSITY 0.00462 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.0065 + DYNAMIC_VISCOSITY 0.00462 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - - MIN_SIMPLE_ITERATIONS 6 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 160 + MIN_SIMPLE_ITERATIONS 6 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 160 #-------------------- # Initial conditions @@ -66,7 +65,6 @@ VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 0.01 0.001 0.1 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Laminar/Cylinder/Vertical/control-ra-1e7 b/Tests/Laminar/Cylinder/Vertical/control-ra-1e7 index cfe5c1bc6..eed6e8056 100644 --- a/Tests/Laminar/Cylinder/Vertical/control-ra-1e7 +++ b/Tests/Laminar/Cylinder/Vertical/control-ra-1e7 @@ -1,63 +1,62 @@ #---------- # Prologue #---------- - PROBLEM_NAME cylinder - HEAT_TRANSFER yes - BUOYANCY thermal + PROBLEM_NAME cylinder + HEAT_TRANSFER yes + BUOYANCY thermal - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 3600 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 3600 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME cylinder-ts002400.backup + LOAD_BACKUP_NAME cylinder-ts002400.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models for Ra = 10^7 #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.00206 - DYNAMIC_VISCOSITY 0.00146 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.00206 + DYNAMIC_VISCOSITY 0.00146 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, -1.0, 0.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - - MIN_SIMPLE_ITERATIONS 6 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 160 + MIN_SIMPLE_ITERATIONS 6 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 160 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Flat_Plate/User_Mod/Plain_Nu.f90 b/Tests/Laminar/Flat_Plate/User_Mod/Plain_Nu.f90 index 2011c5bce..1c29392d0 100644 --- a/Tests/Laminar/Flat_Plate/User_Mod/Plain_Nu.f90 +++ b/Tests/Laminar/Flat_Plate/User_Mod/Plain_Nu.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Plain_Nu(Flow, Turb, ts) + subroutine User_Mod_Plain_Nu(Flow, Turb) !------------------------------------------------------------------------------! ! Subroutine extracts skin friction coefficient and Stanton number for ! ! backstep case. ! @@ -12,7 +12,7 @@ subroutine User_Mod_Plain_Nu(Flow, Turb, ts) type(Var_Type), pointer :: u, v, w, t type(Grid_Type), pointer :: Grid type(Bulk_Type), pointer :: bulk - integer :: n_prob, pl, c, dummy, i, count, k, c1, c2, s, fu, ts + integer :: n_prob, pl, c, dummy, i, count, k, c1, c2, s, fu character(SL) :: result_name real, allocatable :: r1_p(:), r2_p(:), z_p(:), & um_p(:), vm_p(:), wm_p(:), & @@ -38,10 +38,10 @@ subroutine User_Mod_Plain_Nu(Flow, Turb, ts) t => Flow % t ! Get constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) !----------------------------------! ! Read "x_coordinate.dat" file ! @@ -49,7 +49,7 @@ subroutine User_Mod_Plain_Nu(Flow, Turb, ts) inquire(file='x_coordinate.dat', exist=there) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "File x_coordinate.dat does not exist. Exit Plain_Nu.f90 !" end if return @@ -131,34 +131,37 @@ subroutine User_Mod_Plain_Nu(Flow, Turb, ts) ! Average over all processors do pl=1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(um_p(pl)) - call Comm_Mod_Global_Sum_Real(vm_p(pl)) - call Comm_Mod_Global_Sum_Real(wm_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uv_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(vw_p(pl)) - call Comm_Mod_Global_Sum_Real(v1_p(pl)) - call Comm_Mod_Global_Sum_Real(v2_p(pl)) - call Comm_Mod_Global_Sum_Real(v3_p(pl)) - call Comm_Mod_Global_Sum_Real(v4_p(pl)) - call Comm_Mod_Global_Sum_Real(v5_p(pl)) + call Global % Sum_Int(n_count(pl)) + call Global % Sum_Real(um_p(pl)) + call Global % Sum_Real(vm_p(pl)) + call Global % Sum_Real(wm_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uv_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(vw_p(pl)) + call Global % Sum_Real(v1_p(pl)) + call Global % Sum_Real(v2_p(pl)) + call Global % Sum_Real(v3_p(pl)) + call Global % Sum_Real(v4_p(pl)) + call Global % Sum_Real(v5_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(tm_p(pl)) - call Comm_Mod_Global_Sum_Real(tt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(tm_p(pl)) + call Global % Sum_Real(tt_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call File % Set_Name(result_name, time_step=ts, appendix='-Nu', extension='.dat') + call File % Set_Name(result_name, & + time_step = Time % Curr_Dt(), & + appendix = '-Nu', & + extension = '.dat') call File % Open_For_Writing_Ascii(result_name, fu) write(fu,*) '# x, Cf, Cf_corr, Nu, Nu_corr, q' @@ -215,6 +218,6 @@ subroutine User_Mod_Plain_Nu(Flow, Turb, ts) deallocate(wt_p) end if - if(this_proc < 2) write(*,*) '# Finished with User_Plain_Nu' + if(First_Proc()) write(*,*) '# Finished with User_Plain_Nu' end subroutine diff --git a/Tests/Laminar/Flat_Plate/User_Mod/Plain_Profiles.f90 b/Tests/Laminar/Flat_Plate/User_Mod/Plain_Profiles.f90 index 80879d5e4..b1f33c929 100644 --- a/Tests/Laminar/Flat_Plate/User_Mod/Plain_Profiles.f90 +++ b/Tests/Laminar/Flat_Plate/User_Mod/Plain_Profiles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Plain_Profiles(Flow, Turb, ts) + subroutine User_Mod_Plain_Profiles(Flow, Turb) !------------------------------------------------------------------------------! ! Description !------------------------------------------------------------------------------! @@ -12,7 +12,7 @@ subroutine User_Mod_Plain_Profiles(Flow, Turb, ts) type(Var_Type), pointer :: kin, eps, zeta, f22 type(Grid_Type), pointer :: Grid integer :: n_prob, pl, c, idumm, i, count, & - k, c1, c2, s, n_hor, fu, ts + k, c1, c2, s, n_hor, fu character(SL) :: coord_name, result_name real, parameter :: u_b = 11.3, h = 0.038 real, allocatable :: x1_p(:), x2_p(:), lnum(:), z_p(:), & @@ -39,7 +39,7 @@ subroutine User_Mod_Plain_Profiles(Flow, Turb, ts) inquire(file='horizontal_positions.dat', exist=there) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "#============================================================" print *, "# In order to extract profiles and write them in ascii files " print *, "# the code has to read ascii file in which positions of the " @@ -70,11 +70,11 @@ subroutine User_Mod_Plain_Profiles(Flow, Turb, ts) !------------------! ! Read 1d file ! !------------------! - if(this_proc < 2) print *, '# Now reading the file:', coord_name + if(First_Proc()) print *, '# Now reading the file:', coord_name inquire( file=coord_name, exist=there ) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "===========================================================" print *, "In order to extract profiles and write them in ascii files " print *, "the code has to read cell-faces coordinates " @@ -147,55 +147,66 @@ subroutine User_Mod_Plain_Profiles(Flow, Turb, ts) ! Average over all processors do pl=1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(um_p(pl)) - call Comm_Mod_Global_Sum_Real(vm_p(pl)) - call Comm_Mod_Global_Sum_Real(wm_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uv_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(vw_p(pl)) - call Comm_Mod_Global_Sum_Real(v1_p(pl)) - call Comm_Mod_Global_Sum_Real(v2_p(pl)) - call Comm_Mod_Global_Sum_Real(v3_p(pl)) - call Comm_Mod_Global_Sum_Real(v4_p(pl)) - call Comm_Mod_Global_Sum_Real(v5_p(pl)) + call Global % Sum_Int(n_count(pl)) + call Global % Sum_Real(um_p(pl)) + call Global % Sum_Real(vm_p(pl)) + call Global % Sum_Real(wm_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uv_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(vw_p(pl)) + call Global % Sum_Real(v1_p(pl)) + call Global % Sum_Real(v2_p(pl)) + call Global % Sum_Real(v3_p(pl)) + call Global % Sum_Real(v4_p(pl)) + call Global % Sum_Real(v5_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(tm_p(pl)) - call Comm_Mod_Global_Sum_Real(tt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(tm_p(pl)) + call Global % Sum_Real(tt_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do if(k == 1) then - call File % Set_Name(result_name, time_step=ts, appendix='-1', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-1', extension='.dat') else if(k == 2) then - call File % Set_Name(result_name, time_step=ts, appendix='-2', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-2', extension='.dat') else if(k == 3) then - call File % Set_Name(result_name, time_step=ts, appendix='-3', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-3', extension='.dat') else if(k == 4) then - call File % Set_Name(result_name, time_step=ts, appendix='-4', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-4', extension='.dat') else if(k == 5) then - call File % Set_Name(result_name, time_step=ts, appendix='-5', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-5', extension='.dat') else if(k == 6) then - call File % Set_Name(result_name, time_step=ts, appendix='-6', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-6', extension='.dat') else if(k == 7) then - call File % Set_Name(result_name, time_step=ts, appendix='-7', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-7', extension='.dat') else if(k == 8) then - call File % Set_Name(result_name, time_step=ts, appendix='-8', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-8', extension='.dat') else if(k == 9) then - call File % Set_Name(result_name, time_step=ts, appendix='-9', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-9', extension='.dat') else if(k == 10) then - call File % Set_Name(result_name, time_step=ts, appendix='-10', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-10', extension='.dat') else if(k == 11) then - call File % Set_Name(result_name, time_step=ts, appendix='-11', extension='.dat') + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & + appendix='-11', extension='.dat') end if call File % Open_For_Writing_Ascii(result_name, fu) @@ -272,6 +283,6 @@ subroutine User_Mod_Plain_Profiles(Flow, Turb, ts) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Backstep_Profiles' + if(First_Proc()) print *, '# Finished with User_Backstep_Profiles' end subroutine diff --git a/Tests/Laminar/Flat_Plate/User_Mod/Save_Results.f90 b/Tests/Laminar/Flat_Plate/User_Mod/Save_Results.f90 index b80b4fc7a..6b1d02081 100644 --- a/Tests/Laminar/Flat_Plate/User_Mod/Save_Results.f90 +++ b/Tests/Laminar/Flat_Plate/User_Mod/Save_Results.f90 @@ -1,8 +1,8 @@ -include '../User_Mod/Plain_Profiles.f90' -include '../User_Mod/Plain_Nu.f90' +#include "Plain_Profiles.f90" +#include "Plain_Nu.f90" !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! Calls user-define subroutines ! !------------------------------------------------------------------------------! @@ -12,14 +12,13 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return - call User_Mod_Plain_Profiles(Flow, Turb, ts) - call User_Mod_Plain_Nu (Flow, Turb, ts) + call User_Mod_Plain_Profiles(Flow, Turb) + call User_Mod_Plain_Nu (Flow, Turb) end subroutine diff --git a/Tests/Laminar/Flat_Plate/control b/Tests/Laminar/Flat_Plate/control index bd88bfc97..4d646f830 100644 --- a/Tests/Laminar/Flat_Plate/control +++ b/Tests/Laminar/Flat_Plate/control @@ -1,83 +1,79 @@ #-------------------- # Problem definition #-------------------- - - PROBLEM_NAME plate - - HEAT_TRANSFER yes + PROBLEM_NAME plate + HEAT_TRANSFER yes #--------------- # Time stepping #--------------- - TIME_STEP 5.0 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 200 + TIME_STEP 5.0 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 200 -# LOAD_BACKUP_NAME plate-ts001200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 10 + NUMBER_OF_MONITORING_POINTS 10 - MONITORING_POINT_001 0.1 0.5 0.5 - MONITORING_POINT_002 0.5 0.5 0.5 - MONITORING_POINT_003 1.0 0.5 0.5 - MONITORING_POINT_004 1.5 0.5 0.5 - MONITORING_POINT_005 2.0 0.5 0.5 - MONITORING_POINT_006 3.0 0.5 0.5 - MONITORING_POINT_007 4.0 0.5 0.5 - MONITORING_POINT_008 5.0 0.5 0.5 - MONITORING_POINT_009 10.0 0.5 0.5 - MONITORING_POINT_010 20.0 0.5 0.5 + MONITORING_POINT_001 0.1 0.5 0.5 + MONITORING_POINT_002 0.5 0.5 0.5 + MONITORING_POINT_003 1.0 0.5 0.5 + MONITORING_POINT_004 1.5 0.5 0.5 + MONITORING_POINT_005 2.0 0.5 0.5 + MONITORING_POINT_006 3.0 0.5 0.5 + MONITORING_POINT_007 4.0 0.5 0.5 + MONITORING_POINT_008 5.0 0.5 0.5 + MONITORING_POINT_009 10.0 0.5 0.5 + MONITORING_POINT_010 20.0 0.5 0.5 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #---------------------------------------- # Fluid properties # Dry air at 27oC in SI units #---------------------------------------- - MASS_DENSITY 1.177 - DYNAMIC_VISCOSITY 1.846e-5 - - THERMAL_CONDUCTIVITY 2.6240e-2 - HEAT_CAPACITY 1000.0 + MASS_DENSITY 1.177 + DYNAMIC_VISCOSITY 1.846e-5 + THERMAL_CONDUCTIVITY 2.6240e-2 + HEAT_CAPACITY 1000.0 #---------------------------------------- # Physical models #---------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-5 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 #-------------------- # Initial conditions #-------------------- INITIAL_CONDITION - VARIABLES u v w t + VARIABLES u v w t VALUES 0.0 0.0 0.0 20.0 #--------------------- @@ -85,25 +81,25 @@ #--------------------- BOUNDARY_CONDITION bottom TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 25.0 + VARIABLES u v w t + VALUES 0.0 0.0 0.0 25.0 BOUNDARY_CONDITION entrance TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20.0 + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20.0 BOUNDARY_CONDITION top TYPE pressure - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20.0 + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20.0 BOUNDARY_CONDITION inlet TYPE inflow - VARIABLES u v w t - VALUES 0.05 0.0 0.0 20.0 + VARIABLES u v w t + VALUES 0.05 0.0 0.0 20.0 - BOUNDARY_CONDITION outlet + BOUNDARY_CONDITION outlet TYPE pressure - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20.0 + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20.0 diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/control.0 b/Tests/Laminar/Heat_Exchanger/2_Domains/control.0 index ba41be872..1dc0b9480 100644 --- a/Tests/Laminar/Heat_Exchanger/2_Domains/control.0 +++ b/Tests/Laminar/Heat_Exchanger/2_Domains/control.0 @@ -1,13 +1,13 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 - NUMBER_OF_TIME_STEPS 90 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 90 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.1 + TIME_STEP 0.1 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION upper_dom lower_dom - BOUNDARY_CONDITIONS bottom_wall top_wall + INTERFACE_CONDITION upper_dom lower_dom + BOUNDARY_CONDITIONS bottom_wall top_wall diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/control.1 b/Tests/Laminar/Heat_Exchanger/2_Domains/control.1 index 2fe424c05..304389fa8 100644 --- a/Tests/Laminar/Heat_Exchanger/2_Domains/control.1 +++ b/Tests/Laminar/Heat_Exchanger/2_Domains/control.1 @@ -1,54 +1,52 @@ #---------- # Prologue #---------- - PROBLEM_NAME upper_dom - HEAT_TRANSFER yes + PROBLEM_NAME upper_dom + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 90 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 90 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.05 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.05 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.05 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.05 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/control.2 b/Tests/Laminar/Heat_Exchanger/2_Domains/control.2 index 35e136d9a..da56f5219 100644 --- a/Tests/Laminar/Heat_Exchanger/2_Domains/control.2 +++ b/Tests/Laminar/Heat_Exchanger/2_Domains/control.2 @@ -1,46 +1,44 @@ #---------- # Prologue #---------- - PROBLEM_NAME lower_dom - HEAT_TRANSFER yes + PROBLEM_NAME lower_dom + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 90 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 90 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 -0.1 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 -0.1 - POINT_FOR_MONITORING_PLANES 0.5 0.5 -0.1 + POINT_FOR_MONITORING_PLANES 0.5 0.5 -0.1 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/divide.1.scr b/Tests/Laminar/Heat_Exchanger/2_Domains/divide.1.scr new file mode 100644 index 000000000..97b642a66 --- /dev/null +++ b/Tests/Laminar/Heat_Exchanger/2_Domains/divide.1.scr @@ -0,0 +1,3 @@ +lower_dom +4 + diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/divide.2.scr b/Tests/Laminar/Heat_Exchanger/2_Domains/divide.2.scr new file mode 100644 index 000000000..eed136899 --- /dev/null +++ b/Tests/Laminar/Heat_Exchanger/2_Domains/divide.2.scr @@ -0,0 +1,3 @@ +upper_dom +4 + diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/lower_dom.msh.gz b/Tests/Laminar/Heat_Exchanger/2_Domains/lower_dom.msh.gz new file mode 100644 index 000000000..47adaa169 Binary files /dev/null and b/Tests/Laminar/Heat_Exchanger/2_Domains/lower_dom.msh.gz differ diff --git a/Tests/Laminar/Heat_Exchanger/2_Domains/upper_dom.msh.gz b/Tests/Laminar/Heat_Exchanger/2_Domains/upper_dom.msh.gz new file mode 100644 index 000000000..76c9324aa Binary files /dev/null and b/Tests/Laminar/Heat_Exchanger/2_Domains/upper_dom.msh.gz differ diff --git a/Tests/Laminar/Heat_Exchanger/3_Domains/control.0 b/Tests/Laminar/Heat_Exchanger/3_Domains/control.0 index a109a32b9..2c99088bb 100644 --- a/Tests/Laminar/Heat_Exchanger/3_Domains/control.0 +++ b/Tests/Laminar/Heat_Exchanger/3_Domains/control.0 @@ -1,15 +1,15 @@ - NUMBER_OF_DOMAINS 3 + NUMBER_OF_DOMAINS 3 - NUMBER_OF_TIME_STEPS 360 - RESULTS_SAVE_INTERVAL 30 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 360 + RESULTS_SAVE_INTERVAL 30 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.1 + TIME_STEP 0.1 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION upper_dom membrane - BOUNDARY_CONDITIONS bottom_wall top_wall + INTERFACE_CONDITION upper_dom membrane + BOUNDARY_CONDITIONS bottom_wall top_wall - INTERFACE_CONDITION membrane lower_dom - BOUNDARY_CONDITIONS bottom_wall top_wall + INTERFACE_CONDITION membrane lower_dom + BOUNDARY_CONDITIONS bottom_wall top_wall diff --git a/Tests/Laminar/Heat_Exchanger/3_Domains/control.1 b/Tests/Laminar/Heat_Exchanger/3_Domains/control.1 index 22188419e..4c59cd3d1 100644 --- a/Tests/Laminar/Heat_Exchanger/3_Domains/control.1 +++ b/Tests/Laminar/Heat_Exchanger/3_Domains/control.1 @@ -1,54 +1,52 @@ #---------- # Prologue #---------- - PROBLEM_NAME upper_dom - HEAT_TRANSFER yes + PROBLEM_NAME upper_dom + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 12 - RESULTS_SAVE_INTERVAL 3 - BACKUP_SAVE_INTERVAL 12 + NUMBER_OF_TIME_STEPS 12 + RESULTS_SAVE_INTERVAL 3 + BACKUP_SAVE_INTERVAL 12 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.025 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.025 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Heat_Exchanger/3_Domains/control.2 b/Tests/Laminar/Heat_Exchanger/3_Domains/control.2 index 92ae43e26..827dc1521 100644 --- a/Tests/Laminar/Heat_Exchanger/3_Domains/control.2 +++ b/Tests/Laminar/Heat_Exchanger/3_Domains/control.2 @@ -1,54 +1,52 @@ #---------- # Prologue #---------- - PROBLEM_NAME lower_dom - HEAT_TRANSFER yes + PROBLEM_NAME lower_dom + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 12 - RESULTS_SAVE_INTERVAL 3 - BACKUP_SAVE_INTERVAL 12 + NUMBER_OF_TIME_STEPS 12 + RESULTS_SAVE_INTERVAL 3 + BACKUP_SAVE_INTERVAL 12 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.025 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.025 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Heat_Exchanger/3_Domains/control.3 b/Tests/Laminar/Heat_Exchanger/3_Domains/control.3 index 626c67ae7..0328bbef9 100644 --- a/Tests/Laminar/Heat_Exchanger/3_Domains/control.3 +++ b/Tests/Laminar/Heat_Exchanger/3_Domains/control.3 @@ -1,54 +1,52 @@ #---------- # Prologue #---------- - PROBLEM_NAME membrane - HEAT_TRANSFER yes + PROBLEM_NAME membrane + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 12 - RESULTS_SAVE_INTERVAL 3 - BACKUP_SAVE_INTERVAL 12 + NUMBER_OF_TIME_STEPS 12 + RESULTS_SAVE_INTERVAL 3 + BACKUP_SAVE_INTERVAL 12 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 240 + DYNAMIC_VISCOSITY 1.0e+6 + HEAT_CAPACITY 1.0e-3 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 240 - DYNAMIC_VISCOSITY 1.0e+6 - HEAT_CAPACITY 1.0e-3 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/Beginning_Of_Iteration.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/Beginning_Of_Iteration.f90 index d63d07684..b48015bf2 100644 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/Beginning_Of_Iteration.f90 +++ b/Tests/Laminar/Membrane/2_Domains/User_Mod/Beginning_Of_Iteration.f90 @@ -1,7 +1,7 @@ -include '../User_Mod/T_Sat.f90' +#include "T_Sat.f90" !==============================================================================! - subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -11,8 +11,6 @@ subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer :: n ! time step - real :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, scalar @@ -142,7 +140,7 @@ subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) + k_film / d_film * (t_film - t_int)) / h_d ! If not in a buffer, update accumulated variables - if(Grid % Comm % cell_proc(c1) .eq. this_proc) then + if(Grid % Comm % cell_proc(c1) .eq. This_Proc()) then t_int_acc = t_int_acc + t_int * Grid % s(s) m_evap_acc = m_evap_acc + m_evap * Grid % s(s) area_acc = area_acc + Grid % s(s) @@ -154,12 +152,12 @@ subroutine User_Mod_Beginning_Of_Iteration(Flow, Turb, Vof, Swarm, n, time) end do ! Positive for evaporation, negative for condensation - call Comm_Mod_Global_Sum_Real(t_int_acc) - call Comm_Mod_Global_Sum_Real(m_evap_acc) - call Comm_Mod_Global_Sum_Real(area_acc) + call Global % Sum_Real(t_int_acc) + call Global % Sum_Real(m_evap_acc) + call Global % Sum_Real(area_acc) m_evap_avg = m_evap_acc / area_acc t_int_avg = t_int_acc / area_acc - if(this_proc < 2) then + if(First_Proc()) then print * , 'm_evap =', m_evap_avg * 3600, ' kg/m²h ' print * , 't_int = ', t_int_avg, 'Celsius' end if diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/Initialize_Variables.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/Initialize_Variables.f90 index 851d59c8e..dcad51af5 100644 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/Initialize_Variables.f90 +++ b/Tests/Laminar/Membrane/2_Domains/User_Mod/Initialize_Variables.f90 @@ -1,4 +1,4 @@ -!include '../User_Mod/Pv_Sat.f90' +!#include "Pv_Sat.f90" !==============================================================================! subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/Interface_Exchange.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/Interface_Exchange.f90 index 4d7c2cc64..7a349c300 100644 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/Interface_Exchange.f90 +++ b/Tests/Laminar/Membrane/2_Domains/User_Mod/Interface_Exchange.f90 @@ -1,6 +1,6 @@ -include '../User_Mod/Pv_Sat_Salt.f90' -include '../User_Mod/Jump_Cond.f90' -include '../User_Mod/Brent_For_Jump_Cond.f90' +#include "Pv_Sat_Salt.f90" +#include "Jump_Cond.f90" +#include "Brent_For_Jump_Cond.f90" !==============================================================================! subroutine User_Mod_Interface_Exchange(inter, Flow, Turb, Vof, Swarm, n_dom) @@ -232,7 +232,7 @@ subroutine User_Mod_Interface_Exchange(inter, Flow, Turb, Vof, Swarm, n_dom) Flow(d1) % t % n(bc1) = t_int ! If not in a buffer, update accumulated variables - if(Grid1 % Comm % cell_proc(ic1) .eq. this_proc) then + if(Grid1 % Comm % cell_proc(ic1) .eq. This_Proc()) then mem_j_heat_acc = mem_j_heat_acc + mem_j_heat * Grid1 % s(n) mem_j_diff_acc = mem_j_diff_acc + mem_j_diff * Grid1 % s(n) t_int_acc = t_int_acc + t_int * Grid1 % s(n) @@ -301,15 +301,15 @@ subroutine User_Mod_Interface_Exchange(inter, Flow, Turb, Vof, Swarm, n_dom) end do end do - call Comm_Mod_Global_Sum_Real(mem_j_diff_acc) - call Comm_Mod_Global_Sum_Real(mem_j_heat_acc) - call Comm_Mod_Global_Sum_Real(t_int_acc) - call Comm_Mod_Global_Sum_Real(area_acc) + call Global % Sum_Real(mem_j_diff_acc) + call Global % Sum_Real(mem_j_heat_acc) + call Global % Sum_Real(t_int_acc) + call Global % Sum_Real(area_acc) mem_j_diff_avg = mem_j_diff_acc / area_acc mem_j_heat_avg = mem_j_heat_acc / area_acc t_int_avg = t_int_acc / area_acc ! Control - if(this_proc < 2) then + if(First_Proc()) then print *, 'mem_j_diff = ' , mem_j_diff_avg * 3600, ' kg/m²h' print *, 'mem_j_heat = ' , mem_j_heat_avg * 3600, ' kg/m²h' print *, 'jump condition coefficients: ', lhs_lin, lhs_fun, rhs diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/Jump_Cond.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/Jump_Cond.f90 index db479c88e..7bdc116a3 100644 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/Jump_Cond.f90 +++ b/Tests/Laminar/Membrane/2_Domains/User_Mod/Jump_Cond.f90 @@ -1,4 +1,4 @@ -!include '../User_Mod/Pv_Sat.f90' +!#include "Pv_Sat.f90" !==============================================================================! subroutine Jump_Cond(t_int, res, lhs_lin, lhs_fun, rhs) diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/Pv_Sat_Salt.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/Pv_Sat_Salt.f90 index 453855673..ef2dd15f6 100644 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/Pv_Sat_Salt.f90 +++ b/Tests/Laminar/Membrane/2_Domains/User_Mod/Pv_Sat_Salt.f90 @@ -1,4 +1,4 @@ -include '../User_Mod/Pv_Sat.f90' +#include "Pv_Sat.f90" !==============================================================================! subroutine Pv_Sat_Salt(t, m_h2o, m_salt, sc1, p_v_h2o) diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/Read_Control_Boundary_Conditions.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/Read_Control_Boundary_Conditions.f90 deleted file mode 100644 index 86826e4bb..000000000 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/Read_Control_Boundary_Conditions.f90 +++ /dev/null @@ -1,899 +0,0 @@ -!==============================================================================! - subroutine Read_Control_Boundary_Conditions(Flow, Turb, Vof, turb_planes) -!------------------------------------------------------------------------------! -! Reads boundary condition from control file ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Const_Mod - use Comm_Mod, only: this_proc, Comm_Mod_End - use Field_Mod, only: Field_Type, heat_transfer - use Turb_Mod - use Multiphase_Mod, only: Multiphase_Type, VOLUME_OF_FLUID - use Grid_Mod, only: Grid_Type - use Eddies_Mod - use User_Mod - use Control_Mod - use Var_Mod, only: Var_Type -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Multiphase_Type), target :: Vof - type(Turb_Plane_Type) :: turb_planes -!----------------------------------[Calling]-----------------------------------! - integer :: Key_Ind -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - type(Var_Type), pointer :: u, v, w, t, p, fun - type(Var_Type), pointer :: kin, eps, f22, zeta, vis, t2 - type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw - type(Var_Type), pointer :: scalar(:) - integer :: c,m,l,k,i,bc,n_points,nks,nvs,sc,c1,c2,s,fu - character(SL) :: name_prof(128) - real :: wi, dist_min, x, y, z, xp, dist - real, allocatable :: prof(:,:) - logical :: here - character(SL) :: bc_type_name, try_str - integer :: bc_type_tag - character(SL) :: keys(128) - real :: vals(0:128) ! they start from zero! - integer :: types_per_color(128) ! how many types in a color - character(SL) :: types_names(128) ! name of each type - logical :: types_file(128) ! type specified in a file? - integer :: c_types ! counter types - integer :: edd_n - real :: edd_r - real :: edd_i - logical :: found -!==============================================================================! - - ! Take aliases - Grid => Flow % pnt_grid - t => Flow % t - p => Flow % p - scalar => Flow % scalar - vis => Turb % vis - t2 => Turb % t2 - fun => Vof % fun - - call Field_Mod_Alias_Momentum (Flow, u, v, w) - call Turb % Alias_K_Eps_Zeta_F(kin, eps, zeta, f22) - call Turb % Alias_Stresses (uu, vv, ww, uv, uw, vw) - - !-------------------------! - ! Read wall roughness ! - !-------------------------! - call Control_Mod_Roughness_Coefficient(Turb % z_o) - - !----------------------------------------------------------------! - ! Count number of types per boundary condition, total number ! - ! of types specified, and also extract their names ! - !----------------------------------------------------------------! - types_per_color(:) = 0 - types_file(:) = .false. - c_types = 0 - - do bc = 1, Grid % n_bnd_cond - call Control_Mod_Position_At_Two_Keys('BOUNDARY_CONDITION', & - Grid % bnd_cond % name(bc), & - found, & - .false.) - if(found) then -1 continue - - ! Try to read next 'TYPE' in the control file - call Control_Mod_Read_Char_Item_On('TYPE', 'VOID', bc_type_name, .false.) - - ! Get out of the loop if you fail - if(bc_type_name .eq. 'VOID') goto 2 - - ! Skip following two lines - call Control_Mod_Read_Char_Item_On('VARIABLES', 'VOID', try_str, .false.) - call Control_Mod_Read_Char_Item_On('VALUES', 'VOID', try_str, .false.) - - types_per_color(bc) = types_per_color(bc) + 1 - c_types = c_types + 1 - types_names(c_types) = bc_type_name - - ! If try_str is 'VOID', it didn't find 'VALUES' - ! meaning that the keyword 'FILE' was specified - if(try_str .eq. 'VOID') then - types_file(c_types) = .true. - end if - - goto 1 - else - if(this_proc < 2) then - print *, '# ERROR! Boundary conditions for ', & - trim(Grid % bnd_cond % name(bc)), & - ' not specified in the control file!' - print *, '# Exiting the program.' - end if - call Comm_Mod_End - stop - end if - -2 continue - - end do - - !------------------------------------------------! - ! ! - ! ! - ! Read boundary conditions from control file ! - ! ! - ! ! - !------------------------------------------------! - c_types = 0 - - do bc = 1, Grid % n_bnd_cond - - ! Position yourself well - call Control_Mod_Position_At_Two_Keys('BOUNDARY_CONDITION', & - Grid % bnd_cond % name(bc), & - found, & - .false.) - do l = 1, types_per_color(bc) - - ! Update the counter - c_types = c_types + 1 - - !---------------------------------------------! - ! ! - ! Read first line which is common for all ! - ! ! - !---------------------------------------------! - call Control_Mod_Read_Char_Item_On('TYPE', 'WALL', bc_type_name, .false.) - call To_Upper_Case(bc_type_name) - - ! Copy boundary conditions which were given for the Grid - if( bc_type_name .eq. 'INFLOW') then - bc_type_tag = INFLOW - Grid % bnd_cond % type(bc) = INFLOW - else if( bc_type_name .eq. 'WALL') then - bc_type_tag = WALL - Grid % bnd_cond % type(bc) = WALL - else if( bc_type_name .eq. 'OUTFLOW') then - bc_type_tag = OUTFLOW - Grid % bnd_cond % type(bc) = OUTFLOW - else if( bc_type_name .eq. 'SYMMETRY') then - bc_type_tag = SYMMETRY - Grid % bnd_cond % type(bc) = SYMMETRY - else if( bc_type_name .eq. 'WALL_FLUX') then - bc_type_tag = WALLFL - Grid % bnd_cond % type(bc) = WALLFL - else if( bc_type_name .eq. 'CONVECTIVE') then - bc_type_tag = CONVECT - Grid % bnd_cond % type(bc) = CONVECT - else if( bc_type_name .eq. 'PRESSURE') then - bc_type_tag = PRESSURE - Grid % bnd_cond % type(bc) = PRESSURE - else if( bc_type_name .eq. 'OPENBC') then - bc_type_tag = OPENBC - Grid % bnd_cond % type(bc) = OPENBC - else - if(this_proc < 2) then - print *, '# ERROR! Read_Control_Boundary_Conditions: '// & - '# Unknown boundary condition type: ', & - bc_type_name - print *, '# This error is critical, exiting!' - call Comm_Mod_End - stop - end if - end if - - !----------------------------------------------! - ! ! - ! Read second line which is common for all ! - ! ! - !----------------------------------------------! - call Control_Mod_Read_Strings_On('VARIABLES', keys, nks, .false.) - do i = 1, nks - call To_Upper_Case(keys(i)) - end do - - !-----------------------------------------------------------------! - ! ! - ! Boundary values are specified in a list (and not in a file) ! - ! ! - !-----------------------------------------------------------------! - if( .not. types_file(c_types) ) then - call Control_Mod_Read_Real_Array_On('VALUES', vals(1), nvs, .false.) - - !--------------------------------------------------! - ! Distribute boundary values to boundary cells ! - !--------------------------------------------------! - - ! Distribute b.c. tags only. - do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .eq. bc) then - - ! Temperature - if(heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) Grid % bnd_cond % type(bc) = WALLFL - end if - end if - - ! Volume of fluid -> still to be worked around - if (Vof % model .eq. VOLUME_OF_FLUID) then - i = Key_Ind('VOF', keys, nks) - if(i > 0) fun % bnd_cond_type(c) = bc_type_tag - i = Key_Ind('VOF_C_ANG', keys, nks) - if(i > 0) fun % bnd_cond_type(c) = bc_type_tag - end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALL - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - - end if ! bnd_color .eq. bc - - end do - - ! Distribute b.c. values - do c = -1, -Grid % n_bnd_cells, -1 - if(Grid % bnd_cond % color(c) .eq. bc) then - - ! For velocity and pressure - i = Key_Ind('U', keys, nks); if(i > 0) u % b(c) = vals(i) - i = Key_Ind('V', keys, nks); if(i > 0) v % b(c) = vals(i) - i = Key_Ind('W', keys, nks); if(i > 0) w % b(c) = vals(i) - i = Key_Ind('P', keys, nks); if(i > 0) p % b(c) = vals(i) - - ! Temperature - if(heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) t % b(c) = vals(i) - i = Key_Ind('Q', keys, nks) - if(i > 0) t % q(c) = vals(i) - end if - - ! Multiphase Flow - if (Vof % model .eq. VOLUME_OF_FLUID) then - i = Key_Ind('VOF', keys, nks) - if(i > 0) fun % b(c) = vals(i) - i = Key_Ind('VOF_C_ANG', keys, nks) - if(i > 0) fun % q(c) = vals(i) - end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) scalar(sc) % b(c) = vals(i) - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) scalar(sc) % q(c) = vals(i) - end do - - ! For turbulence models - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - i = Key_Ind('UU', keys, nks); if(i > 0) uu % b(c) = vals(i) - i = Key_Ind('VV', keys, nks); if(i > 0) vv % b(c) = vals(i) - i = Key_Ind('WW', keys, nks); if(i > 0) ww % b(c) = vals(i) - i = Key_Ind('UV', keys, nks); if(i > 0) uv % b(c) = vals(i) - i = Key_Ind('UW', keys, nks); if(i > 0) uw % b(c) = vals(i) - i = Key_Ind('VW', keys, nks); if(i > 0) vw % b(c) = vals(i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - i = Key_Ind('F22', keys, nks); if(i > 0) f22 % b(c) = vals(i) - end if - end if - - if(Turb % model .eq. K_EPS) then - i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = vals(i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) - Turb % y_plus(c) = 1.1 - if(heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i > 0) t2 % b(c) = vals(i) - end if - end if - - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = vals(i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = vals(i) - i = Key_Ind('ZETA', keys, nks); if(i > 0) zeta % b(c) = vals(i) - i = Key_Ind('F22', keys, nks); if(i > 0) f22 % b(c) = vals(i) - if(heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i > 0) t2 % b(c) = vals(i) - end if - end if - - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - i = Key_Ind('VIS', keys, nks); if(i > 0) vis % b(c) = vals(i) - end if - end if - - end do - - !---------------------------------------------! - ! ! - ! Boundary values are specified in a file ! - ! ! - !---------------------------------------------! - else ! types_file(c_types) == .true. - - call Control_Mod_Read_Strings_On('FILE', name_prof, nvs, .false.) - - call File % Open_For_Reading_Ascii(name_prof(1), fu) - call File % Read_Line(fu) - read(line % tokens(1),*) n_points ! number of points - - !---------------------------------! - ! Allocate memory for profile ! - !---------------------------------! - allocate(prof(n_points, 0:nks)) - - !----------------------------------! - ! Read the entire profile file ! - !----------------------------------! - do m = 1, n_points - call File % Read_Line(fu) - do i = 1, nks - read(line % tokens(i), *) prof(m,i) - end do - end do - close(fu) - - !------------------------! - ! A plane is defined ! - !------------------------! - if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Y' .or. & - keys(1) .eq. 'X' .and. keys(2) .eq. 'Z' .or. & - keys(1) .eq. 'Y' .and. keys(2) .eq. 'Z') then - - ! Set the closest point - do c = -1, -Grid % n_bnd_cells, -1 - - ! Distribute b.c. types - if(Grid % bnd_cond % color(c) .eq. bc) then - - ! For temperature - if(heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q', keys, nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) Grid % bnd_cond % type(bc) = WALLFL - end if - end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALL - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - - end if - - ! Distribute b.c. values - if(Grid % bnd_cond % color(c) .eq. bc) then - - dist_min = HUGE - do m = 1, n_points - - i = Key_Ind('X', keys, nks); prof(m,0) = 0.0; x = prof(m,i) - i = Key_Ind('Y', keys, nks); prof(m,0) = 0.0; y = prof(m,i) - i = Key_Ind('Z', keys, nks); prof(m,0) = 0.0; z = prof(m,i) - - if(keys(1) .eq. 'Y' .and. keys(2) .eq. 'Z') then - dist = Math % Distance( & - y, z, 0.0, & - Grid % yc(c), Grid % zc(c), 0.0) - - else if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Z') then - dist = Math % Distance( & - x, z, 0.0, & - Grid % xc(c), Grid % zc(c), 0.0) - - else if(keys(1) .eq. 'X' .and. keys(2) .eq. 'Y') then - dist = Math % Distance( & - x, y, 0.0, & - Grid % xc(c), Grid % yc(c), 0.0) - - end if - - ! Store closest point in k - if(dist < dist_min) then - dist_min = dist - k = m - end if - - end do - - ! For velocity and pressure - i = Key_Ind('U', keys, nks); if(i > 0) u % b(c) = prof(k,i) - i = Key_Ind('V', keys, nks); if(i > 0) v % b(c) = prof(k,i) - i = Key_Ind('W', keys, nks); if(i > 0) w % b(c) = prof(k,i) - i = Key_Ind('P', keys, nks); if(i > 0) p % b(c) = prof(k,i) - - ! For temperature - if(heat_transfer) then - i = Key_Ind('T', keys, nks) - if(i > 0) t % b(c) = prof(k,i) - i = Key_Ind('Q', keys, nks) - if(i > 0) t % q(c) = prof(k,i) - end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) scalar(sc) % b(c) = prof(k,i) - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) scalar(sc) % q(c) = prof(k,i) - end do - - ! For turbulence models - if(Turb % model .eq. K_EPS) then - i = Key_Ind('KIN', keys, nks); if(i > 0) kin % b(c) = prof(k,i) - i = Key_Ind('EPS', keys, nks); if(i > 0) eps % b(c) = prof(k,i) - if(heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i>0) t2 % b(c) = prof(k,i) - end if - end if - - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - i = Key_Ind('KIN', keys, nks); if(i>0) kin % b(c) = prof(k,i) - i = Key_Ind('EPS', keys, nks); if(i>0) eps % b(c) = prof(k,i) - i = Key_Ind('ZETA', keys, nks); if(i>0) zeta % b(c) = prof(k,i) - i = Key_Ind('F22', keys, nks); if(i>0) f22 % b(c) = prof(k,i) - if(heat_transfer) then - i = Key_Ind('T2', keys, nks); if(i>0) t2 % b(c) = prof(k,i) - end if - end if - - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - i = Key_Ind('VIS', keys, nks); if(i > 0) vis % b(c) = prof(k,i) - end if - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - i = Key_Ind('UU', keys, nks); if(i > 0) uu % b(c) = prof(k,i) - i = Key_Ind('VV', keys, nks); if(i > 0) vv % b(c) = prof(k,i) - i = Key_Ind('WW', keys, nks); if(i > 0) ww % b(c) = prof(k,i) - i = Key_Ind('UV', keys, nks); if(i > 0) uv % b(c) = prof(k,i) - i = Key_Ind('UW', keys, nks); if(i > 0) uw % b(c) = prof(k,i) - i = Key_Ind('VW', keys, nks); if(i > 0) vw % b(c) = prof(k,i) - i = Key_Ind('EPS',keys, nks); if(i > 0) eps % b(c) = prof(k,i) - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - i = Key_Ind('F22', keys, nks); if(i>0) f22 % b(c) = prof(k,i) - end if - end if - end if !end if(Grid % bnd_cond % color(c) .eq. n) - end do !end do c = -1, -Grid % n_bnd_cells, -1 - - !----------------------------! - ! A plane is not defined ! - !----------------------------! - else ! dir .eq. "XPL" ... - - do c = -1, -Grid % n_bnd_cells, -1 - - if(Grid % bnd_cond % color(c) .eq. bc) then - - do m = 1, n_points-1 - here = .false. - - i = Key_Ind(keys(1), keys, nks) - prof(m, 0) = 0.0; - prof(m+1, 0) = 0.0; - x = prof(m,i) - xp = prof(m+1,i) - - ! Compute the weight factors - if( keys(1) .eq. 'X' .and. & - Grid % xc(c) >= x .and. Grid % xc(c) <= xp ) then - wi = ( xp - Grid % xc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Y' .and. & - Grid % yc(c) >= x .and. Grid % yc(c) <= xp ) then - wi = ( xp - Grid % yc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Z' .and. & - Grid % zc(c) >= x .and. Grid % zc(c) <= xp ) then - wi = ( xp - Grid % zc(c) ) / (xp - x) - here = .true. - - ! Beware; for cylindrical coordinates you have "inversion" - else if( (keys(1) .eq. 'RX' .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RY' .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RZ' .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) ) / (xp-x) - here = .true. - - ! Wall distance too - else if( (keys(1) .eq. 'WD' .and. & - Grid % wall_dist(c) >= min(x,xp) .and. & - Grid % wall_dist(c) <= max(x,xp)) ) then - wi = ( max(x,xp) - Grid % wall_dist(c) ) & - / ( max(x,xp) - min(x,xp) ) - here = .true. - end if - - if(here) then - - ! For temperature - if(heat_transfer) then - i = Key_Ind('T',keys,nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) & - Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q',keys,nks) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) & - Grid % bnd_cond % type(bc) = WALLFL - end if - end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALL - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - - end if ! here - end do ! m, points - end if ! bnd_color .eq. bc - - if(Grid % bnd_cond % color(c) .eq. bc) then - - do m = 1, n_points-1 - here = .false. - - i = Key_Ind(keys(1), keys, nks) - prof(m, 0) = 0.0; - prof(m+1, 0) = 0.0; - x = prof(m,i) - xp = prof(m+1,i) - - ! Compute the weight factors - if( keys(1) .eq. 'X' .and. & - Grid % xc(c) >= x .and. Grid % xc(c) <= xp ) then - wi = ( xp - Grid % xc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Y' .and. & - Grid % yc(c) >= x .and. Grid % yc(c) <= xp ) then - wi = ( xp - Grid % yc(c) ) / (xp - x) - here = .true. - else if( keys(1) .eq. 'Z' .and. & - Grid % zc(c) >= x .and. Grid % zc(c) <= xp ) then - wi = ( xp - Grid % zc(c) ) / (xp - x) - here = .true. - - ! Beware; for cylindrical coordinates you have "inversion" - else if( (keys(1) .eq. 'RX' .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % yc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RY' .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % zc(c)**2) ) / (xp-x) - here = .true. - else if( (keys(1) .eq. 'RZ' .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) >= xp .and. & - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) <= x) ) then - wi = ( xp - sqrt(Grid % xc(c)**2 + Grid % yc(c)**2) ) / (xp-x) - here = .true. - - ! Wall distance too - else if( (keys(1) .eq. 'WD' .and. & - Grid % wall_dist(c) >= min(x,xp) .and. & - Grid % wall_dist(c) <= max(x,xp)) ) then - wi = ( max(x,xp) - Grid % wall_dist(c) ) & - / ( max(x,xp) - min(x,xp) ) - here = .true. - end if - - ! Interpolate the profiles - if(here) then - - ! For velocity and pressure - i = Key_Ind('U',keys,nks) - if(i > 0) u % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('V',keys,nks) - if(i > 0) v % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('W',keys,nks) - if(i > 0) w % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - i = Key_Ind('P',keys,nks) - if(i > 0) p % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - ! For temperature - if(heat_transfer) then - i = Key_Ind('T',keys,nks) - if(i > 0) t % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALLFL) t % bnd_cond_type(c) = WALL - if(bc_type_tag .eq. WALLFL) & - Grid % bnd_cond % type(bc) = WALL - end if - i = Key_Ind('Q',keys,nks) - if(i > 0) t % q(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - if(i > 0) then - t % bnd_cond_type(c) = bc_type_tag - if(bc_type_tag .eq. WALL) t % bnd_cond_type(c) = WALLFL - if(bc_type_tag .eq. WALL) & - Grid % bnd_cond % type(bc) = WALLFL - end if - end if - - ! For scalars - do sc = 1, Flow % n_scalars - i = Key_Ind(scalar(sc) % name, keys, nks) - if(i > 0) then - scalar(sc) % b(c)=wi*prof(m,i)+(1.-wi)*prof(m+1,i) - scalar(sc) % bnd_cond_type(c) = WALL - end if - i = Key_Ind(scalar(sc) % flux_name, keys, nks) - if(i > 0) then - scalar(sc) % q(c)=wi*prof(m,i)+(1.-wi)*prof(m+1,i) - scalar(sc) % bnd_cond_type(c) = WALLFL - end if - end do - - ! For turbulence models - if(Turb % model .eq. K_EPS) then - - i = Key_Ind('KIN',keys,nks) - if(i > 0) kin % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('EPS',keys,nks) - if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - if(heat_transfer) then - i = Key_Ind('T2',keys,nks) - if(i > 0) t2 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if - - end if - - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - - i = Key_Ind('KIN',keys,nks) - if(i > 0) kin % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('EPS',keys,nks) - if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('ZETA',keys,nks) - if(i > 0) zeta % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('F22',keys,nks) - if(i > 0) f22 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - if(heat_transfer) then - i = Key_Ind('T2',keys,nks) - if(i > 0) t2 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if - - end if - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - - i = Key_Ind('UU', keys, nks) - if(i > 0) uu % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('VV', keys, nks) - if(i > 0) vv % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('WW', keys, nks) - if(i > 0) ww % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('UV', keys, nks) - if(i > 0) uv % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('UW', keys, nks) - if(i > 0) uw % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('VW', keys, nks) - if(i > 0) vw % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - i = Key_Ind('EPS', keys, nks) - if(i > 0) eps % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - i = Key_Ind('F22', keys, nks) - if(i > 0)f22 % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if - end if - - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - i = Key_Ind('VIS',keys,nks) - if(i > 0) vis % b(c) = wi*prof(m,i) + (1.-wi)*prof(m+1,i) - end if - - end if ! (here) - end do ! m = 1, n_points-1 - end if - end do ! c = -1, -Grid % n_bnd_cells, -1 - end if ! plane is defined? - close(fu) - - !-----------------------------! - ! Free memory for profile ! - !-----------------------------! - deallocate(prof) - - end if ! boundary defined in a file - end do - - end do - - !-----------------------------------! - ! ! - ! Read data on synthetic eddies ! - ! ! - !-----------------------------------! - turb_planes % n_planes = 0 - do bc = 1, Grid % n_bnd_cond ! imagine there are as many eddies as bcs - call Control_Mod_Position_At_Two_Keys('SYNTHETIC_EDDIES', & - Grid % bnd_cond % name(bc), & - found, & - .false.) - if(found) then - turb_planes % n_planes = turb_planes % n_planes + 1 - call Control_Mod_Read_Int_Item_On ('NUMBER_OF_EDDIES', 24, edd_n, .false.) - call Control_Mod_Read_Real_Item_On('MAX_EDDY_RADIUS', .2, edd_r, .false.) - call Control_Mod_Read_Real_Item_On('EDDY_INTENSITY', .1, edd_i, .false.) - call Eddies_Mod_Allocate(turb_planes % plane(turb_planes % n_planes), & - edd_n, & - edd_r, & - edd_i, & - Flow, & - Grid % bnd_cond % name(bc)) - end if - end do - if(turb_planes % n_planes > 0 .and. this_proc < 2) then - print *, '# Found ', turb_planes % n_planes, ' turbulent planes' - end if - - !---------------------------------------! - ! ! - ! ! - ! Copy all "b" values to "n" values ! - ! ! - ! ! - !---------------------------------------! - do c = -1, -Grid % n_bnd_cells, -1 - - u % n(c) = u % b(c) - v % n(c) = v % b(c) - w % n(c) = w % b(c) - p % n(c) = p % b(c) - - if(heat_transfer) then - t % n(c) = t % b(c) - end if - - if (Vof % model .eq. VOLUME_OF_FLUID) then - fun % n(c) = fun % b(c) - end if - - do sc = 1, Flow % n_scalars - scalar(sc) % n(c) = scalar(sc) % b(c) - end do - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC .or. & - Turb % model .eq. RSM_HANJALIC_JAKIRLIC) then - uu % n(c) = uu % b(c) - vv % n(c) = vv % b(c) - ww % n(c) = ww % b(c) - uv % n(c) = uv % b(c) - uw % n(c) = uw % b(c) - vw % n(c) = vw % b(c) - eps % n(c) = eps % b(c) - - if(Turb % model .eq. RSM_MANCEAU_HANJALIC) then - f22 % n(c) = f22 % b(c) - end if - end if - - if(Turb % model .eq. K_EPS) then - kin % n(c) = kin % b(c) - eps % n(c) = eps % b(c) - if(heat_transfer) then - t2 % n(c) = t2 % b(c) - end if - end if - - if(Turb % model .eq. K_EPS_ZETA_F .or. & - Turb % model .eq. HYBRID_LES_RANS) then - kin % n(c) = kin % b(c) - eps % n(c) = eps % b(c) - zeta % n(c) = zeta % b(c) - f22 % n(c) = f22 % b(c) - if(heat_transfer) then - t2 % n(c) = t2 % b(c) - end if - end if - - if(Turb % model .eq. SPALART_ALLMARAS .or. & - Turb % model .eq. DES_SPALART) then - vis % n(c) = vis % b(c) - end if - - end do ! through boundary cells - - !------------------------------! - ! Find the near-wall cells ! - !------------------------------! - Grid % cell_near_wall = .false. - - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - - if(c2 < 0) then - if(Grid_Mod_Bnd_Cond_Type(Grid,c2) .eq. WALL .or. & - Grid_Mod_Bnd_Cond_Type(Grid,c2) .eq. WALLFL) then - Grid % cell_near_wall(c1) = .true. - end if - end if - - end do ! faces - - call Grid_Mod_Exchange_Cells_Log(Grid, Grid % cell_near_wall) - - end subroutine diff --git a/Tests/Laminar/Membrane/2_Domains/User_Mod/To_Buffer.f90 b/Tests/Laminar/Membrane/2_Domains/User_Mod/To_Buffer.f90 index 35a5b3dec..e12e8f6d0 100644 --- a/Tests/Laminar/Membrane/2_Domains/User_Mod/To_Buffer.f90 +++ b/Tests/Laminar/Membrane/2_Domains/User_Mod/To_Buffer.f90 @@ -62,8 +62,8 @@ subroutine Interface_Mod_To_Buffer(inter, var1, var2, v, boundary) end do ! Here we exchange (global sum) of phi_1 and phi_2 - call Comm_Mod_Global_Sum_Real_Array(n_tot, inter % phi_1(1:n_tot,v)) - call Comm_Mod_Global_Sum_Real_Array(n_tot, inter % phi_2(1:n_tot,v)) + call Global % Sum_Real_Array(n_tot, inter % phi_1(1:n_tot,v)) + call Global % Sum_Real_Array(n_tot, inter % phi_2(1:n_tot,v)) end if diff --git a/Tests/Laminar/Membrane/2_Domains/control.0 b/Tests/Laminar/Membrane/2_Domains/control.0 index 1f85a251c..1ae50ffde 100644 --- a/Tests/Laminar/Membrane/2_Domains/control.0 +++ b/Tests/Laminar/Membrane/2_Domains/control.0 @@ -1,13 +1,13 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 - NUMBER_OF_TIME_STEPS 48000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 4800 + NUMBER_OF_TIME_STEPS 48000 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 4800 - TIME_STEP 0.0025 + TIME_STEP 0.0025 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION upper_dom lower_dom - BOUNDARY_CONDITIONS bottom_wall top_wall + INTERFACE_CONDITION upper_dom lower_dom + BOUNDARY_CONDITIONS bottom_wall top_wall diff --git a/Tests/Laminar/Membrane/2_Domains/control.1 b/Tests/Laminar/Membrane/2_Domains/control.1 index 8aabcf8eb..d4e023e96 100644 --- a/Tests/Laminar/Membrane/2_Domains/control.1 +++ b/Tests/Laminar/Membrane/2_Domains/control.1 @@ -1,55 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME upper_dom - HEAT_TRANSFER yes + PROBLEM_NAME upper_dom + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 120 - RESULTS_SAVE_INTERVAL 12 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 120 + RESULTS_SAVE_INTERVAL 12 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.025 + TIME_STEP 0.025 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.05 0.05 0.005 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.05 0.05 0.005 - POINT_FOR_MONITORING_PLANES 0.05 0.05 0.005 + POINT_FOR_MONITORING_PLANES 0.05 0.05 0.005 #----------------- # Physical models #----------------- - NUMBER_OF_SCALARS 1 + NUMBER_OF_SCALARS 1 - MASS_DENSITY 1000.0 - THERMAL_CONDUCTIVITY 0.6680 - DYNAMIC_VISCOSITY 0.355E-3 - HEAT_CAPACITY 4198.0 - SCALARS_DIFFUSIVITY 1.99E-09 + MASS_DENSITY 1000.0 + THERMAL_CONDUCTIVITY 0.6680 + DYNAMIC_VISCOSITY 0.355E-3 + HEAT_CAPACITY 4198.0 + SCALARS_DIFFUSIVITY 1.99E-09 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM upwind + ADVECTION_SCHEME_FOR_MOMENTUM upwind #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Membrane/2_Domains/control.2 b/Tests/Laminar/Membrane/2_Domains/control.2 index e0702f255..48173641a 100644 --- a/Tests/Laminar/Membrane/2_Domains/control.2 +++ b/Tests/Laminar/Membrane/2_Domains/control.2 @@ -1,58 +1,57 @@ #---------- # Prologue #---------- - PROBLEM_NAME lower_dom - HEAT_TRANSFER yes + PROBLEM_NAME lower_dom + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 120 - RESULTS_SAVE_INTERVAL 12 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 120 + RESULTS_SAVE_INTERVAL 12 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.025 + TIME_STEP 0.025 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.05 0.05 -0.01 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.05 0.05 -0.01 - POINT_FOR_MONITORING_PLANES 0.05 0.05 -0.01 + POINT_FOR_MONITORING_PLANES 0.05 0.05 -0.01 #----------------- # Physical models #----------------- - NUMBER_OF_SCALARS 1 + NUMBER_OF_SCALARS 1 - MASS_DENSITY 1.2 - THERMAL_CONDUCTIVITY 0.0278 - DYNAMIC_VISCOSITY 17.935e-6 - HEAT_CAPACITY 1007.0 - SCALARS_DIFFUSIVITY 3.5E-5 + MASS_DENSITY 1.2 + THERMAL_CONDUCTIVITY 0.0278 + DYNAMIC_VISCOSITY 17.935e-6 + HEAT_CAPACITY 1007.0 + SCALARS_DIFFUSIVITY 3.5E-5 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_SCALARS 1.0 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 1.0 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_SCALAR 1.0 - SIMPLE_UNDERRELAXATION_FOR_TEMPERATURE 1.0 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM upwind + ADVECTION_SCHEME_FOR_MOMENTUM upwind #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Membrane/Spacers/Concave/control b/Tests/Laminar/Membrane/Spacers/Concave/control index 0268fcb81..2fa3e46fd 100644 --- a/Tests/Laminar/Membrane/Spacers/Concave/control +++ b/Tests/Laminar/Membrane/Spacers/Concave/control @@ -11,37 +11,37 @@ #----------------- # Physical models #----------------- - MASS_DENSITY 1.0e+3 - DYNAMIC_VISCOSITY 1.0e-3 - THERMAL_CONDUCTIVITY 0.6 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0e+3 + DYNAMIC_VISCOSITY 1.0e-3 + THERMAL_CONDUCTIVITY 0.6 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none - POINT_FOR_MONITORING_PLANES 0.0125 0.0125 0.075 - PRESSURE_DROPS 30.0 30.0 0.0 - MASS_FLOW_RATES 0.025 0.025 0.0 + POINT_FOR_MONITORING_PLANES 0.0125 0.0125 0.075 + PRESSURE_DROPS 30.0 30.0 0.0 + MASS_FLOW_RATES 0.025 0.025 0.0 #------------------ # Numerical models #------------------ - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION bottom - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 - - BOUNDARY_CONDITION top - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20 - - BOUNDARY_CONDITION spacer_walls - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0.0 + BOUNDARY_CONDITION bottom + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 + + BOUNDARY_CONDITION top + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20 + + BOUNDARY_CONDITION spacer_walls + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0.0 diff --git a/Tests/Laminar/Membrane/Spacers/Parallelogram/control b/Tests/Laminar/Membrane/Spacers/Parallelogram/control index 9dc1e42ff..17e968255 100644 --- a/Tests/Laminar/Membrane/Spacers/Parallelogram/control +++ b/Tests/Laminar/Membrane/Spacers/Parallelogram/control @@ -11,37 +11,37 @@ #----------------- # Physical models #----------------- - MASS_DENSITY 1.0e+3 - DYNAMIC_VISCOSITY 1.0e-3 - THERMAL_CONDUCTIVITY 0.6 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0e+3 + DYNAMIC_VISCOSITY 1.0e-3 + THERMAL_CONDUCTIVITY 0.6 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none - POINT_FOR_MONITORING_PLANES 0.0125 0.0125 0.075 - PRESSURE_DROPS 30.0 30.0 0.0 - MASS_FLOW_RATES 0.025 0.025 0.0 + POINT_FOR_MONITORING_PLANES 0.0125 0.0125 0.075 + PRESSURE_DROPS 30.0 30.0 0.0 + MASS_FLOW_RATES 0.025 0.025 0.0 #------------------ # Numerical models #------------------ - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION bottom - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 - - BOUNDARY_CONDITION top - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20 - - BOUNDARY_CONDITION spacer_walls - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0.0 + BOUNDARY_CONDITION bottom + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 + + BOUNDARY_CONDITION top + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20 + + BOUNDARY_CONDITION spacer_walls + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0.0 diff --git a/Tests/Laminar/Membrane/Spacers/Teardrop/control b/Tests/Laminar/Membrane/Spacers/Teardrop/control index eae37317f..6594df558 100644 --- a/Tests/Laminar/Membrane/Spacers/Teardrop/control +++ b/Tests/Laminar/Membrane/Spacers/Teardrop/control @@ -13,38 +13,38 @@ #----------------- # Physical models #----------------- - MASS_DENSITY 1.0e+3 - DYNAMIC_VISCOSITY 1.0e-3 - THERMAL_CONDUCTIVITY 0.6 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0e+3 + DYNAMIC_VISCOSITY 1.0e-3 + THERMAL_CONDUCTIVITY 0.6 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none - POINT_FOR_MONITORING_PLANES 0.0125 0.0125 0.075 - PRESSURE_DROPS 30.0 30.0 0.0 - MASS_FLOW_RATES 0.025 0.025 0.0 + POINT_FOR_MONITORING_PLANES 0.0125 0.0125 0.075 + PRESSURE_DROPS 30.0 30.0 0.0 + MASS_FLOW_RATES 0.025 0.025 0.0 #------------------ # Numerical models #------------------ - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 20 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 20 #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION bottom - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 - - BOUNDARY_CONDITION top - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 20 - - BOUNDARY_CONDITION spacer_walls - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0.0 + BOUNDARY_CONDITION bottom + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 + + BOUNDARY_CONDITION top + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 20 + + BOUNDARY_CONDITION spacer_walls + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0.0 diff --git a/Tests/Laminar/Membrane/Spiral/control.0 b/Tests/Laminar/Membrane/Spiral/control.0 index a0f300ae7..9be02fa19 100644 --- a/Tests/Laminar/Membrane/Spiral/control.0 +++ b/Tests/Laminar/Membrane/Spiral/control.0 @@ -1,13 +1,13 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 - NUMBER_OF_TIME_STEPS 120 - RESULTS_SAVE_INTERVAL 12 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 120 + RESULTS_SAVE_INTERVAL 12 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.1 + TIME_STEP 0.1 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION spiral_cold spiral_hot - BOUNDARY_CONDITIONS membrane membrane + INTERFACE_CONDITION spiral_cold spiral_hot + BOUNDARY_CONDITIONS membrane membrane diff --git a/Tests/Laminar/Membrane/Spiral/control.1 b/Tests/Laminar/Membrane/Spiral/control.1 index 7b56e52ee..e7c71606f 100644 --- a/Tests/Laminar/Membrane/Spiral/control.1 +++ b/Tests/Laminar/Membrane/Spiral/control.1 @@ -1,55 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME spiral_cold - HEAT_TRANSFER yes + PROBLEM_NAME spiral_cold + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 7200 - RESULTS_SAVE_INTERVAL 240 - BACKUP_SAVE_INTERVAL 3600 + NUMBER_OF_TIME_STEPS 7200 + RESULTS_SAVE_INTERVAL 240 + BACKUP_SAVE_INTERVAL 3600 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.05 0.05 0.005 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.05 0.05 0.005 - POINT_FOR_MONITORING_PLANES 0.05 0.05 0.005 + POINT_FOR_MONITORING_PLANES 0.05 0.05 0.005 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.02 - DYNAMIC_VISCOSITY 0.01 - HEAT_CAPACITY 1.0 - SCALARS_DIFFUSIVITY 0.001 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.02 + DYNAMIC_VISCOSITY 0.01 + HEAT_CAPACITY 1.0 + SCALARS_DIFFUSIVITY 0.001 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Membrane/Spiral/control.2 b/Tests/Laminar/Membrane/Spiral/control.2 index a94d2ce85..13d917531 100644 --- a/Tests/Laminar/Membrane/Spiral/control.2 +++ b/Tests/Laminar/Membrane/Spiral/control.2 @@ -1,55 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME spiral_hot - HEAT_TRANSFER yes + PROBLEM_NAME spiral_hot + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 7200 - RESULTS_SAVE_INTERVAL 240 - BACKUP_SAVE_INTERVAL 3600 + NUMBER_OF_TIME_STEPS 7200 + RESULTS_SAVE_INTERVAL 240 + BACKUP_SAVE_INTERVAL 3600 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.05 0.05 0.005 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.05 0.05 0.005 - POINT_FOR_MONITORING_PLANES 0.05 0.05 0.005 + POINT_FOR_MONITORING_PLANES 0.05 0.05 0.005 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.02 - DYNAMIC_VISCOSITY 0.01 - HEAT_CAPACITY 1.0 - SCALARS_DIFFUSIVITY 0.001 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.02 + DYNAMIC_VISCOSITY 0.01 + HEAT_CAPACITY 1.0 + SCALARS_DIFFUSIVITY 0.001 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 #-------------------- # Initial conditions @@ -58,7 +58,7 @@ VARIABLES u v w t VALUES 0.0 0.0 0.0 5.0 - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions diff --git a/Tests/Laminar/Membrane/Spiral_Poly/control.0 b/Tests/Laminar/Membrane/Spiral_Poly/control.0 index 8def3553a..be651f2ea 100644 --- a/Tests/Laminar/Membrane/Spiral_Poly/control.0 +++ b/Tests/Laminar/Membrane/Spiral_Poly/control.0 @@ -1,13 +1,13 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 - NUMBER_OF_TIME_STEPS 2400 - RESULTS_SAVE_INTERVAL 24 - BACKUP_SAVE_INTERVAL 2400 + NUMBER_OF_TIME_STEPS 2400 + RESULTS_SAVE_INTERVAL 24 + BACKUP_SAVE_INTERVAL 2400 - TIME_STEP 0.1 + TIME_STEP 0.1 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION spiral_cold_dual spiral_hot_dual - BOUNDARY_CONDITIONS membrane membrane + INTERFACE_CONDITION spiral_cold_dual spiral_hot_dual + BOUNDARY_CONDITIONS membrane membrane diff --git a/Tests/Laminar/Membrane/Spiral_Poly/control.1 b/Tests/Laminar/Membrane/Spiral_Poly/control.1 index a714e6b22..b938dd42c 100644 --- a/Tests/Laminar/Membrane/Spiral_Poly/control.1 +++ b/Tests/Laminar/Membrane/Spiral_Poly/control.1 @@ -1,55 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME spiral_cold_dual - HEAT_TRANSFER yes + PROBLEM_NAME spiral_cold_dual + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 7200 - RESULTS_SAVE_INTERVAL 240 - BACKUP_SAVE_INTERVAL 3600 + NUMBER_OF_TIME_STEPS 7200 + RESULTS_SAVE_INTERVAL 240 + BACKUP_SAVE_INTERVAL 3600 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.005 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.005 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.005 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.005 #----------------- # Physical models #----------------- - MASS_DENSITY 100.0 - THERMAL_CONDUCTIVITY 0.002 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 420.0 - SCALARS_DIFFUSIVITY 0.001 + MASS_DENSITY 100.0 + THERMAL_CONDUCTIVITY 0.002 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 420.0 + SCALARS_DIFFUSIVITY 0.001 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 #-------------------- # Initial conditions @@ -58,7 +58,7 @@ VARIABLES u v w t VALUES 0.0 0.0 0.0 5.0 - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions diff --git a/Tests/Laminar/Membrane/Spiral_Poly/control.2 b/Tests/Laminar/Membrane/Spiral_Poly/control.2 index 12656aa87..643cc16a8 100644 --- a/Tests/Laminar/Membrane/Spiral_Poly/control.2 +++ b/Tests/Laminar/Membrane/Spiral_Poly/control.2 @@ -1,55 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME spiral_hot_dual - HEAT_TRANSFER yes + PROBLEM_NAME spiral_hot_dual + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 7200 - RESULTS_SAVE_INTERVAL 240 - BACKUP_SAVE_INTERVAL 3600 + NUMBER_OF_TIME_STEPS 7200 + RESULTS_SAVE_INTERVAL 240 + BACKUP_SAVE_INTERVAL 3600 - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.005 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.005 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.005 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.005 #----------------- # Physical models #----------------- - MASS_DENSITY 100.0 - THERMAL_CONDUCTIVITY 0.002 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 420.0 - SCALARS_DIFFUSIVITY 0.001 + MASS_DENSITY 100.0 + THERMAL_CONDUCTIVITY 0.002 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 420.0 + SCALARS_DIFFUSIVITY 0.001 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 300 #-------------------- # Initial conditions @@ -58,7 +58,7 @@ VARIABLES u v w t VALUES 0.0 0.0 0.0 5.0 - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions diff --git a/Tests/Laminar/Module/control b/Tests/Laminar/Module/control index 9b86beedf..4bd638cf2 100644 --- a/Tests/Laminar/Module/control +++ b/Tests/Laminar/Module/control @@ -1,54 +1,53 @@ #---------- # Prologue #--------- - PROBLEM_NAME module_dual - HEAT_TRANSFER yes + PROBLEM_NAME module_dual + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 - TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.01 # LOAD_BACKUP_NAME backstep_orthogonal-ts000001.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.2 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-4 - THERMAL_CONDUCTIVITY 1.0e-4 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-4 + THERMAL_CONDUCTIVITY 1.0e-4 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Laminar/Module/divide.scr b/Tests/Laminar/Module/divide.scr new file mode 100644 index 000000000..24c007bec --- /dev/null +++ b/Tests/Laminar/Module/divide.scr @@ -0,0 +1,2 @@ +module_dual +8 diff --git a/Tests/Les/Barc/User_Mod/Beginning_Of_Simulation.f90 b/Tests/Les/Barc/User_Mod/Beginning_Of_Simulation.f90 index f04d60f6a..f9cb19880 100644 --- a/Tests/Les/Barc/User_Mod/Beginning_Of_Simulation.f90 +++ b/Tests/Les/Barc/User_Mod/Beginning_Of_Simulation.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & - curr_dt, time) + subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of simulation. ! !------------------------------------------------------------------------------! @@ -10,14 +9,12 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid !==============================================================================! ! Make sure you compiled it - if(this_proc < 2) print *, '# In User_Mod_Beginning_Of_Simulation' + if(First_Proc()) print *, '# In User_Mod_Beginning_Of_Simulation' ! Take alias Grid => Flow % pnt_grid @@ -35,7 +32,7 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & tensor_comp = 6, & tensor_name = 'Cell Inertia') - call Comm_Mod_End + call Global % End_Parallel stop end subroutine diff --git a/Tests/Les/Barc/control b/Tests/Les/Barc/control index b70390412..8803bccee 100644 --- a/Tests/Les/Barc/control +++ b/Tests/Les/Barc/control @@ -1,89 +1,86 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME yvarc_15c + PROBLEM_NAME yvarc_15c - STARTING_TIME_STEP_FOR_TURB_STATISTICS 100000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 100000 #--------------- # Time stepping #--------------- - TIME_STEP 0.002 - NUMBER_OF_TIME_STEPS 6000000 - RESULTS_SAVE_INTERVAL 100 - BACKUP_SAVE_INTERVAL 1000 - - WALL_TIME_MAX_HOURS 1000000 - - ###SAVE_INITIAL_CONDITION no + TIME_STEP 0.002 + NUMBER_OF_TIME_STEPS 6000000 + RESULTS_SAVE_INTERVAL 100 + BACKUP_SAVE_INTERVAL 1000 + + WALL_TIME_MAX_HOURS 1000000 #--------------------- # Physical properties #--------------------- - DYNAMIC_VISCOSITY 3.3333333e-4 - MASS_DENSITY 1 + DYNAMIC_VISCOSITY 3.3333333e-4 + MASS_DENSITY 1 - TURBULENCE_MODEL les_dynamic + TURBULENCE_MODEL les_dynamic - POINT_FOR_MONITORING_PLANES -5.0 -0.5 2.5 + POINT_FOR_MONITORING_PLANES -5.0 -0.5 2.5 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.95 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 - MIN_SIMPLE_ITERATIONS 2 - MAX_SIMPLE_ITERATIONS 25 - - TIME_INTEGRATION_SCHEME parabolic - -ADVECTION_SCHEME_FOR_MOMENTUM smart -### BLENDING_COEFFICIENT_FOR_MOMENTUM 0.8 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.95 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 + MIN_SIMPLE_ITERATIONS 2 + MAX_SIMPLE_ITERATIONS 25 + + TIME_INTEGRATION_SCHEME parabolic + + ADVECTION_SCHEME_FOR_MOMENTUM smart + # BLENDING_COEFFICIENT_FOR_MOMENTUM 0.8 #-------------------------- # Linear solver parameters #-------------------------- - TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 - TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 - - TOLERANCE_FOR_PRESSURE_SOLVER 1.0e-6 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 25 + TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 + TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 + + TOLERANCE_FOR_PRESSURE_SOLVER 1.0e-6 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 25 #------------------- # Initial conditions #------------------- - - INITIAL_CONDITION - VARIABLES u v w - VALUES 1.0 0.0 0.0 + INITIAL_CONDITION + VARIABLES u v w + VALUES 1.0 0.0 0.0 #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION IN - TYPE inflow - VARIABLES u v w - VALUES 1.0 0.0 0.0 - - BOUNDARY_CONDITION OUT - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 - - BOUNDARY_CONDITION WALL - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 - - BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w - VALUES 1.0 0.0 0.0 - - BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w - VALUES 1.0 0.0 0.0 + BOUNDARY_CONDITION IN + TYPE inflow + VARIABLES u v w + VALUES 1.0 0.0 0.0 + + BOUNDARY_CONDITION OUT + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 + + BOUNDARY_CONDITION WALL + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 + + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w + VALUES 1.0 0.0 0.0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w + VALUES 1.0 0.0 0.0 diff --git a/Tests/Les/Channel_Re_Tau_180/Long_Domain/control b/Tests/Les/Channel_Re_Tau_180/Long_Domain/control index 7d35d8692..c54251003 100644 --- a/Tests/Les/Channel_Re_Tau_180/Long_Domain/control +++ b/Tests/Les/Channel_Re_Tau_180/Long_Domain/control @@ -1,58 +1,57 @@ -Prologue +#---------- +# Prologue +#---------- + PROBLEM_NAME chan - PROBLEM_NAME chan + HEAT_TRANSFER yes - HEAT_TRANSFER yes + TIME_STEP 0.02 + NUMBER_OF_TIME_STEPS 36000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 24000 - TIME_STEP 0.02 - NUMBER_OF_TIME_STEPS 36000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 24000 - - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 1800 - -# LOAD_BACKUP_NAME chan-ts012985.backup + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 1800 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 4.70e-4 - DYNAMIC_VISCOSITY 3.33333e-4 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 4.70e-4 + DYNAMIC_VISCOSITY 3.33333e-4 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL les_dynamic + TURBULENCE_MODEL les_dynamic #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + ADVECTION_SCHEME_FOR_MOMENTUM central # BLENDING_COEFFICIENT_FOR_MOMENTUM 0.0 - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_ENERGY smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/End_Of_Time_Step.f90 b/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/End_Of_Time_Step.f90 index ef7159d1b..189727d97 100644 --- a/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/End_Of_Time_Step.f90 @@ -1,15 +1,8 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Grid_Mod, only: Grid_Type - use Field_Mod - use Var_Mod, only: Var_Type - use Const_Mod, only: PI - use Comm_Mod, only: Comm_Mod_Global_Max_Real, this_proc !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -17,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! 1st t.s. statistics turbulence integer, intent(in) :: n_stat_p ! 1st t.s. statistics particles - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Var_Type), pointer :: u, v, w, t type(Grid_Type), pointer :: Grid @@ -31,10 +22,10 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !==============================================================================! ! If not time for disturbing the velocity field, return - if(mod(n, 120) .ne. 0) return + if(mod(Time % Curr_Dt(), 120) .ne. 0) return ! If too late to disturb, get out too - if(n > 1200) return + if(Time % Curr_Dt() > 1200) return ! Take aliases Grid => Flow % pnt_grid @@ -44,7 +35,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & t => Flow % t ! Print a message - if(this_proc < 2) then + if(First_Proc()) then print *, '# Superimposing random eddies on top of velocity field!' end if @@ -140,7 +131,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & vmax = max(vmax, abs(v % n(c))) vmax = max(vmax, abs(w % n(c))) end do - call Comm_Mod_Global_Max_Real(vmax) + call Global % Max_Real(vmax) do c = 1, Grid % n_cells v % n(c) = v % n(c) / vmax / 5.0 v % o(c) = v % o(c) / vmax / 5.0 diff --git a/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/Save_Results.f90 b/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/Save_Results.f90 index edff606de..edc34aaa8 100644 --- a/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/Save_Results.f90 +++ b/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/User_Mod/Save_Results.f90 @@ -1,18 +1,10 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! ! ! ! The results are then writen in files name_res.dat and name_res_plus.dat ! -!------------------------------------------------------------------------------! - use Const_Mod ! constants - use Comm_Mod ! parallel stuff - use Grid_Mod, only: Grid_Type - use Field_Mod - use Bulk_Mod, only: Bulk_Type - use Var_Mod, only: Var_Type - use Turb_Mod !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -20,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Var_Type), pointer :: u, v, w, t @@ -40,7 +31,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -49,10 +40,10 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Flow % Alias_Energy (t) ! Read constant (defualt) values of physical properties - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Mass_Density (dens_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) call File % Set_Name(coord_name, extension='.1d') @@ -60,16 +51,20 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call File % Set_Name(coord_name, extension='.1d') !call File % Set_Name(0, res_name, "-res.dat") - call File % Set_Name(res_name, time_step=ts, extension='-res.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + extension = '-res.dat') !call File % Set_Name(0, res_name_plus, "-res-plus.dat") - call File % Set_Name(res_name_plus, time_step=ts, extension='-res-plus.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + extension = '-res-plus.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -166,31 +161,31 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uw_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p (pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p (pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -222,7 +217,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) / dens_const) end do if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if return @@ -237,12 +232,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux > 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if do s = 1, Grid % n_faces @@ -260,11 +255,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -417,6 +412,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/control b/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/control index 8ac4be04b..306a97a2c 100644 --- a/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/control +++ b/Tests/Les/Channel_Re_Tau_180/Periodic_Domain/control @@ -1,60 +1,58 @@ -Prologue +#---------- +# Prologue +#---------- + PROBLEM_NAME chan + HEAT_TRANSFER yes - PROBLEM_NAME chan + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 18000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 12000 - HEAT_TRANSFER yes - - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 18000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 12000 - - RESULTS_SAVE_INTERVAL 1800 - BACKUP_SAVE_INTERVAL 1800 - -# LOAD_BACKUP_NAME chan-ts012985.backup + RESULTS_SAVE_INTERVAL 1800 + BACKUP_SAVE_INTERVAL 1800 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 4.70e-4 - DYNAMIC_VISCOSITY 3.33333e-4 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 4.70e-4 + DYNAMIC_VISCOSITY 3.33333e-4 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL les_dynamic + TURBULENCE_MODEL les_dynamic - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 7.28 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 7.28 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_MOMENTUM central + ADVECTION_SCHEME_FOR_ENERGY smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Les/Channel_Re_Tau_180/User_Mod/Save_Results.f90 b/Tests/Les/Channel_Re_Tau_180/User_Mod/Save_Results.f90 index 40f50b7c1..f4f6bacdd 100644 --- a/Tests/Les/Channel_Re_Tau_180/User_Mod/Save_Results.f90 +++ b/Tests/Les/Channel_Re_Tau_180/User_Mod/Save_Results.f90 @@ -1,20 +1,11 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results for paerticles in homogeneous directions. ! ! ! ! The results are then writen in files swarm_name_res.dat and ! ! swarm_name_res_plus.dat ! -!------------------------------------------------------------------------------! - use Const_Mod ! constants - use Comm_Mod ! parallel stuff - use Grid_Mod, only: Grid_Type - use Field_Mod - use Bulk_Mod, only: Bulk_Type - use Var_Mod, only: Var_Type - use Turb_Mod - use Swarm_Mod !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -22,7 +13,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Var_Type), pointer :: u, v, w, t @@ -74,7 +64,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -201,16 +191,16 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count2(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Int(n_count2(pl)) + call Global % Sum_Real(wall_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) counter2 = counter2 + n_count2(pl) end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 ! Background Flow @@ -337,6 +327,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(store) - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Swarm.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Swarm.f90.' end subroutine diff --git a/Tests/Les/Forrest/User_Mod/Beginning_Of_Time_Step.f90 b/Tests/Les/Forrest/User_Mod/Beginning_Of_Time_Step.f90 index 249f06f3e..1a4600fd1 100644 --- a/Tests/Les/Forrest/User_Mod/Beginning_Of_Time_Step.f90 +++ b/Tests/Les/Forrest/User_Mod/Beginning_Of_Time_Step.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, & - curr_dt, time) + subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -10,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi @@ -29,7 +26,7 @@ subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, & c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) if(c2 < 0) then - if(Grid % Bnd_Cond_Name(c2) .eq. 'TOP') then + if(Grid % Bnd_Cond_Name_At_Cell(c2) .eq. 'TOP') then u % n(c2) = u % n(c1) v % n(c2) = v % n(c1) w % n(c2) = 0.0 diff --git a/Tests/Les/Forrest/User_Mod/End_Of_Time_Step.f90 b/Tests/Les/Forrest/User_Mod/End_Of_Time_Step.f90 index 37badb3dd..79a694406 100644 --- a/Tests/Les/Forrest/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Les/Forrest/User_Mod/End_Of_Time_Step.f90 @@ -1,15 +1,8 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Grid_Mod, only: Grid_Type - use Field_Mod - use Var_Mod, only: Var_Type - use Const_Mod, only: PI - use Comm_Mod, only: Comm_Mod_Global_Max_Real, this_proc !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -17,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! 1st t.s. statistics turbulence integer, intent(in) :: n_stat_p ! 1st t.s. statistics particles - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Var_Type), pointer :: u, v, w, t type(Grid_Type), pointer :: Grid @@ -31,10 +22,10 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !==============================================================================! ! If not time for disturbing the velocity field, return - if(mod(n, 120) .ne. 0) return + if(mod(Time % Curr_Dt(), 120) .ne. 0) return ! If too late to disturb, get out too - if(n > 1200) return + if(Time % Curr_Dt() > 1200) return ! Take aliases Grid => Flow % pnt_grid @@ -44,7 +35,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & t => Flow % t ! Print a message - if(this_proc < 2) then + if(First_Proc()) then print *, '# Superimposing random eddies on top of velocity field!' end if @@ -140,7 +131,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & vmax = max(vmax, abs(v % n(c))) vmax = max(vmax, abs(w % n(c))) end do - call Comm_Mod_Global_Max_Real(vmax) + call Global % Max_Real(vmax) do c = 1, Grid % n_cells v % n(c) = v % n(c) / vmax / 5.0 v % o(c) = v % o(c) / vmax / 5.0 diff --git a/Tests/Les/Forrest/User_Mod/Save_Results.f90 b/Tests/Les/Forrest/User_Mod/Save_Results.f90 index 19e80c204..488098969 100644 --- a/Tests/Les/Forrest/User_Mod/Save_Results.f90 +++ b/Tests/Les/Forrest/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -33,13 +32,13 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return if(.not. Turb % statistics) return - call Control_Mod_Read_Int_Item('STARTING_TIME_STEP_FOR_TURB_STATISTICS', & + call Control % Read_Int_Item('STARTING_TIME_STEP_FOR_TURB_STATISTICS', & HUGE_INT, n_stat, .false.) - if(ts < n_stat) return + if(Time % Curr_Dt() < n_stat) return h_ref = 20.0 @@ -50,22 +49,22 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Flow % Alias_Energy (t) ! Take constant physical properties - call Control_Mod_Dynamic_Viscosity (visc_const) + call Control % Dynamic_Viscosity(visc_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') ! Set file names for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -181,36 +180,36 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p (pl)) - call Comm_Mod_Global_Sum_Real(vv_p (pl)) - call Comm_Mod_Global_Sum_Real(ww_p (pl)) - call Comm_Mod_Global_Sum_Real(uw_p (pl)) - call Comm_Mod_Global_Sum_Real(uw_mod_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p (pl)) - call Comm_Mod_Global_Sum_Real(eps_p (pl)) - call Comm_Mod_Global_Sum_Real(lai_p (pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(uu_p (pl)) + call Global % Sum_Real(vv_p (pl)) + call Global % Sum_Real(ww_p (pl)) + call Global % Sum_Real(uw_p (pl)) + call Global % Sum_Real(uw_mod_p(pl)) + call Global % Sum_Real(kin_p (pl)) + call Global % Sum_Real(eps_p (pl)) + call Global % Sum_Real(lai_p (pl)) + call Global % Sum_Real(y_plus_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p (pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p (pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -338,6 +337,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) close(fu) - if(this_proc < 2) print '(a)', ' # Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print '(a)', ' # Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Les/Forrest/control b/Tests/Les/Forrest/control index 7d630c051..100902c0a 100644 --- a/Tests/Les/Forrest/control +++ b/Tests/Les/Forrest/control @@ -1,35 +1,33 @@ #---------- # Prologue #---------- - PROBLEM_NAME domain - HEAT_TRANSFER no + PROBLEM_NAME domain + HEAT_TRANSFER no - TIME_STEP 0.5 - NUMBER_OF_TIME_STEPS 14400 (this is two hours) - STARTING_TIME_STEP_FOR_TURB_STATISTICS 7200 (this is one hour) - RESULTS_SAVE_INTERVAL 600 (five minutes) - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME domain-ts003600.backup + TIME_STEP 0.5 + NUMBER_OF_TIME_STEPS 14400 (this is two hours) + STARTING_TIME_STEP_FOR_TURB_STATISTICS 7200 (this is one hour) + RESULTS_SAVE_INTERVAL 600 (five minutes) + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 2 - MONITORING_POINT_001 10.5 10.5 11.0 - MONITORING_POINT_002 10.5 10.5 59.0 - POINT_FOR_MONITORING_PLANES 10.5 10.5 10.5 + NUMBER_OF_MONITORING_POINTS 2 + MONITORING_POINT_001 10.5 10.5 11.0 + MONITORING_POINT_002 10.5 10.5 59.0 + POINT_FOR_MONITORING_PLANES 10.5 10.5 10.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.2 - DYNAMIC_VISCOSITY 1.8e-5 - HEAT_CAPACITY 1006.0 + MASS_DENSITY 1.2 + DYNAMIC_VISCOSITY 1.8e-5 + HEAT_CAPACITY 1006.0 - TURBULENCE_MODEL les_dynamic + TURBULENCE_MODEL les_dynamic - MASS_FLOW_RATES 13824.0 0.0 0.0 + MASS_FLOW_RATES 13824.0 0.0 0.0 #---------------- # Porous regions @@ -41,22 +39,22 @@ #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso + PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.95 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.95 - MIN_SIMPLE_ITERATIONS 1 + MIN_SIMPLE_ITERATIONS 1 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Les/Matrix_Of_Cubes/control b/Tests/Les/Matrix_Of_Cubes/control index d8b2b0054..f659e3f03 100644 --- a/Tests/Les/Matrix_Of_Cubes/control +++ b/Tests/Les/Matrix_Of_Cubes/control @@ -57,46 +57,46 @@ #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM central - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 3 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 3 #------------------------ # Linear solver settings #------------------------ - LINEAR_SOLVERS native - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 200 - MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER 100 - - PETSC_OPTIONS_FOR_PRESSURE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-3 - - PETSC_OPTIONS_FOR_WALL_DISTANCE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-6 - - PETSC_OPTIONS_FOR_MOMENTUM - SOLVER bicg - PREC asm - PREC_OPTS - TOLERANCE 1.0e-7 + LINEAR_SOLVERS native + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 200 + MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER 100 + + PETSC_OPTIONS_FOR_PRESSURE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-3 + + PETSC_OPTIONS_FOR_WALL_DISTANCE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-6 + + PETSC_OPTIONS_FOR_MOMENTUM + SOLVER bicg + PREC asm + PREC_OPTS + TOLERANCE 1.0e-7 #--------------------- # Boundary conditions diff --git a/Tests/Les/Pipe_Re_Tau_180/User_Mod/End_Of_Time_Step.f90 b/Tests/Les/Pipe_Re_Tau_180/User_Mod/End_Of_Time_Step.f90 index 565f21bdc..bb5d48198 100644 --- a/Tests/Les/Pipe_Re_Tau_180/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Les/Pipe_Re_Tau_180/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! 1st step for turbulence statist. integer, intent(in) :: n_stat_p ! 1st step for particle statistics - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Var_Type), pointer :: u, v, w, t type(Grid_Type), pointer :: Grid @@ -30,13 +28,13 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & t => Flow % t ! If not time for disturbing the velocity field, return - if(mod(n, 100) .ne. 0) return + if(mod(Time % Curr_Dt(), 100) .ne. 0) return ! If too late to disturb, get out too - if(n > 3000) return + if(Time % Curr_Dt() > 3000) return ! Print a message - if(this_proc < 2) then + if(First_Proc()) then print *, '# Superimposing random eddies on top of velocity field!' end if @@ -119,7 +117,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & vmax = max(vmax, abs(u % n(c))) vmax = max(vmax, abs(v % n(c))) end do - call Comm_Mod_Global_Max_Real(vmax) + call Global % Max_Real(vmax) do c = 1, Grid % n_cells u % n(c) = u % n(c) / vmax / 10.0 v % n(c) = v % n(c) / vmax / 10.0 diff --git a/Tests/Les/Pipe_Re_Tau_180/User_Mod/Save_Results.f90 b/Tests/Les/Pipe_Re_Tau_180/User_Mod/Save_Results.f90 index 60e8d388a..233265247 100644 --- a/Tests/Les/Pipe_Re_Tau_180/User_Mod/Save_Results.f90 +++ b/Tests/Les/Pipe_Re_Tau_180/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Var_Type), pointer :: u, v, w, t @@ -35,7 +34,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -44,30 +43,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Flow % Alias_Energy (t) ! Get constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1r') ! Set file names for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -174,31 +173,31 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uw_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p(pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p(pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -229,7 +228,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) / wall_p(1)) & / dens_const) if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if return @@ -244,12 +243,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux > 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if do s = 1, Grid % n_faces @@ -267,11 +266,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -425,6 +424,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Les/Pipe_Re_Tau_180/control b/Tests/Les/Pipe_Re_Tau_180/control index 13aa565b3..67d474be4 100644 --- a/Tests/Les/Pipe_Re_Tau_180/control +++ b/Tests/Les/Pipe_Re_Tau_180/control @@ -1,77 +1,74 @@ #---------- # Prologue #---------- + PROBLEM_NAME pipe - PROBLEM_NAME pipe + HEAT_TRANSFER yes - HEAT_TRANSFER yes + TIME_STEP 0.02 + NUMBER_OF_TIME_STEPS 27000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 9000 - TIME_STEP 0.02 - NUMBER_OF_TIME_STEPS 27000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 9000 + RESULTS_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 1200 - RESULTS_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 1200 -#LOAD_BACKUP_NAME pipe-ts000001.backup +# Keep the line below, it is needed by test_build.sh script for backup tests +# LOAD_BACKUP_NAME pipe-ts001200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 4.694e-4 - DYNAMIC_VISCOSITY 3.33333e-4 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 4.694e-4 + DYNAMIC_VISCOSITY 3.33333e-4 + HEAT_CAPACITY 1.0 -TURBULENCE_MODEL les_dynamic - PERTURB_MOMENTUM yes + TURBULENCE_MODEL les_dynamic - PRESSURE_DROPS 0.0 0.0 -0.0072 - MASS_FLOW_RATES 0.0 0.0 -2.8 + PRESSURE_DROPS 0.0 0.0 -0.0072 + MASS_FLOW_RATES 0.0 0.0 -2.8 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_MOMENTUM central + ADVECTION_SCHEME_FOR_ENERGY smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-4 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions #-------------------- INITIAL_CONDITION - VARIABLES u v w t + VARIABLES u v w t VALUES 0.0 0.0 -2.8 20.0 #--------------------- # Boundary conditions #--------------------- BOUNDARY_CONDITION cylinder - TYPE wall VARIABLES u v w q VALUES 0.0 0.0 0.0 0.1 -INTERFACE_TRACKING no -PARTICLE_TRACKING no diff --git a/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 b/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 index 9ca7ea742..3627b4867 100644 --- a/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 +++ b/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -36,7 +35,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return call Work % Connect_Real_Cell(tz_mean) @@ -64,21 +63,21 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call File % Set_Name(coord_name, extension='.1d') ! Set file names for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -212,40 +211,40 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(tz_p(pl)) - call Comm_Mod_Global_Sum_Real(ti_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(tz_p(pl)) + call Global % Sum_Real(ti_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_mod_p(pl)) - call Comm_Mod_Global_Sum_Real(var_1(pl)) - call Comm_Mod_Global_Sum_Real(var_2(pl)) - call Comm_Mod_Global_Sum_Real(var_3(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(kin_p(pl)) + call Global % Sum_Real(kin_mod_p(pl)) + call Global % Sum_Real(var_1(pl)) + call Global % Sum_Real(var_2(pl)) + call Global % Sum_Real(var_3(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p(pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(t2_mod_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_mod(pl)) - call Comm_Mod_Global_Sum_Real(vt_mod(pl)) - call Comm_Mod_Global_Sum_Real(wt_mod(pl)) + call Global % Sum_Real(t_p(pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(t2_mod_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) + call Global % Sum_Real(ut_mod(pl)) + call Global % Sum_Real(vt_mod(pl)) + call Global % Sum_Real(wt_mod(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -284,7 +283,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call File % Open_For_Writing_Ascii(res_name, fu) if(Flow % heat_transfer) then - if(this_proc < 2) then + if(First_Proc()) then write(*,'(a1,(a12, f12.6))')'#', ' Nu number = ', & tz_p(1) / (t_hot - t_cold) end if @@ -335,7 +334,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Results.f90.' call Work % Disconnect_Real_Cell(tz_mean) diff --git a/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/control b/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/control index 51be84aa5..12243d15c 100644 --- a/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/control +++ b/Tests/Les/Rayleigh_Benard_Convection_Ra_10e09/control @@ -1,70 +1,67 @@ #----------- # Prologue #----------- + PROBLEM_NAME rb_conv - PROBLEM_NAME rb_conv + HEAT_TRANSFER yes - HEAT_TRANSFER yes + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 4230 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 4222 - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 4230 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 4222 - -# LOAD_BACKUP_NAME rb_conv-ts004220.backup - RESULTS_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 1200 + RESULTS_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 1200 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - BUOYANCY thermal - GRAVITATIONAL_VECTOR 0.0, 0.0, -0.03215 - REFERENCE_TEMPERATURE 10.0 + BUOYANCY thermal + GRAVITATIONAL_VECTOR 0.0, 0.0, -0.03215 + REFERENCE_TEMPERATURE 10.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 21.28e-6 - DYNAMIC_VISCOSITY 15.11e-6 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 21.28e-6 + DYNAMIC_VISCOSITY 15.11e-6 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL les_dynamic + TURBULENCE_MODEL les_dynamic #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM blended - BLENDING_COEFFICIENT_FOR_MOMENTUM 0.99 - ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_MOMENTUM blended + BLENDING_COEFFICIENT_FOR_MOMENTUM 0.99 + ADVECTION_SCHEME_FOR_ENERGY smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 5.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 5.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 5.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 5.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 5.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 5.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 #-------------------- # Initial conditions #-------------------- INITIAL_CONDITION - VARIABLES u v w t + VARIABLES u v w t VALUES 0.0 0.0 0.0 10.0 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 b/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 index cbaafbacd..a17c43d77 100644 --- a/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 +++ b/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -31,11 +30,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! This version of the Save_Results works only for sequential runs - if(n_proc > 1) then - if(this_proc < 2) then + if(Parallel_Run()) then + if(First_Proc()) then print *, '#===========================================================' print *, '# This version of User_Mod_Save_Results is not intended for ' print *, '# parallel runs. Skipped writing of profiles in .dat file! ' @@ -51,18 +50,18 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Turb % Alias_K_Eps_Zeta_F(kin, eps, zeta, f22) ! Read constant physical properties from control file - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') ! Set file name for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res-plus', & + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix='-res-plus', & extension='.dat') !------------------! @@ -70,7 +69,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -227,6 +226,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) close(fu) - if(this_proc < 2) write(6, *) '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) write(6, *) '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/control b/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/control index 59ae89563..b1133fe04 100644 --- a/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/control +++ b/Tests/Manual/Channel_Re_Tau_590/Stretched_Mesh/control @@ -1,35 +1,35 @@ #-------------------- # Problem definition #-------------------- - PROBLEM_NAME chan + PROBLEM_NAME chan #--------------- # Time stepping #--------------- - TIME_STEP 1.0 - NUMBER_OF_TIME_STEPS 3000 - RESULTS_SAVE_INTERVAL 3000 - BACKUP_SAVE_INTERVAL 3000 + TIME_STEP 1.0 + NUMBER_OF_TIME_STEPS 3000 + RESULTS_SAVE_INTERVAL 3000 + BACKUP_SAVE_INTERVAL 3000 #-------------------------------------- # Monitoring plane and mass flow rates #-------------------------------------- - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 - MASS_FLOW_RATES 0.2 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + MASS_FLOW_RATES 0.2 0.0 0.0 #---------------------------------------- # Fluid properties # Dry air at 27oC in SI units #---------------------------------------- - MASS_DENSITY 1.177 - DYNAMIC_VISCOSITY 1.846e-5 - THERMAL_CONDUCTIVITY 2.6240e-2 - HEAT_CAPACITY 1000.0 + MASS_DENSITY 1.177 + DYNAMIC_VISCOSITY 1.846e-5 + THERMAL_CONDUCTIVITY 2.6240e-2 + HEAT_CAPACITY 1000.0 #---------------------------------------- # Physical models #---------------------------------------- - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #-------------------- # Initial conditions diff --git a/Tests/Manual/Conjugate/User_Mod/End_Of_Time_Step.f90 b/Tests/Manual/Conjugate/User_Mod/End_Of_Time_Step.f90 index 455ceed01..c8ef5b0f9 100644 --- a/Tests/Manual/Conjugate/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Manual/Conjugate/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t ! start time step for Turb. stat. integer, intent(in) :: n_stat_p ! start time step for Swarm. stat. - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: t @@ -39,7 +37,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) - if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. this_proc) then + if(c2 < 0 .and. Grid % Comm % cell_proc(c1) .eq. This_Proc()) then if( Var_Mod_Bnd_Cond_Type(t,c2) .eq. WALL ) then area = area + Grid % s(s) @@ -53,15 +51,15 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !-----------------------------------------------! ! Integrate (summ) heated area, and heat up ! !-----------------------------------------------! - call Comm_Mod_Global_Sum_Real(area) - call Comm_Mod_Global_Sum_Real(nu) + call Global % Sum_Real(area) + call Global % Sum_Real(nu) !-------------------------------------------------! ! Compute averaged Nussel number and print it ! !-------------------------------------------------! nu = nu / area - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #===========================================' print '(a)', ' # Output from user function, Nusslet number!' print '(a)', ' #-------------------------------------------' diff --git a/Tests/Manual/Conjugate/control b/Tests/Manual/Conjugate/control index 6a569a0c1..5a74c5b64 100644 --- a/Tests/Manual/Conjugate/control +++ b/Tests/Manual/Conjugate/control @@ -1,16 +1,16 @@ - NUMBER_OF_DOMAINS 3 + NUMBER_OF_DOMAINS 3 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 30 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 30 - TIME_STEP 0.1 + TIME_STEP 0.1 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - # Connection between hot solid and the fluid: - INTERFACE_CONDITION hot_solid fluid - BOUNDARY_CONDITIONS right_wall left_wall + # Connection between hot solid and the fluid: + INTERFACE_CONDITION hot_solid fluid + BOUNDARY_CONDITIONS right_wall left_wall - # Connection between fluid and the cold solid - INTERFACE_CONDITION fluid cold_solid - BOUNDARY_CONDITIONS right_wall left_wall + # Connection between fluid and the cold solid + INTERFACE_CONDITION fluid cold_solid + BOUNDARY_CONDITIONS right_wall left_wall diff --git a/Tests/Manual/Conjugate/control.1 b/Tests/Manual/Conjugate/control.1 index e06a4670f..e230d1a1f 100644 --- a/Tests/Manual/Conjugate/control.1 +++ b/Tests/Manual/Conjugate/control.1 @@ -1,87 +1,87 @@ #------- # Intro #------- - PROBLEM_NAME hot_solid + PROBLEM_NAME hot_solid - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00264575131 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00264575131 - THERMAL_CONDUCTIVITY 0.00377964473 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00264575131 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00264575131 + THERMAL_CONDUCTIVITY 0.00377964473 #-------------------- # Initial conditions #-------------------- - INITIAL_CONDITION - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 + INITIAL_CONDITION + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION top_wall - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION side_walls - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.25 - -BOUNDARY_CONDITION left_wall - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION right_wall - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION side_walls + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.25 + + BOUNDARY_CONDITION left_wall + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION right_wall + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Manual/Conjugate/control.2 b/Tests/Manual/Conjugate/control.2 index d68ea0061..f3f408439 100644 --- a/Tests/Manual/Conjugate/control.2 +++ b/Tests/Manual/Conjugate/control.2 @@ -1,95 +1,95 @@ #------- # Intro #------- - PROBLEM_NAME fluid + PROBLEM_NAME fluid - HEAT_TRANSFER yes - BUOYANCY thermal - REFERENCE_TEMPERATURE 0.5 + HEAT_TRANSFER yes + BUOYANCY thermal + REFERENCE_TEMPERATURE 0.5 - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none + TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -1.0 - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00264575131 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00264575131 - THERMAL_CONDUCTIVITY 0.00377964473 + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00264575131 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00264575131 + THERMAL_CONDUCTIVITY 0.00377964473 #-------------------- # Initial conditions #-------------------- - INITIAL_CONDITION - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + INITIAL_CONDITION + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION top_wall - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION side_walls - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION left_wall - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION right_wall - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION side_walls + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION left_wall + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION right_wall + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 diff --git a/Tests/Manual/Conjugate/control.3 b/Tests/Manual/Conjugate/control.3 index 6d72ec952..76b02fd13 100644 --- a/Tests/Manual/Conjugate/control.3 +++ b/Tests/Manual/Conjugate/control.3 @@ -1,31 +1,31 @@ #------- # Intro #------- - PROBLEM_NAME cold_solid + PROBLEM_NAME cold_solid - HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 + HEAT_TRANSFER yes + POINT_FOR_MONITORING_PLANES 0.5, 0.5, 0.05 - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 999999 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 999999 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - TURBULENCE_MODEL none - - # Properties based on Pr and Ra numbers: - # Pr = 0.7 - # Ra = 10e5 - # mu = sqrt(Pr / Ra) = 0.00264575131 - # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 - MASS_DENSITY 1.0 - HEAT_CAPACITY 1.0 - DYNAMIC_VISCOSITY 0.00264575131 - THERMAL_CONDUCTIVITY 0.00377964473 + TURBULENCE_MODEL none + + # Properties based on Pr and Ra numbers: + # Pr = 0.7 + # Ra = 10e5 + # mu = sqrt(Pr / Ra) = 0.00264575131 + # lambda = 1.0 / sqrt(Pr * Ra) = 0.00377964473 + MASS_DENSITY 1.0 + HEAT_CAPACITY 1.0 + DYNAMIC_VISCOSITY 0.00264575131 + THERMAL_CONDUCTIVITY 0.00377964473 #-------------------- # Initial conditions @@ -37,51 +37,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION top_wall - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION side_walls - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.75 - -BOUNDARY_CONDITION left_wall - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 0.5 - -BOUNDARY_CONDITION right_wall - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 1.0 + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION side_walls + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.75 + + BOUNDARY_CONDITION left_wall + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 0.5 + + BOUNDARY_CONDITION right_wall + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 1.0 diff --git a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Nu.f90 b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Nu.f90 index 51201b22c..f8a2936ce 100644 --- a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Nu.f90 +++ b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Nu.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Save_Impinging_Jet_Nu(Turb, ts) + subroutine Save_Impinging_Jet_Nu(Turb) !------------------------------------------------------------------------------! ! The subroutine creates ASCII file with Nusselt number averaged ! ! in azimuthal direction. ! @@ -7,7 +7,6 @@ subroutine Save_Impinging_Jet_Nu(Turb, ts) implicit none !---------------------------------[Arguments]----------------------------------! type(Turb_Type), target :: Turb - integer, intent(in) :: ts ! time step !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow @@ -39,7 +38,7 @@ subroutine Save_Impinging_Jet_Nu(Turb, ts) !-----------------------------------! inquire(file='rad_coordinate.dat', exist=there) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "#==========================================================" print *, "# In order to extract Nusselt number profile " print *, "# an ascii file with cell-faces coordinates has to be read." @@ -85,7 +84,7 @@ subroutine Save_Impinging_Jet_Nu(Turb, ts) c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) if(c2 < 0) then - if(Grid % Bnd_Cond_Name(c2) .eq. 'LOWER_WALL') then + if(Grid % Bnd_Cond_Name_At_Cell(c2) .eq. 'LOWER_WALL') then r = sqrt(Grid % xc(c1)*Grid % xc(c1) + & Grid % yc(c1)*Grid % yc(c1)) + TINY if(r < rad(i+1) .and. r > rad(i)) then @@ -111,18 +110,18 @@ subroutine Save_Impinging_Jet_Nu(Turb, ts) ! Average over all processors ! !---------------------------------! do i = 1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(i)) + call Global % Sum_Int(n_count(i)) - call Comm_Mod_Global_Sum_Real(u_s(i)) - call Comm_Mod_Global_Sum_Real(v_s(i)) - call Comm_Mod_Global_Sum_Real(w_s(i)) + call Global % Sum_Real(u_s(i)) + call Global % Sum_Real(v_s(i)) + call Global % Sum_Real(w_s(i)) - call Comm_Mod_Global_Sum_Real(z_s(i)) - call Comm_Mod_Global_Sum_Real(tau_s(i)) - call Comm_Mod_Global_Sum_Real(q_s(i)) + call Global % Sum_Real(z_s(i)) + call Global % Sum_Real(tau_s(i)) + call Global % Sum_Real(q_s(i)) - call Comm_Mod_Global_Sum_Real(r_s(i)) - call Comm_Mod_Global_Sum_Real(t_s(i)) + call Global % Sum_Real(r_s(i)) + call Global % Sum_Real(t_s(i)) end do do i = 1, n_prob @@ -137,15 +136,15 @@ subroutine Save_Impinging_Jet_Nu(Turb, ts) r_s(i) = r_s(i) / n_count(i) end if end do - call Comm_Mod_Wait + call Global % Wait !-----------------------------------! ! Write from one processor only ! !-----------------------------------! - if(this_proc < 2) then + if(First_Proc()) then ! Set the file name - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-nu-utau', extension='.dat') call File % Open_For_Writing_Ascii(res_name, fu) @@ -166,6 +165,6 @@ subroutine Save_Impinging_Jet_Nu(Turb, ts) close(fu) end if - if(this_proc < 2) print *, '# Finished with Impinging_Jet_Nu' + if(First_Proc()) print *, '# Finished with Impinging_Jet_Nu' end subroutine diff --git a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Profiles.f90 b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Profiles.f90 index 1cfa2c9ea..54e66927f 100644 --- a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Profiles.f90 +++ b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Impinging_Jet_Profiles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine Save_Impinging_Jet_Profiles(Turb, ts) + subroutine Save_Impinging_Jet_Profiles(Turb) !------------------------------------------------------------------------------! ! Subroutine reads the .1d file with wall normal coordinates and extracts ! ! solutions for comparison with corresponding experimental measurements. ! @@ -7,7 +7,6 @@ subroutine Save_Impinging_Jet_Profiles(Turb, ts) implicit none !---------------------------------[Arguments]----------------------------------! type(Turb_Type), target :: Turb - integer, intent(in) :: ts ! time step !------------------------------[Local parameters]------------------------------! real, parameter :: U_AVER = 1.14 !-----------------------------------[Locals]-----------------------------------! @@ -73,43 +72,43 @@ subroutine Save_Impinging_Jet_Profiles(Turb, ts) r1 = 0.0 r2 = 0.04 lnum = 0.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-0.0D', extension='.dat') else if(k .eq. 1) then r1 = 0.992 r2 = 1.0 lnum = 0.5 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-0.5D', extension='.dat') else if(k .eq. 2) then r1 = 2.0 r2 = 2.1500 lnum = 1.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-1.0D', extension='.dat') else if(k .eq. 3) then r1 = 2.9744 r2 = 3.0684 lnum = 1.5 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-1.5D', extension='.dat') else if(k .eq. 4) then r1 = 3.9098 r2 = 4.1433 lnum = 2.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-2.0D', extension='.dat') else if(k .eq. 5) then r1 = 0.4803200E+01 r2 = 0.5347000E+01 lnum = 2.5 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-2.5D', extension='.dat') else if(k .eq. 6) then r1 = 0.5876600E+01 r2 = 0.6000000E+01 lnum = 3.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-3.0D', extension='.dat') end if @@ -148,19 +147,19 @@ subroutine Save_Impinging_Jet_Profiles(Turb, ts) ! Average over all processors ! !---------------------------------! do i = 1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(i)) - - call Comm_Mod_Global_Sum_Real(u_p(i)) - call Comm_Mod_Global_Sum_Real(v_p(i)) - call Comm_Mod_Global_Sum_Real(w_p(i)) - call Comm_Mod_Global_Sum_Real(zm_p(i)) - - call Comm_Mod_Global_Sum_Real(kin_p(i)) - call Comm_Mod_Global_Sum_Real(eps_p(i)) - call Comm_Mod_Global_Sum_Real(vis_p(i)) - call Comm_Mod_Global_Sum_Real(zet_p(i)) - call Comm_Mod_Global_Sum_Real(f22_p(i)) - call Comm_Mod_Global_Sum_Real(t_p(i)) + call Global % Sum_Int(n_count(i)) + + call Global % Sum_Real(u_p(i)) + call Global % Sum_Real(v_p(i)) + call Global % Sum_Real(w_p(i)) + call Global % Sum_Real(zm_p(i)) + + call Global % Sum_Real(kin_p(i)) + call Global % Sum_Real(eps_p(i)) + call Global % Sum_Real(vis_p(i)) + call Global % Sum_Real(zet_p(i)) + call Global % Sum_Real(f22_p(i)) + call Global % Sum_Real(t_p(i)) end do do i = 1, n_prob @@ -181,7 +180,7 @@ subroutine Save_Impinging_Jet_Profiles(Turb, ts) !-----------------------------------! ! Write from one processor only ! !-----------------------------------! - if(this_proc < 2) then + if(First_Proc()) then call File % Open_For_Writing_Ascii(res_name, fu) @@ -225,10 +224,10 @@ subroutine Save_Impinging_Jet_Profiles(Turb, ts) t_p(:) = 0.0 zm_p(:) = 0.0 - if(this_proc < 2) print *, 'Finished with profile r/D = ', lnum + if(First_Proc()) print *, 'Finished with profile r/D = ', lnum end do ! end number of radius - if(this_proc < 2) write(*,*) 'Finished with User_Impinging_Jet_Profiles' + if(First_Proc()) write(*,*) 'Finished with User_Impinging_Jet_Profiles' end subroutine diff --git a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 index 4c6b74b04..adfa515ac 100644 --- a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 +++ b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 @@ -1,8 +1,8 @@ -include '../User_Mod/Save_Impinging_Jet_Nu.f90' -include '../User_Mod/Save_Impinging_Jet_Profiles.f90' +#include "Save_Impinging_Jet_Nu.f90" +#include "Save_Impinging_Jet_Profiles.f90" !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! Calls Save_Impinging_Jet_Nu and Save_Impinging_Jet_Profile functions. ! !------------------------------------------------------------------------------! @@ -12,14 +12,13 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type) :: Turb type(Vof_Type) :: Vof type(Swarm_Type) :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return - call Save_Impinging_Jet_Nu (Turb, ts) - call Save_Impinging_Jet_Profiles(Turb, ts) + call Save_Impinging_Jet_Nu (Turb) + call Save_Impinging_Jet_Profiles(Turb) end subroutine diff --git a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/control b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/control index 2546f273d..1306ae653 100644 --- a/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/control +++ b/Tests/Manual/Impinging_Jet_2d_Distant_Re_23000/control @@ -1,65 +1,65 @@ #---------- # Prologue #---------- - PROBLEM_NAME jet - HEAT_TRANSFER yes + PROBLEM_NAME jet + HEAT_TRANSFER yes - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 3600 - MIN_SIMPLE_ITERATIONS 3 - MAX_SIMPLE_ITERATIONS 6 + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 3600 + MIN_SIMPLE_ITERATIONS 3 + MAX_SIMPLE_ITERATIONS 6 #------------------ # Saving intervals #------------------ - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 1200 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 1200 #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.17 0.17 1.51 + POINT_FOR_MONITORING_PLANES 0.17 0.17 1.51 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4e-4 - DYNAMIC_VISCOSITY 1.0e-4 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4e-4 + DYNAMIC_VISCOSITY 1.0e-4 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #------------------------ # Linear solver settings #------------------------ - LINEAR_SOLVERS petsc - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-7 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-7 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + LINEAR_SOLVERS petsc + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-7 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-7 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Manual/Inflows/Option_1/control b/Tests/Manual/Inflows/Option_1/control index 6aca79739..0ac22d0d6 100644 --- a/Tests/Manual/Inflows/Option_1/control +++ b/Tests/Manual/Inflows/Option_1/control @@ -1,66 +1,66 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #--------------- # Time stepping #--------------- - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 6000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 6000 #--------------------- # Physical properties #--------------------- - DYNAMIC_VISCOSITY 2.000e-4 + DYNAMIC_VISCOSITY 2.000e-4 - TURBULENCE_MODEL les_smagorinsky + TURBULENCE_MODEL les_smagorinsky - POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 + POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------------- # Linear solver parameters #-------------------------- - TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 - TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 + TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 + TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES u v w - VALUES 1.0 0.0 0.0 + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES u v w + VALUES 1.0 0.0 0.0 - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Manual/Inflows/Option_2/control b/Tests/Manual/Inflows/Option_2/control index 47a27a2e2..58d132195 100644 --- a/Tests/Manual/Inflows/Option_2/control +++ b/Tests/Manual/Inflows/Option_2/control @@ -1,66 +1,66 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #--------------- # Time stepping #--------------- - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 6000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 6000 #--------------------- # Physical properties #--------------------- - DYNAMIC_VISCOSITY 2.000e-4 + DYNAMIC_VISCOSITY 2.000e-4 - TURBULENCE_MODEL les_smagorinsky + TURBULENCE_MODEL les_smagorinsky - POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 + POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------------- # Linear solver parameters #-------------------------- - TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 - TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 + TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 + TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES y u - FILE profile.dat + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES y u + FILE profile.dat - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Manual/Inflows/Option_3/control b/Tests/Manual/Inflows/Option_3/control index 255c3e9bc..9ca65716b 100644 --- a/Tests/Manual/Inflows/Option_3/control +++ b/Tests/Manual/Inflows/Option_3/control @@ -1,72 +1,72 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #--------------- # Time stepping #--------------- - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 6000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 6000 #--------------------- # Physical properties #--------------------- - DYNAMIC_VISCOSITY 2.000e-4 + DYNAMIC_VISCOSITY 2.000e-4 - TURBULENCE_MODEL les_smagorinsky + TURBULENCE_MODEL les_smagorinsky - POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 + POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------------- # Linear solver parameters #-------------------------- - TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 - TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 + TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 + TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES u v w - VALUES 1.0 0.0 0.0 + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES u v w + VALUES 1.0 0.0 0.0 - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - SYNTHETIC_EDDIES in - NUMBER_OF_EDDIES 40 - MAX_EDDY_RADIUS 0.5 - EDDY_INTENSITY 0.2 + SYNTHETIC_EDDIES in + NUMBER_OF_EDDIES 40 + MAX_EDDY_RADIUS 0.5 + EDDY_INTENSITY 0.2 diff --git a/Tests/Manual/Inflows/Option_4/User_Mod/End_Of_Time_Step.f90 b/Tests/Manual/Inflows/Option_4/User_Mod/End_Of_Time_Step.f90 index 5ad83f4a2..759fe8d91 100644 --- a/Tests/Manual/Inflows/Option_4/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Manual/Inflows/Option_4/User_Mod/End_Of_Time_Step.f90 @@ -1,17 +1,8 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - curr_dt, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Grid_Mod, only: Grid_Type - use Field_Mod - use Var_Mod, only: Var_Type - use Const_Mod, only: PI - use Comm_Mod, only: Comm_Mod_Global_Max_Real, & - Comm_Mod_Global_Min_Real, & - this_proc !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -19,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step integer, intent(in) :: n_stat_t ! 1st t.s. statistics turbulence integer, intent(in) :: n_stat_p ! 1st t.s. statistics particles - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Var_Type), pointer :: u, v, w, t type(Grid_Type), pointer :: Grid @@ -34,10 +23,10 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !==============================================================================! ! If not time for disturbing the velocity field, return - if(mod(curr_dt, 120) .ne. 0) return + if(mod(Time % Curr_Dt(), 120) .ne. 0) return ! If too late to disturb, get out too - if(curr_dt > 1440) return + if(Time % Curr_Dt() > 1440) return ! Take aliases Grid => Flow % pnt_grid @@ -50,7 +39,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & if(Grid % name .ne. 'PRECURSOR') return ! Print a message - if(this_proc < 2) then + if(First_Proc()) then print *, '# Superimposing random eddies on top of velocity field!' end if @@ -73,12 +62,12 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & zmin = min(zmin, Grid % zn(n)); zmax = max(zmax, Grid % zn(n)) end do end do - call Comm_Mod_Global_Min_Real(xmin) - call Comm_Mod_Global_Min_Real(ymin) - call Comm_Mod_Global_Min_Real(zmin) - call Comm_Mod_Global_Max_Real(xmax) - call Comm_Mod_Global_Max_Real(ymax) - call Comm_Mod_Global_Max_Real(zmax) + call Global % Min_Real(xmin) + call Global % Min_Real(ymin) + call Global % Min_Real(zmin) + call Global % Max_Real(xmax) + call Global % Max_Real(ymax) + call Global % Max_Real(zmax) lx = xmax - xmin ly = ymax - ymin lz = zmax - zmin @@ -170,7 +159,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & vmax = max(vmax, abs(v % n(c))) vmax = max(vmax, abs(w % n(c))) end do - call Comm_Mod_Global_Max_Real(vmax) + call Global % Max_Real(vmax) do c = 1, Grid % n_cells v % n(c) = v % n(c) / vmax v % o(c) = v % o(c) / vmax diff --git a/Tests/Manual/Inflows/Option_4/control b/Tests/Manual/Inflows/Option_4/control index 8ea6486db..2c7c30aca 100644 --- a/Tests/Manual/Inflows/Option_4/control +++ b/Tests/Manual/Inflows/Option_4/control @@ -1,23 +1,23 @@ #---------------------------------------------------------- # Specify number of domains you are simultaneously solving #---------------------------------------------------------- - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 #--------------- # Time stepping #--------------- - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 6000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 6000 #---------------------- # Numerical parameters #---------------------- - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 2 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MIN_SIMPLE_ITERATIONS 2 #---------------------- # Interface conditions #---------------------- - INTERFACE_CONDITION precursor cylinder - BOUNDARY_CONDITIONS periodic_x in + INTERFACE_CONDITION precursor cylinder + BOUNDARY_CONDITIONS periodic_x in diff --git a/Tests/Manual/Inflows/Option_4/control.1 b/Tests/Manual/Inflows/Option_4/control.1 index c090580fc..051aaa93e 100644 --- a/Tests/Manual/Inflows/Option_4/control.1 +++ b/Tests/Manual/Inflows/Option_4/control.1 @@ -1,56 +1,56 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME precursor + PROBLEM_NAME precursor #--------------- # Time stepping #--------------- - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 6000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 6000 #--------------------- # Physical properties #--------------------- - DYNAMIC_VISCOSITY 2.000e-4 + DYNAMIC_VISCOSITY 2.000e-4 - TURBULENCE_MODEL les_smagorinsky + TURBULENCE_MODEL les_smagorinsky - MASS_FLOW_RATES 16.4 0.0 0.0 - POINT_FOR_MONITORING_PLANES -6.0 0.5 0.5 + MASS_FLOW_RATES 16.4 0.0 0.0 + POINT_FOR_MONITORING_PLANES -6.0 0.5 0.5 #---------------------- # Numerical parameters #---------------------- - ADVECTION_SCHEME_FOR_MOMENTUM central + ADVECTION_SCHEME_FOR_MOMENTUM central - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------------- # Linear solver parameters #-------------------------- - TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 - TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 + TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 + TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 #------------------- # Initial condition #------------------- - INITIAL_CONDITION - VARIABLES u v w - VALUES 1.0 0.0 0.0 + INITIAL_CONDITION + VARIABLES u v w + VALUES 1.0 0.0 0.0 #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Manual/Inflows/Option_4/control.2 b/Tests/Manual/Inflows/Option_4/control.2 index 6aca79739..0ac22d0d6 100644 --- a/Tests/Manual/Inflows/Option_4/control.2 +++ b/Tests/Manual/Inflows/Option_4/control.2 @@ -1,66 +1,66 @@ #-------------- # Problem name #-------------- - PROBLEM_NAME cylinder + PROBLEM_NAME cylinder #--------------- # Time stepping #--------------- - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 6000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 6000 #--------------------- # Physical properties #--------------------- - DYNAMIC_VISCOSITY 2.000e-4 + DYNAMIC_VISCOSITY 2.000e-4 - TURBULENCE_MODEL les_smagorinsky + TURBULENCE_MODEL les_smagorinsky - POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 + POINT_FOR_MONITORING_PLANES 6.0 0.5 0.5 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-3 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------------- # Linear solver parameters #-------------------------- - TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 - TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 + TOLERANCE_FOR_POTENTIAL_SOLVER 1.0e-4 + TOLERANCE_FOR_WALL_DISTANCE_SOLVER 1.0e-4 #------------------- # Initial condition #------------------- - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #--------------------- # Boundary conditions #--------------------- - BOUNDARY_CONDITION in - TYPE inflow - VARIABLES u v w - VALUES 1.0 0.0 0.0 + BOUNDARY_CONDITION in + TYPE inflow + VARIABLES u v w + VALUES 1.0 0.0 0.0 - BOUNDARY_CONDITION out - TYPE convective - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION out + TYPE convective + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION flat_walls - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION flat_walls + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 - BOUNDARY_CONDITION cylinder_wall - TYPE wall - VARIABLES u v w - VALUES 0.0 0.0 0.0 + BOUNDARY_CONDITION cylinder_wall + TYPE wall + VARIABLES u v w + VALUES 0.0 0.0 0.0 diff --git a/Tests/Manual/Matrix_Of_Cubes/User_Mod/Beginning_Of_Simulation.f90 b/Tests/Manual/Matrix_Of_Cubes/User_Mod/Beginning_Of_Simulation.f90 index 9b4e4bea7..6c5972dd2 100644 --- a/Tests/Manual/Matrix_Of_Cubes/User_Mod/Beginning_Of_Simulation.f90 +++ b/Tests/Manual/Matrix_Of_Cubes/User_Mod/Beginning_Of_Simulation.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & - curr_dt, time) + subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of simulation. ! ! ! @@ -13,8 +12,6 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid integer :: n, n_probes, backup_dt @@ -91,7 +88,7 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, & call Work % Disconnect_Real_Node(d_probe,z_probe,u_mean_n,uu_res_n,vv_res_n) call Work % Disconnect_Int_Node (node_ind) - call Comm_Mod_End + call Global % End_Parallel stop end subroutine diff --git a/Tests/Manual/Matrix_Of_Cubes/control b/Tests/Manual/Matrix_Of_Cubes/control index 8a9fcbe6b..50bfa4d12 100644 --- a/Tests/Manual/Matrix_Of_Cubes/control +++ b/Tests/Manual/Matrix_Of_Cubes/control @@ -13,7 +13,7 @@ RESULTS_SAVE_INTERVAL 200 BACKUP_SAVE_INTERVAL 3000 - # LOAD_BACKUP_NAME matrix-ts060000.backup + # LOAD_BACKUP_NAME matrix-ts060000.backup #------------------- # Monitoring points @@ -56,46 +56,46 @@ #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - MIN_SIMPLE_ITERATIONS 2 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + MIN_SIMPLE_ITERATIONS 2 - TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM central - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_GAUSS_GRADIENTS_ITERATIONS 3 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 3 #------------------------ # Linear solver settings #------------------------ - LINEAR_SOLVERS native - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 200 - MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER 100 - - PETSC_OPTIONS_FOR_PRESSURE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-3 - - PETSC_OPTIONS_FOR_WALL_DISTANCE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-6 - - PETSC_OPTIONS_FOR_MOMENTUM - SOLVER bicg - PREC asm - PREC_OPTS - TOLERANCE 1.0e-7 + LINEAR_SOLVERS native + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 200 + MAX_ITERATIONS_FOR_WALL_DISTANCE_SOLVER 100 + + PETSC_OPTIONS_FOR_PRESSURE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-3 + + PETSC_OPTIONS_FOR_WALL_DISTANCE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-6 + + PETSC_OPTIONS_FOR_MOMENTUM + SOLVER bicg + PREC asm + PREC_OPTS + TOLERANCE 1.0e-7 #--------------------- # Boundary conditions diff --git a/Tests/Manual/Parallel/control b/Tests/Manual/Parallel/control index 1197c0aa3..948bbb9b1 100644 --- a/Tests/Manual/Parallel/control +++ b/Tests/Manual/Parallel/control @@ -1,56 +1,55 @@ #---------- # Prologue #--------- - PROBLEM_NAME rod_tet_dual - HEAT_TRANSFER no + PROBLEM_NAME rod_tet_dual + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 6000 + NUMBER_OF_TIME_STEPS 6000 - RESULTS_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 3000 - TIME_STEP 0.005 + RESULTS_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 3000 + TIME_STEP 0.005 #------------------- -# Monitoring points +# Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.007 0.00 0.002 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.007 0.00 0.002 - POINT_FOR_MONITORING_PLANES 0.007 0.00 0.002 + POINT_FOR_MONITORING_PLANES 0.007 0.00 0.002 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 2.0e-5 - HEAT_CAPACITY 1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 2.0e-5 + HEAT_CAPACITY 1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - TURBULENCE_MODEL les_smagorinsky - PRESSURE_DROPS 3.6 0.0 0.0 - MASS_FLOW_RATES 0.5 0.0 0.0 + TURBULENCE_MODEL les_smagorinsky + PRESSURE_DROPS 3.6 0.0 0.0 + MASS_FLOW_RATES 0.5 0.0 0.0 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_MOMENTUM superbee #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Manual/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 b/Tests/Manual/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 index 9e375adbf..f827f021b 100644 --- a/Tests/Manual/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Manual/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is computing benchmark for rising bubble. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer :: n ! current time step integer :: n_stat_t ! 1st t.s. statistics turbulence integer :: n_stat_p ! 1st t.s. statistics particles - real :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: fun @@ -36,15 +34,15 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & rise_velocity = rise_velocity + Flow % w % n(c) * fun % n(c) * Grid % vol(c) end do - call Comm_Mod_Global_Sum_Real(b_volume) - call Comm_Mod_Global_Sum_Real(c_position) - call Comm_Mod_Global_Sum_Real(rise_velocity) + call Global % Sum_Real(b_volume) + call Global % Sum_Real(c_position) + call Global % Sum_Real(rise_velocity) ! Write to file - if (this_proc < 2) then + if (First_Proc()) then call File % Append_For_Writing_Ascii('benchmark.dat', fu) - write(fu,'(4(2x,e16.10e2))') time, & + write(fu,'(4(2x,e16.10e2))') Time % Get_Time(), & b_volume, & c_position/b_volume, & rise_velocity/b_volume diff --git a/Tests/Manual/Rising_Bubble/control b/Tests/Manual/Rising_Bubble/control index a9327d1ba..834867082 100644 --- a/Tests/Manual/Rising_Bubble/control +++ b/Tests/Manual/Rising_Bubble/control @@ -1,71 +1,68 @@ #---------- # Prologue #---------- - PROBLEM_NAME bubble - INTERFACE_TRACKING yes + PROBLEM_NAME bubble + INTERFACE_TRACKING yes #-------------------------- # Time should be 3 seconds #-------------------------- - NUMBER_OF_TIME_STEPS 1200 - TIME_STEP 0.0025 + NUMBER_OF_TIME_STEPS 1200 + TIME_STEP 0.0025 - RESULTS_SAVE_INTERVAL 12 - BACKUP_SAVE_INTERVAL 999999 + RESULTS_SAVE_INTERVAL 12 + BACKUP_SAVE_INTERVAL 999999 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- - PHASE_DENSITIES 1.0e2 1.0e3 - PHASE_VISCOSITIES 1.0e0 1.0e1 - SURFACE_TENSION 24.5 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -0.98 + PHASE_DENSITIES 1.0e2 1.0e3 + PHASE_VISCOSITIES 1.0e0 1.0e1 + SURFACE_TENSION 24.5 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 0.0 0.0 -0.98 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM quick - ADVECTION_SCHEME_FOR_VOF cicsam + ADVECTION_SCHEME_FOR_MOMENTUM quick + ADVECTION_SCHEME_FOR_VOF cicsam - GU_CORRECTION yes - CHOI_CORRECTION yes + GU_CORRECTION yes + CHOI_CORRECTION yes - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - GRADIENT_METHOD_FOR_VOF gauss_theorem - MAX_ITERATIONS_FOR_GAUSS_GRADIENTS 200 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_VOF gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 200 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 - MAX_SIMPLE_ITERATIONS 20 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - MIN_SIMPLE_ITERATIONS 3 - + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 + MAX_SIMPLE_ITERATIONS 20 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 + MIN_SIMPLE_ITERATIONS 3 #--------------------- # Boundary conditions diff --git a/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Simulation.f90 b/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Simulation.f90 index bead8290b..b900c1997 100644 --- a/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Simulation.f90 +++ b/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Simulation.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of simulation. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid integer :: i, fu @@ -44,7 +42,7 @@ subroutine User_Mod_Beginning_Of_Simulation(Flow, Turb, Vof, Swarm, n, time) close(fu) - if(this_proc < 2) then + if(First_Proc()) then print '(a)', ' #============================================' print '(a)', ' # Output from user function, read properties!' print '(a)', ' #--------------------------------------------' diff --git a/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Time_Step.f90 b/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Time_Step.f90 index 095f8231d..81a9168de 100644 --- a/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Time_Step.f90 +++ b/Tests/Manual/Thermally_Driven/Varible/User_Mod/Beginning_Of_Time_Step.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Beginning_Of_Time_Step(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, v, w, t, phi diff --git a/Tests/Manual/Thermally_Driven/Varible/control b/Tests/Manual/Thermally_Driven/Varible/control index 95e08255f..06f1fc00f 100644 --- a/Tests/Manual/Thermally_Driven/Varible/control +++ b/Tests/Manual/Thermally_Driven/Varible/control @@ -1,25 +1,25 @@ #------- # Intro #------- - PROBLEM_NAME air + PROBLEM_NAME air - HEAT_TRANSFER yes + HEAT_TRANSFER yes - POINT_FOR_MONITORING_PLANES 0.0, 0.0, 0.06 + POINT_FOR_MONITORING_PLANES 0.0, 0.0, 0.06 -#LOAD_BACKUP_NAME zyrconium-ts009600.backup +# LOAD_BACKUP_NAME zyrconium-ts009600.backup - TIME_STEP 1.0e-2 - NUMBER_OF_TIME_STEPS 6000 - RESULTS_SAVE_INTERVAL 120 + TIME_STEP 1.0e-2 + NUMBER_OF_TIME_STEPS 6000 + RESULTS_SAVE_INTERVAL 120 #----------------------------------------------- # Physical models # (Properties are read from file for this case) #----------------------------------------------- - GRAVITATIONAL_VECTOR 0.0, 0.0, -9.81 + GRAVITATIONAL_VECTOR 0.0, 0.0, -9.81 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #-------------------- # Initial conditions @@ -31,51 +31,51 @@ #---------------------- # Numerical parameters #---------------------- - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 24 - MIN_SIMPLE_ITERATIONS 3 + MIN_SIMPLE_ITERATIONS 3 #-------------------------- # Boundary conditions #-------------------------- -BOUNDARY_CONDITION TOP - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION BOTTOM - TYPE wall - VARIABLES u v w q - VALUES 0.0 0.0 0.0 0 - -BOUNDARY_CONDITION SIDE - TYPE symmetry - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 - -BOUNDARY_CONDITION LEFT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 10 - -BOUNDARY_CONDITION RIGHT - TYPE wall - VARIABLES u v w t - VALUES 0.0 0.0 0.0 30 + BOUNDARY_CONDITION TOP + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION BOTTOM + TYPE wall + VARIABLES u v w q + VALUES 0.0 0.0 0.0 0 + + BOUNDARY_CONDITION SIDE + TYPE symmetry + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 + + BOUNDARY_CONDITION LEFT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 10 + + BOUNDARY_CONDITION RIGHT + TYPE wall + VARIABLES u v w t + VALUES 0.0 0.0 0.0 30 diff --git a/Tests/Rans/Backstep_Re_05100/control b/Tests/Rans/Backstep_Re_05100/control index ec777a76c..bc50a1758 100644 --- a/Tests/Rans/Backstep_Re_05100/control +++ b/Tests/Rans/Backstep_Re_05100/control @@ -1,11 +1,9 @@ Problem name (this line is a comment) - PROBLEM_NAME backstep + PROBLEM_NAME backstep - BACKUP_SAVE_INTERVAL 600 - RESULTS_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME backstep-ts000001.backup + BACKUP_SAVE_INTERVAL 600 + RESULTS_SAVE_INTERVAL 600 This line is a comment too, just like any which doesn't start with a keyword. Keywords are written all in upper case and ARE case sensitive! @@ -14,42 +12,40 @@ Problem name (this line is a comment) Time resolution - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 1800 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 1800 Monitoring - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.314 0.1 -0.038 - POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 - PRESSURE_DROPS 0.0 0.0 0.0 - MASS_FLOW_RATES 0.0 0.0 0.0 - + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.314 0.1 -0.038 + POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 + PRESSURE_DROPS 0.0 0.0 0.0 + MASS_FLOW_RATES 0.0 0.0 0.0 Physical part - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.43e-5 - - TURBULENCE_MODEL rsm_manceau_hanjalic - TURBULENCE_MODEL_VARIANT stabilized + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.43e-5 + TURBULENCE_MODEL rsm_manceau_hanjalic + TURBULENCE_MODEL_VARIANT stabilized Numerical part - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + TIME_INTEGRATION_SCHEME linear + + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_TURBULENCE smart + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 Initial values diff --git a/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Cf_St.f90 b/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Cf_St.f90 index 3219bc4e0..0dd1d7d07 100644 --- a/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Cf_St.f90 +++ b/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Cf_St.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Backstep_Cf_St(Flow, Turb, ts) + subroutine User_Mod_Backstep_Cf_St(Flow, Turb) !------------------------------------------------------------------------------! ! Subroutine extracts skin friction coefficient and Stanton number for ! ! backstep case. ! @@ -25,7 +25,6 @@ subroutine User_Mod_Backstep_Cf_St(Flow, Turb, ts) real :: kin_vis, u_tan, u_tau, tau_wall real :: dens_const, visc_const real :: capa_const, cond_const - integer :: ts !==============================================================================! ! Take aliases @@ -36,15 +35,15 @@ subroutine User_Mod_Backstep_Cf_St(Flow, Turb, ts) t => Flow % t ! Get constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) !----------------------------------! ! Read "x_coordinate.dat" file ! !----------------------------------! - if(this_proc < 2) print *, '# Now reading the file: x_coordinate.dat ' + if(First_Proc()) print *, '# Now reading the file: x_coordinate.dat ' open(9, file='x_coordinate.dat') ! Read the number of probes @@ -131,34 +130,37 @@ subroutine User_Mod_Backstep_Cf_St(Flow, Turb, ts) ! Average over all processors do pl=1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(um_p(pl)) - call Comm_Mod_Global_Sum_Real(vm_p(pl)) - call Comm_Mod_Global_Sum_Real(wm_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uv_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(vw_p(pl)) - call Comm_Mod_Global_Sum_Real(v1_p(pl)) - call Comm_Mod_Global_Sum_Real(v2_p(pl)) - call Comm_Mod_Global_Sum_Real(v3_p(pl)) - call Comm_Mod_Global_Sum_Real(v4_p(pl)) - call Comm_Mod_Global_Sum_Real(v5_p(pl)) + call Global % Sum_Int(n_count(pl)) + call Global % Sum_Real(um_p(pl)) + call Global % Sum_Real(vm_p(pl)) + call Global % Sum_Real(wm_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uv_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(vw_p(pl)) + call Global % Sum_Real(v1_p(pl)) + call Global % Sum_Real(v2_p(pl)) + call Global % Sum_Real(v3_p(pl)) + call Global % Sum_Real(v4_p(pl)) + call Global % Sum_Real(v5_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(tm_p(pl)) - call Comm_Mod_Global_Sum_Real(tt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(tm_p(pl)) + call Global % Sum_Real(tt_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call File % Set_Name(result_name, time_step=ts, appendix='-cf-st', extension='.dat') + call File % Set_Name(result_name, & + time_step = Time % Curr_Dt(), & + appendix = '-cf-st', & + extension = '.dat') call File % Open_For_Writing_Ascii(result_name, fu) write(fu,*) '# x, Cf, St, U, T, yPlus' @@ -214,6 +216,6 @@ subroutine User_Mod_Backstep_Cf_St(Flow, Turb, ts) deallocate(wt_p) end if - if(this_proc < 2) write(*,*) '# Finished with User_Backstep_Cf_St' + if(First_Proc()) write(*,*) '# Finished with User_Backstep_Cf_St' end subroutine diff --git a/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Profiles.f90 b/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Profiles.f90 index 49a6d5475..3abfe883c 100644 --- a/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Profiles.f90 +++ b/Tests/Rans/Backstep_Re_28000/User_Mod/Backstep_Profiles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Backstep_Profiles(Flow, Turb, ts) + subroutine User_Mod_Backstep_Profiles(Flow, Turb) !------------------------------------------------------------------------------! ! Description !------------------------------------------------------------------------------! @@ -12,7 +12,7 @@ subroutine User_Mod_Backstep_Profiles(Flow, Turb, ts) type(Var_Type), pointer :: kin, eps, zeta, f22 type(Grid_Type), pointer :: Grid integer :: n_prob, pl, c, idumm, i, count, & - k, c1, c2, s, n_hor, fu, ts + k, c1, c2, s, n_hor, fu character(SL) :: coord_name, result_name real, parameter :: u_b = 11.3, h = 0.038 real, allocatable :: x1_p(:), x2_p(:), lnum(:), z_p(:), & @@ -40,7 +40,7 @@ subroutine User_Mod_Backstep_Profiles(Flow, Turb, ts) inquire(file='horizontal_positions.dat', exist=there) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "#============================================================" print *, "# In order to extract profiles and write them in ascii files " print *, "# the code has to read ascii file in which positions of the " @@ -71,11 +71,11 @@ subroutine User_Mod_Backstep_Profiles(Flow, Turb, ts) !------------------! ! Read 1d file ! !------------------! - if(this_proc < 2) print *, '# Now reading the file:', coord_name + if(First_Proc()) print *, '# Now reading the file:', coord_name inquire( file=coord_name, exist=there ) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "===========================================================" print *, "In order to extract profiles and write them in ascii files " print *, "the code has to read cell-faces coordinates " @@ -159,65 +159,65 @@ subroutine User_Mod_Backstep_Profiles(Flow, Turb, ts) ! Average over all processors do pl=1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(um_p(pl)) - call Comm_Mod_Global_Sum_Real(vm_p(pl)) - call Comm_Mod_Global_Sum_Real(wm_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uv_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(vw_p(pl)) - call Comm_Mod_Global_Sum_Real(v1_p(pl)) - call Comm_Mod_Global_Sum_Real(v2_p(pl)) - call Comm_Mod_Global_Sum_Real(v3_p(pl)) - call Comm_Mod_Global_Sum_Real(v4_p(pl)) - call Comm_Mod_Global_Sum_Real(v5_p(pl)) + call Global % Sum_Int(n_count(pl)) + call Global % Sum_Real(um_p(pl)) + call Global % Sum_Real(vm_p(pl)) + call Global % Sum_Real(wm_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uv_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(vw_p(pl)) + call Global % Sum_Real(v1_p(pl)) + call Global % Sum_Real(v2_p(pl)) + call Global % Sum_Real(v3_p(pl)) + call Global % Sum_Real(v4_p(pl)) + call Global % Sum_Real(v5_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(tm_p(pl)) - call Comm_Mod_Global_Sum_Real(tt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(tm_p(pl)) + call Global % Sum_Real(tt_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do if(k == 1) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-0.35h', extension='.h.dat') else if(k == 2) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-1.68h', extension='.h.dat') else if(k == 3) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-2.30h', extension='.h.dat') else if(k == 4) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-3.15h', extension='.h.dat') else if(k == 5) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-3.92h', extension='.h.dat') else if(k == 6) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-4.70h', extension='.h.dat') else if(k == 7) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-5.20h', extension='.h.dat') else if(k == 8) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-6.50h', extension='.h.dat') else if(k == 9) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-8.90h', extension='.h.dat') else if(k == 10) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-26.0h', extension='.h.dat') else if(k == 11) then - call File % Set_Name(result_name, time_step=ts, & + call File % Set_Name(result_name, time_step=Time % Curr_Dt(), & appendix='-52.0h', extension='.h.dat') end if @@ -304,6 +304,6 @@ subroutine User_Mod_Backstep_Profiles(Flow, Turb, ts) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Backstep_Profiles' + if(First_Proc()) print *, '# Finished with User_Backstep_Profiles' end subroutine diff --git a/Tests/Rans/Backstep_Re_28000/User_Mod/Save_Results.f90 b/Tests/Rans/Backstep_Re_28000/User_Mod/Save_Results.f90 index 71ca0c756..9966dc505 100644 --- a/Tests/Rans/Backstep_Re_28000/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Backstep_Re_28000/User_Mod/Save_Results.f90 @@ -1,8 +1,8 @@ -include '../User_Mod/Backstep_Profiles.f90' -include '../User_Mod/Backstep_Cf_St.f90' +#include "Backstep_Profiles.f90" +#include "Backstep_Cf_St.f90" !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! Calls User_Backstep_Profiles and User_Backstep_Cf_St functions. ! !------------------------------------------------------------------------------! @@ -12,14 +12,13 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return - call User_Mod_Backstep_Profiles(Flow, Turb, ts) - call User_Mod_Backstep_Cf_St (Flow, Turb, ts) + call User_Mod_Backstep_Profiles(Flow, Turb) + call User_Mod_Backstep_Cf_St (Flow, Turb) end subroutine diff --git a/Tests/Rans/Backstep_Re_28000/control b/Tests/Rans/Backstep_Re_28000/control index f0435654a..e8c259edb 100644 --- a/Tests/Rans/Backstep_Re_28000/control +++ b/Tests/Rans/Backstep_Re_28000/control @@ -1,66 +1,64 @@ Problem - PROBLEM_NAME backstep + PROBLEM_NAME backstep Time integration - NUMBER_OF_TIME_STEPS 5000 - TIME_STEP 0.001 + NUMBER_OF_TIME_STEPS 5000 + TIME_STEP 0.001 Saving intervals - RESULTS_SAVE_INTERVAL 1000 - BACKUP_SAVE_INTERVAL 1000 -# LOAD_BACKUP_NAME backstep-ts000647.backup - + RESULTS_SAVE_INTERVAL 1000 + BACKUP_SAVE_INTERVAL 1000 Monitoring - NUMBER_OF_MONITORING_POINTS 9 - MONITORING_POINT_001 0.01 0.1 -0.028 - MONITORING_POINT_002 0.03 0.1 -0.028 - MONITORING_POINT_003 0.09 0.1 -0.028 - MONITORING_POINT_004 0.12 0.1 -0.028 - MONITORING_POINT_005 0.15 0.1 -0.028 - MONITORING_POINT_006 0.17 0.1 -0.028 - MONITORING_POINT_007 0.19 0.1 -0.028 - MONITORING_POINT_008 0.2 0.1 -0.028 - MONITORING_POINT_009 0.22 0.1 -0.028 - POINT_FOR_MONITORING_PLANES 0.1 0.01 0.05 + NUMBER_OF_MONITORING_POINTS 9 + MONITORING_POINT_001 0.01 0.1 -0.028 + MONITORING_POINT_002 0.03 0.1 -0.028 + MONITORING_POINT_003 0.09 0.1 -0.028 + MONITORING_POINT_004 0.12 0.1 -0.028 + MONITORING_POINT_005 0.15 0.1 -0.028 + MONITORING_POINT_006 0.17 0.1 -0.028 + MONITORING_POINT_007 0.19 0.1 -0.028 + MONITORING_POINT_008 0.2 0.1 -0.028 + MONITORING_POINT_009 0.22 0.1 -0.028 + POINT_FOR_MONITORING_PLANES 0.1 0.01 0.05 Physics - HEAT_TRANSFER yes - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 2.2e-5 - DYNAMIC_VISCOSITY 1.567e-5 - HEAT_CAPACITY 1.0 - TURBULENCE_MODEL k_eps_zeta_f + HEAT_TRANSFER yes + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 2.2e-5 + DYNAMIC_VISCOSITY 1.567e-5 + HEAT_CAPACITY 1.0 + TURBULENCE_MODEL k_eps_zeta_f Numerics - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - MAX_SIMPLE_ITERATIONS 8 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + MAX_SIMPLE_ITERATIONS 8 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky Linear solvers - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 40 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 - MAX_ITERATIONS_FOR_TURBULENCE_SOLVER 40 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 40 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_TURBULENCE_SOLVER 40 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 Initial values INITIAL_CONDITION diff --git a/Tests/Rans/Channel_Re_Tau_590/Long_Domain/control b/Tests/Rans/Channel_Re_Tau_590/Long_Domain/control index 0a0bc0262..1396db842 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Long_Domain/control +++ b/Tests/Rans/Channel_Re_Tau_590/Long_Domain/control @@ -1,74 +1,68 @@ #-------------------- # Problem definition #-------------------- - PROBLEM_NAME chan - HEAT_TRANSFER yes + PROBLEM_NAME chan + HEAT_TRANSFER yes #--------------- # Time stepping #--------------- - - TIME_STEP 0.6 - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME chan-ts000600.backup + TIME_STEP 0.6 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 5 + MONITORING_POINT_001 0.5 0.5 1.0 + MONITORING_POINT_002 0.5 0.5 0.001 + MONITORING_POINT_003 0.5 0.5 0.01 + MONITORING_POINT_004 0.5 0.5 0.1 + MONITORING_POINT_005 0.5 0.5 0.2 - NUMBER_OF_MONITORING_POINTS 5 - MONITORING_POINT_001 0.5 0.5 1.0 - MONITORING_POINT_002 0.5 0.5 0.001 - MONITORING_POINT_003 0.5 0.5 0.01 - MONITORING_POINT_004 0.5 0.5 0.1 - MONITORING_POINT_005 0.5 0.5 0.2 - - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.514 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.514 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 1.0e-4 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 1.0e-4 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_TURBULENCE smart - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_TURBULENCE smart + MIN_SIMPLE_ITERATIONS 3 - MIN_SIMPLE_ITERATIONS 3 #------------------------ # Linear solver settings #------------------------ - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-7 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Save_Results.f90 b/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Save_Results.f90 index 04c4619bd..f387c2300 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -37,7 +36,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -49,30 +48,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Turb % Alias_Heat_Fluxes (ut, vt, wt) ! Take constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') ! Set file names for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -162,33 +161,33 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p(pl)) - call Comm_Mod_Global_Sum_Real(eps_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) + call Global % Sum_Real(kin_p(pl)) + call Global % Sum_Real(eps_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uw_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p(pl)) - call Comm_Mod_Global_Sum_Real(tt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p(pl)) + call Global % Sum_Real(tt_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -220,7 +219,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) / wall_p(1)) & / dens_const) if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if @@ -236,12 +235,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux > 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if do s = 1, Grid % n_faces @@ -259,11 +258,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -420,6 +419,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) write(6, *) '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) write(6, *) '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Source.f90 b/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Source.f90 index f8fdf165f..c5b8d5988 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Source.f90 +++ b/Tests/Rans/Channel_Re_Tau_590/Rsm/User_Mod/Source.f90 @@ -38,7 +38,7 @@ subroutine User_Mod_Source(Flow, phi, a, b) ! Set source for temperature ! !-------------------------------! if( phi % name .eq. 'T' ) then - do c = 1, Grid % n_cells + do c = Cells_In_Domain() b(c) = b(c) - u % n(c) / bulk % u & * Flow % heat / bulk % area_x & * Grid % vol(c) / Grid % per_x diff --git a/Tests/Rans/Channel_Re_Tau_590/Rsm/control b/Tests/Rans/Channel_Re_Tau_590/Rsm/control index 53ec98e4d..f4c8b892d 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Rsm/control +++ b/Tests/Rans/Channel_Re_Tau_590/Rsm/control @@ -1,96 +1,88 @@ #-------------------- # Problem definition #-------------------- - PROBLEM_NAME chan - HEAT_TRANSFER yes - TURBULENT_HEAT_FLUX_MODEL ggdh + PROBLEM_NAME chan + HEAT_TRANSFER yes + TURBULENT_HEAT_FLUX_MODEL ggdh - - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 2.32 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 2.32 0.0 0.0 #--------------- # Time stepping #--------------- + TIME_STEP 0.5 + NUMBER_OF_TIME_STEPS 2400 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 - TIME_STEP 0.5 - NUMBER_OF_TIME_STEPS 2400 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - +# Keep the line below, it is needed by test_build.sh script for backup tests # LOAD_BACKUP_NAME chan-ts001800.backup #------------------- -# Monitoring points +# Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.0 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.0 - - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4e-4 - DYNAMIC_VISCOSITY 1.0e-4 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4e-4 + DYNAMIC_VISCOSITY 1.0e-4 + HEAT_CAPACITY 1.0 # TURBULENCE_MODEL rsm_manceau_hanjalic - TURBULENCE_MODEL rsm_hanjalic_jakirlic + TURBULENCE_MODEL rsm_hanjalic_jakirlic - TURBULENCE_MODEL_VARIANT none + TURBULENCE_MODEL_VARIANT none # TURBULENCE_MODEL_VARIANT stabilized #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-7 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 #-------------------- # Initial conditions #-------------------- - - INITIAL_CONDITION - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.1 0.0 0.0 20.0 0.005 0.005 0.005 0.00 0.001 0.0 0.002 0.1 + INITIAL_CONDITION + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.1 0.0 0.0 20 0.005 0.005 0.005 0.00 0.001 0.0 0.002 0.1 #--------------------- # Boundary conditions #--------------------- - - BOUNDARY_CONDITION top_wall - TYPE wall - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - - BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 diff --git a/Tests/Rans/Channel_Re_Tau_590/Rsm/control_air b/Tests/Rans/Channel_Re_Tau_590/Rsm/control_air index 24188202d..7baf937e1 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Rsm/control_air +++ b/Tests/Rans/Channel_Re_Tau_590/Rsm/control_air @@ -1,94 +1,84 @@ #-------------------- # Problem definition #-------------------- - PROBLEM_NAME chan - HEAT_TRANSFER yes + PROBLEM_NAME chan + HEAT_TRANSFER yes - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 2.32 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 2.32 0.0 0.0 #--------------- # Time stepping #--------------- - - TIME_STEP 0.5 - NUMBER_OF_TIME_STEPS 3000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME chan-ts003000.backup + TIME_STEP 0.5 + NUMBER_OF_TIME_STEPS 3000 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.0 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.0 - - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4e-4 + DYNAMIC_VISCOSITY 1.0e-4 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4e-4 - DYNAMIC_VISCOSITY 1.0e-4 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL rsm_manceau_hanjalic + TURBULENCE_MODEL rsm_manceau_hanjalic # TURBULENCE_MODEL rsm_hanjalic_jakirlic - TURBULENCE_MODEL_VARIANT none + TURBULENCE_MODEL_VARIANT none # TURBULENCE_MODEL_VARIANT stabilized #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions #-------------------- - - INITIAL_CONDITION - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.001 0.0 0.0 20.0 0.0001 0.0001 0.0001 0.00 0.0001 0.0 0.0002 0.1 + INITIAL_CONDITION + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.001 0.0 0.0 20.0 0.0001 0.0001 0.0001 0.00 0.0001 0.0 0.0002 0.1 #--------------------- # Boundary conditions #--------------------- - - BOUNDARY_CONDITION top_wall - TYPE wall - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - - BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 diff --git a/Tests/Rans/Channel_Re_Tau_590/Rsm/control_water b/Tests/Rans/Channel_Re_Tau_590/Rsm/control_water index ecc85fbcb..9ba28ee19 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Rsm/control_water +++ b/Tests/Rans/Channel_Re_Tau_590/Rsm/control_water @@ -1,94 +1,87 @@ #-------------------- # Problem definition #-------------------- - PROBLEM_NAME chan - HEAT_TRANSFER yes + PROBLEM_NAME chan + HEAT_TRANSFER yes - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 20.32 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 20.32 0.0 0.0 #--------------- # Time stepping #--------------- - - TIME_STEP 3.5 - NUMBER_OF_TIME_STEPS 3000 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 3.5 + NUMBER_OF_TIME_STEPS 3000 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 # LOAD_BACKUP_NAME chan-ts003000.backup #------------------- # Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 0.0 - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 0.0 - - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- + MASS_DENSITY 998.0 + THERMAL_CONDUCTIVITY 0.587 + DYNAMIC_VISCOSITY 1.0e-3 + HEAT_CAPACITY 4187.0 - MASS_DENSITY 998.0 - THERMAL_CONDUCTIVITY 0.587 - DYNAMIC_VISCOSITY 1.0e-3 - HEAT_CAPACITY 4187.0 - - TURBULENCE_MODEL rsm_manceau_hanjalic + TURBULENCE_MODEL rsm_manceau_hanjalic # TURBULENCE_MODEL rsm_hanjalic_jakirlic - TURBULENCE_MODEL_VARIANT none + TURBULENCE_MODEL_VARIANT none # TURBULENCE_MODEL_VARIANT stabilized #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions #-------------------- - - INITIAL_CONDITION - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.001 0.0 0.0 20.0 0.0001 0.0001 0.0001 0.00 0.0001 0.0 0.0002 0.1 + INITIAL_CONDITION + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.001 0.0 0.0 20.0 0.0001 0.0001 0.0001 0.00 0.0001 0.0 0.0002 0.1 #--------------------- # Boundary conditions #--------------------- - - BOUNDARY_CONDITION top_wall - TYPE wall - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 - - BOUNDARY_CONDITION bottom_wall - TYPE wall - VARIABLES u v w t uu vv ww uv uw vw eps f22 - VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + BOUNDARY_CONDITION top_wall + TYPE wall + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 + + BOUNDARY_CONDITION bottom_wall + TYPE wall + VARIABLES u v w t uu vv ww uv uw vw eps f22 + VALUES 0.0 0.0 0.0 22 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 diff --git a/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 b/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 index 82d4a704a..8f430649f 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -36,7 +35,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -48,30 +47,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Turb % Alias_Heat_Fluxes (ut, vt, wt) ! Take constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') ! Set file name for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -170,36 +169,35 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p (pl)) - call Comm_Mod_Global_Sum_Real(eps_p (pl)) - call Comm_Mod_Global_Sum_Real(uw_p (pl)) - call Comm_Mod_Global_Sum_Real(vis_t_p (pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(kin_p (pl)) + call Global % Sum_Real(eps_p (pl)) + call Global % Sum_Real(uw_p (pl)) + call Global % Sum_Real(vis_t_p (pl)) + call Global % Sum_Real(y_plus_p(pl)) - call Comm_Mod_Global_Sum_Real(f22_p (pl)) - call Comm_Mod_Global_Sum_Real(zeta_p(pl)) + call Global % Sum_Real(f22_p (pl)) + call Global % Sum_Real(zeta_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p (pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p (pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -239,7 +237,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if @@ -255,12 +253,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux> 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if do s = 1, Grid % n_faces @@ -278,11 +276,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -457,6 +455,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) write(6, *) '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) write(6, *) '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/control b/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/control index d4a6480b1..a7d43a0a6 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/control +++ b/Tests/Rans/Channel_Re_Tau_590/Stretched_Mesh/control @@ -1,78 +1,71 @@ #-------------------- # Problem definition #-------------------- + PROBLEM_NAME chan + HEAT_TRANSFER yes - PROBLEM_NAME chan - - HEAT_TRANSFER yes - - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 0.2 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 0.2 0.0 0.0 #--------------- # Time stepping #--------------- - - TIME_STEP 1.0 - NUMBER_OF_TIME_STEPS 7200 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - -# LOAD_BACKUP_NAME chan-ts001800.backup + TIME_STEP 1.0 + NUMBER_OF_TIME_STEPS 7200 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 5 + MONITORING_POINT_001 0.5 0.5 1.0 + MONITORING_POINT_002 0.5 0.5 0.001 + MONITORING_POINT_003 0.5 0.5 0.01 + MONITORING_POINT_004 0.5 0.5 0.1 + MONITORING_POINT_005 0.5 0.5 0.2 - NUMBER_OF_MONITORING_POINTS 5 - MONITORING_POINT_001 0.5 0.5 1.0 - MONITORING_POINT_002 0.5 0.5 0.001 - MONITORING_POINT_003 0.5 0.5 0.01 - MONITORING_POINT_004 0.5 0.5 0.1 - MONITORING_POINT_005 0.5 0.5 0.2 - - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.514 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.514 #---------------------------------------- # Fluid properties # Dry air at 27oC in SI units #---------------------------------------- - MASS_DENSITY 1.177 - DYNAMIC_VISCOSITY 1.846e-5 - - THERMAL_CONDUCTIVITY 2.6240e-2 - HEAT_CAPACITY 1000.0 + MASS_DENSITY 1.177 + DYNAMIC_VISCOSITY 1.846e-5 + THERMAL_CONDUCTIVITY 2.6240e-2 + HEAT_CAPACITY 1000.0 #---------------------------------------- # Physical models #---------------------------------------- - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 #-------------------- # Initial conditions diff --git a/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/User_Mod/Save_Results.f90 b/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/User_Mod/Save_Results.f90 index 86fdaa2ef..adef25453 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -36,7 +35,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -48,30 +47,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Turb % Alias_Heat_Fluxes (ut, vt, wt) ! Take constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') ! Set file name for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1d file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -170,36 +169,35 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p (pl)) - call Comm_Mod_Global_Sum_Real(eps_p (pl)) - call Comm_Mod_Global_Sum_Real(uw_p (pl)) - call Comm_Mod_Global_Sum_Real(vis_t_p (pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(kin_p (pl)) + call Global % Sum_Real(eps_p (pl)) + call Global % Sum_Real(uw_p (pl)) + call Global % Sum_Real(vis_t_p (pl)) + call Global % Sum_Real(y_plus_p(pl)) - call Comm_Mod_Global_Sum_Real(f22_p (pl)) - call Comm_Mod_Global_Sum_Real(zeta_p(pl)) + call Global % Sum_Real(f22_p (pl)) + call Global % Sum_Real(zeta_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p (pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p (pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -239,7 +237,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if @@ -255,12 +253,12 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux> 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if do s = 1, Grid % n_faces @@ -278,11 +276,11 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if end do - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -457,6 +455,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) write(6, *) '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) write(6, *) '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/control b/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/control index eda9b2333..c2a05713c 100644 --- a/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/control +++ b/Tests/Rans/Channel_Re_Tau_590/Uniform_Mesh/control @@ -1,83 +1,76 @@ #-------------------- # Problem definition #-------------------- + PROBLEM_NAME chan + HEAT_TRANSFER yes - PROBLEM_NAME chan - - HEAT_TRANSFER yes - - PRESSURE_DROPS 0.0036 0.0 0.0 - MASS_FLOW_RATES 0.2 0.0 0.0 + PRESSURE_DROPS 0.0036 0.0 0.0 + MASS_FLOW_RATES 0.2 0.0 0.0 #--------------- # Time stepping #--------------- + TIME_STEP 0.6 + NUMBER_OF_TIME_STEPS 1800 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 - TIME_STEP 0.6 - NUMBER_OF_TIME_STEPS 1800 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 - +# Keep the line below, it is needed by test_build.sh script for backup tests # LOAD_BACKUP_NAME chan-ts001800.backup #------------------- -# Monitoring points +# Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 5 + MONITORING_POINT_001 0.5 0.5 1.0 + MONITORING_POINT_002 0.5 0.5 0.001 + MONITORING_POINT_003 0.5 0.5 0.01 + MONITORING_POINT_004 0.5 0.5 0.1 + MONITORING_POINT_005 0.5 0.5 0.2 - NUMBER_OF_MONITORING_POINTS 5 - MONITORING_POINT_001 0.5 0.5 1.0 - MONITORING_POINT_002 0.5 0.5 0.001 - MONITORING_POINT_003 0.5 0.5 0.01 - MONITORING_POINT_004 0.5 0.5 0.1 - MONITORING_POINT_005 0.5 0.5 0.2 - - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.514 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.514 #---------------------------------------- # Fluid properties # Dry air at 27oC in SI units #---------------------------------------- - - MASS_DENSITY 1.177 - DYNAMIC_VISCOSITY 1.846e-5 - - THERMAL_CONDUCTIVITY 2.6240e-2 - HEAT_CAPACITY 1000.0 + MASS_DENSITY 1.177 + DYNAMIC_VISCOSITY 1.846e-5 + THERMAL_CONDUCTIVITY 2.6240e-2 + HEAT_CAPACITY 1000.0 #---------------------------------------- # Physical models #---------------------------------------- - - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + MIN_SIMPLE_ITERATIONS 3 - MIN_SIMPLE_ITERATIONS 3 #------------------------ # Linear solver settings #------------------------ - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-6 #-------------------- # Initial conditions diff --git a/Tests/Rans/Fuel_Bundle/control b/Tests/Rans/Fuel_Bundle/control index 026847ab5..7d67b1a96 100644 --- a/Tests/Rans/Fuel_Bundle/control +++ b/Tests/Rans/Fuel_Bundle/control @@ -1,41 +1,35 @@ Prologue - PROBLEM_NAME subflow -#LOAD_RESTART_NAME subflow-ts000001 + PROBLEM_NAME subflow Time stepping - NUMBER_OF_TIME_STEPS 1000 - TIME_STEP 1.e-1 - - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 - + NUMBER_OF_TIME_STEPS 1000 + TIME_STEP 1.e-1 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 Monitoring points and plane - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.034 0.034 0.05 - POINT_FOR_MONITORING_PLANES 0.015 0.051 0.05 - + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.034 0.034 0.05 + POINT_FOR_MONITORING_PLANES 0.015 0.051 0.05 Physical models - assuming T = 26 C - - units: [kg/m^3] - MASS_DENSITY 1.0 - - units: [m^2/s] - DYNAMIC_VISCOSITY 9e-8 + assuming T = 26 C + units: [kg/m^3] + MASS_DENSITY 1.0 - TURBULENCE_MODEL rsm_hanjalic_jakirlic - TURBULENCE_MODEL_VARIANT stabilized + units: [m^2/s] + DYNAMIC_VISCOSITY 9e-8 -units: [kg/s] - MASS_FLOW_RATES 0.0 0.0 0.0020975 + TURBULENCE_MODEL rsm_hanjalic_jakirlic + TURBULENCE_MODEL_VARIANT stabilized + units: [kg/s] + MASS_FLOW_RATES 0.0 0.0 0.0020975 Initial and boundary conditions @@ -55,32 +49,32 @@ Initial and boundary conditions Linear solver settings - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - PRESSURE_MOMENTUM_COUPLING simple - MAX_SIMPLE_ITERATIONS 12 - MIN_SIMPLE_ITERATIONS 5 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 20 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 - MAX_ITERATIONS_FOR_TURBULENCE_SOLVER 10 + PRESSURE_MOMENTUM_COUPLING simple + MAX_SIMPLE_ITERATIONS 12 + MIN_SIMPLE_ITERATIONS 5 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 20 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 + MAX_ITERATIONS_FOR_TURBULENCE_SOLVER 10 - TOLERANCE_FOR_MOMENTUM_SOLVER 1.0e-6 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.0e-6 - TOLERANCE_FOR_ENERGY_SOLVER 1.0e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.0e-8 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-8 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.0e-6 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.0e-6 + TOLERANCE_FOR_ENERGY_SOLVER 1.0e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.0e-8 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.0e-8 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.2 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.6 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.2 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.6 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - # after initialization from file you can use these schemes - #ADVECTION_SCHEME_FOR_MOMENTUM minmod - #ADVECTION_SCHEME_FOR_ENERGY smart - #ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM upwind + ADVECTION_SCHEME_FOR_ENERGY upwind + ADVECTION_SCHEME_FOR_TURBULENCE upwind - ADVECTION_SCHEME_FOR_MOMENTUM upwind - ADVECTION_SCHEME_FOR_ENERGY upwind - ADVECTION_SCHEME_FOR_TURBULENCE upwind + # after initialization from file you can use these schemes + #ADVECTION_SCHEME_FOR_MOMENTUM minmod + #ADVECTION_SCHEME_FOR_ENERGY smart + #ADVECTION_SCHEME_FOR_TURBULENCE smart diff --git a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Nu.f90 b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Nu.f90 index 7124513a2..d2e6d1c65 100644 --- a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Nu.f90 +++ b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Nu.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) + subroutine User_Mod_Impinging_Jet_Nu(Turb) !------------------------------------------------------------------------------! ! The subroutine creates ASCII file with Nusselt number averaged ! ! in azimuthal direction. ! @@ -7,7 +7,6 @@ subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) implicit none !---------------------------------[Arguments]----------------------------------! type(Turb_Type), target :: Turb - integer, intent(in) :: ts ! time step !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow @@ -39,7 +38,7 @@ subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) !-----------------------------------! inquire(file='rad_coordinate.dat', exist=there) if(.not.there) then - if(this_proc < 2) then + if(First_Proc()) then print *, "#==========================================================" print *, "# In order to extract Nusselt number profile " print *, "# an ascii file with cell-faces coordinates has to be read." @@ -85,7 +84,7 @@ subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) if(c2 < 0) then - if(Grid % Bnd_Cond_Name(c2) .eq. 'LOWER_WALL') then + if(Grid % Bnd_Cond_Name_At_Cell(c2) .eq. 'LOWER_WALL') then r = sqrt(Grid % xc(c1)*Grid % xc(c1) + & Grid % yc(c1)*Grid % yc(c1)) + TINY if(r < rad_1(i+1) .and. & @@ -112,20 +111,20 @@ subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) ! Average over all processors ! !---------------------------------! do i = 1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(i)) + call Global % Sum_Int(n_count(i)) - call Comm_Mod_Global_Sum_Real(u_p(i)) - call Comm_Mod_Global_Sum_Real(v_p(i)) - call Comm_Mod_Global_Sum_Real(w_p(i)) + call Global % Sum_Real(u_p(i)) + call Global % Sum_Real(v_p(i)) + call Global % Sum_Real(w_p(i)) - call Comm_Mod_Global_Sum_Real(z_p(i)) - call Comm_Mod_Global_Sum_Real(tau_p(i)) - call Comm_Mod_Global_Sum_Real(q_p(i)) + call Global % Sum_Real(z_p(i)) + call Global % Sum_Real(tau_p(i)) + call Global % Sum_Real(q_p(i)) - call Comm_Mod_Global_Sum_Real(r_p(i)) - call Comm_Mod_Global_Sum_Real(t_p(i)) + call Global % Sum_Real(r_p(i)) + call Global % Sum_Real(t_p(i)) -! call Comm_Mod_Global_Sum_Real_Array(8, (/u_p (i), & +! call Global % Sum_Real_Array(8, (/u_p (i), & ! v_p (i), & ! w_p (i), & ! z_p (i), & @@ -147,16 +146,18 @@ subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) r_p(i) = r_p(i) / n_count(i) end if end do - call Comm_Mod_Wait + call Global % Wait !-----------------------------------! ! Write from one processor only ! !-----------------------------------! - if(this_proc < 2) then + if(First_Proc()) then ! Set the file name - call File % Set_Name(res_name, time_step=ts, & - appendix='-nu-utau', extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-nu-utau', & + extension = '.dat') call File % Open_For_Writing_Ascii(res_name, fu) ! Write the file out @@ -176,6 +177,6 @@ subroutine User_Mod_Impinging_Jet_Nu(Turb, ts) close(fu) end if - if(this_proc < 2) print *, '# Finished with Impinging_Jet_Nu' + if(First_Proc()) print *, '# Finished with Impinging_Jet_Nu' end subroutine diff --git a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Profiles.f90 b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Profiles.f90 index 9db362f58..3d790a4f5 100644 --- a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Profiles.f90 +++ b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Impinging_Jet_Profiles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Impinging_Jet_Profiles(Turb, ts) + subroutine User_Mod_Impinging_Jet_Profiles(Turb) !------------------------------------------------------------------------------! ! Subroutine reads the .1d file with wall normal coordinates and extracts ! ! solutions for comparison with corresponding experimental measurements. ! @@ -7,7 +7,6 @@ subroutine User_Mod_Impinging_Jet_Profiles(Turb, ts) implicit none !---------------------------------[Arguments]----------------------------------! type(Turb_Type), target :: Turb - integer, intent(in) :: ts ! time step !------------------------------[Local parameters]------------------------------! real, parameter :: U_AVER = 1.14 !-----------------------------------[Locals]-----------------------------------! @@ -74,43 +73,43 @@ subroutine User_Mod_Impinging_Jet_Profiles(Turb, ts) r1 = 0.0 r2 = 0.04 lnum = 0.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-0.0D', extension='.dat') else if(k .eq. 1) then r1 = 0.992 r2 = 1.0 lnum = 0.5 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-0.5D', extension='.dat') else if(k .eq. 2) then r1 = 2.0 r2 = 2.1500 lnum = 1.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-1.0D', extension='.dat') else if(k .eq. 3) then r1 = 2.9744 r2 = 3.0684 lnum = 1.5 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-1.5D', extension='.dat') else if(k .eq. 4) then r1 = 3.9098 r2 = 4.1433 lnum = 2.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-2.0D', extension='.dat') else if(k .eq. 5) then r1 = 0.4803200E+01 r2 = 0.5347000E+01 lnum = 2.5 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-2.5D', extension='.dat') else if(k .eq. 6) then r1 = 0.5876600E+01 r2 = 0.6000000E+01 lnum = 3.0 - call File % Set_Name(res_name, time_step=ts, & + call File % Set_Name(res_name, time_step=Time % Curr_Dt(), & appendix='-3.0D', extension='.dat') end if @@ -149,19 +148,19 @@ subroutine User_Mod_Impinging_Jet_Profiles(Turb, ts) ! Average over all processors ! !---------------------------------! do i = 1, n_prob - call Comm_Mod_Global_Sum_Int(n_count(i)) - - call Comm_Mod_Global_Sum_Real(u_p(i)) - call Comm_Mod_Global_Sum_Real(v_p(i)) - call Comm_Mod_Global_Sum_Real(w_p(i)) - call Comm_Mod_Global_Sum_Real(zm_p(i)) - - call Comm_Mod_Global_Sum_Real(kin_p(i)) - call Comm_Mod_Global_Sum_Real(eps_p(i)) - call Comm_Mod_Global_Sum_Real(vis_p(i)) - call Comm_Mod_Global_Sum_Real(zet_p(i)) - call Comm_Mod_Global_Sum_Real(f22_p(i)) - call Comm_Mod_Global_Sum_Real(t_p(i)) + call Global % Sum_Int(n_count(i)) + + call Global % Sum_Real(u_p(i)) + call Global % Sum_Real(v_p(i)) + call Global % Sum_Real(w_p(i)) + call Global % Sum_Real(zm_p(i)) + + call Global % Sum_Real(kin_p(i)) + call Global % Sum_Real(eps_p(i)) + call Global % Sum_Real(vis_p(i)) + call Global % Sum_Real(zet_p(i)) + call Global % Sum_Real(f22_p(i)) + call Global % Sum_Real(t_p(i)) end do do i = 1, n_prob @@ -182,7 +181,7 @@ subroutine User_Mod_Impinging_Jet_Profiles(Turb, ts) !-----------------------------------! ! Write from one processor only ! !-----------------------------------! - if(this_proc < 2) then + if(First_Proc()) then call File % Open_For_Writing_Ascii(res_name, fu) @@ -226,10 +225,10 @@ subroutine User_Mod_Impinging_Jet_Profiles(Turb, ts) t_p(:) = 0.0 zm_p(:) = 0.0 - if(this_proc < 2) print *, 'Finished with profile r/D = ', lnum + if(First_Proc()) print *, 'Finished with profile r/D = ', lnum end do ! end number of radius - if(this_proc < 2) write(*,*) 'Finished with User_Impinging_Jet_Profiles' + if(First_Proc()) write(*,*) 'Finished with User_Impinging_Jet_Profiles' end subroutine diff --git a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 index a02ccebf2..3998c990d 100644 --- a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/User_Mod/Save_Results.f90 @@ -1,8 +1,8 @@ -include '../User_Mod/Impinging_Jet_Nu.f90' -include '../User_Mod/Impinging_Jet_Profiles.f90' +#include "Impinging_Jet_Nu.f90" +#include "Impinging_Jet_Profiles.f90" !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! Calls User_Impinging_Jet_Nu and User_Impinging_Jet_Profile functions. ! !------------------------------------------------------------------------------! @@ -12,14 +12,13 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type) :: Turb type(Vof_Type) :: Vof type(Swarm_Type) :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return - call User_Mod_Impinging_Jet_Nu (Turb, ts) - call User_Mod_Impinging_Jet_Profiles(Turb, ts) + call User_Mod_Impinging_Jet_Nu (Turb) + call User_Mod_Impinging_Jet_Profiles(Turb) end subroutine diff --git a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/control b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/control index d1a578639..e132a4c37 100644 --- a/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/control +++ b/Tests/Rans/Impinging_Jet_2d_Distant_Re_23000/control @@ -1,82 +1,81 @@ #---------- # Prologue #---------- - PROBLEM_NAME jet - HEAT_TRANSFER yes + PROBLEM_NAME jet + HEAT_TRANSFER yes - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 3600 - MIN_SIMPLE_ITERATIONS 3 - MAX_SIMPLE_ITERATIONS 6 + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 3600 + MIN_SIMPLE_ITERATIONS 3 + MAX_SIMPLE_ITERATIONS 6 #------------------ # Saving intervals #------------------ - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 120 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 120 - # LOAD_BACKUP_NAME jet-ts000120.backup +# LOAD_BACKUP_NAME jet-ts000120.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 10 - MONITORING_POINT_001 0.0 0.0 0.001 - MONITORING_POINT_002 0.2 0.2 0.001 - MONITORING_POINT_003 0.4 0.4 0.05 - MONITORING_POINT_004 0.0 0.0 2.0 - MONITORING_POINT_005 0.0 0.0 2.5 - MONITORING_POINT_006 0.0 0.0 3.0 - MONITORING_POINT_007 0.0 0.0 3.5 - MONITORING_POINT_008 0.0 0.0 4.0 - MONITORING_POINT_009 0.0 0.0 4.5 - MONITORING_POINT_010 0.0 0.0 5.0 - - POINT_FOR_MONITORING_PLANES 0.17 0.17 1.51 + NUMBER_OF_MONITORING_POINTS 10 + MONITORING_POINT_001 0.0 0.0 0.001 + MONITORING_POINT_002 0.2 0.2 0.001 + MONITORING_POINT_003 0.4 0.4 0.05 + MONITORING_POINT_004 0.0 0.0 2.0 + MONITORING_POINT_005 0.0 0.0 2.5 + MONITORING_POINT_006 0.0 0.0 3.0 + MONITORING_POINT_007 0.0 0.0 3.5 + MONITORING_POINT_008 0.0 0.0 4.0 + MONITORING_POINT_009 0.0 0.0 4.5 + MONITORING_POINT_010 0.0 0.0 5.0 + + POINT_FOR_MONITORING_PLANES 0.17 0.17 1.51 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4e-4 + DYNAMIC_VISCOSITY 1.0e-4 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4e-4 - DYNAMIC_VISCOSITY 1.0e-4 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL k_eps_zeta_f -#TURBULENCE_MODEL k_eps + TURBULENCE_MODEL k_eps_zeta_f +# TURBULENCE_MODEL k_eps #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - POTENTIAL_INITIALIZATION yes + POTENTIAL_INITIALIZATION yes #------------------------ # Linear solver settings #------------------------ - LINEAR_SOLVERS petsc - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-7 + LINEAR_SOLVERS petsc + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-7 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 #-------------------- # Initial conditions @@ -89,37 +88,31 @@ # Boundary conditions #--------------------- BOUNDARY_CONDITION pipe_wall - TYPE wall VARIABLES u v w q kin eps zeta f22 VALUES 0.0 0.0 0.0 0.0 0.0 1.0e-3 0.0 0.0 BOUNDARY_CONDITION symmetry_plane - TYPE symmetry VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 1.0E-2 1.0E-3 6.6E-2 1.0e-3 BOUNDARY_CONDITION top_plane - TYPE pressure VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 -0.01 20.0 1.0E-4 1.0E-5 6.6E-4 1.0e-4 BOUNDARY_CONDITION lower_wall - TYPE wall VARIABLES u v w q kin eps zeta f22 VALUES 0.0 0.0 0.0 0.1 0.0 1.0e-3 0.0 0.0 BOUNDARY_CONDITION pipe_inlet - TYPE inflow VARIABLES rz u v w t kin eps zeta f22 FILE inlet_profile_zeta_re_23000.dat BOUNDARY_CONDITION cyl_outlet - TYPE pressure VARIABLES u v w t kin eps zeta f22 VALUES 0.0 0.0 0.0 20.0 1.0E-2 1.0E-3 6.6E-2 1.0e-3 diff --git a/Tests/Rans/Membrane/control.0 b/Tests/Rans/Membrane/control.0 index 1ed49869d..ad449f774 100644 --- a/Tests/Rans/Membrane/control.0 +++ b/Tests/Rans/Membrane/control.0 @@ -1,15 +1,15 @@ - NUMBER_OF_DOMAINS 3 + NUMBER_OF_DOMAINS 3 - NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 600 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.01 + TIME_STEP 0.01 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION upper membrane - BOUNDARY_CONDITIONS bottom top + INTERFACE_CONDITION upper membrane + BOUNDARY_CONDITIONS bottom top - INTERFACE_CONDITION membrane lower - BOUNDARY_CONDITIONS bottom top + INTERFACE_CONDITION membrane lower + BOUNDARY_CONDITIONS bottom top diff --git a/Tests/Rans/Membrane/control.1 b/Tests/Rans/Membrane/control.1 index b8e7bc5d8..9318c134d 100644 --- a/Tests/Rans/Membrane/control.1 +++ b/Tests/Rans/Membrane/control.1 @@ -1,53 +1,53 @@ #---------- # Prologue #---------- - PROBLEM_NAME upper - HEAT_TRANSFER yes - - #LOAD_BACKUP_NAME upper-ts000120.backup + PROBLEM_NAME upper + HEAT_TRANSFER yes #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0125 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0125 + + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0125 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0125 +# Keep the line below, it is needed by test_build.sh script for backup tests +# LOAD_BACKUP_NAME upper-ts000120.backup #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.025 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.025 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- - TIME_STEP 0.01 + TIME_STEP 0.01 - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Rans/Membrane/control.2 b/Tests/Rans/Membrane/control.2 index 9ae4f802a..c30c78443 100644 --- a/Tests/Rans/Membrane/control.2 +++ b/Tests/Rans/Membrane/control.2 @@ -1,53 +1,53 @@ #---------- # Prologue #---------- - PROBLEM_NAME lower - HEAT_TRANSFER yes - - #LOAD_BACKUP_NAME lower-ts000120.backup + PROBLEM_NAME lower + HEAT_TRANSFER yes #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 -0.2 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 -0.2 + + POINT_FOR_MONITORING_PLANES 0.0 0.0 -0.2 - POINT_FOR_MONITORING_PLANES 0.0 0.0 -0.2 +# Keep the line below, it is needed by test_build.sh script for backup tests +# LOAD_BACKUP_NAME lower-ts000120.backup #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.025 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.025 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- - TIME_STEP 0.01 + TIME_STEP 0.01 - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Rans/Membrane/control.3 b/Tests/Rans/Membrane/control.3 index 884983650..536b1e947 100644 --- a/Tests/Rans/Membrane/control.3 +++ b/Tests/Rans/Membrane/control.3 @@ -1,53 +1,50 @@ #---------- # Prologue #---------- - PROBLEM_NAME membrane - HEAT_TRANSFER yes - - #LOAD_BACKUP_NAME membrane-ts000120.backup + PROBLEM_NAME membrane + HEAT_TRANSFER yes #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 0.025 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0e-3 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 0.025 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0e-3 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - TIME_STEP 0.01 + TIME_STEP 0.01 - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 12 #-------------------- # Initial conditions diff --git a/Tests/Rans/Negative_Buoyant_Fountain/control-1 b/Tests/Rans/Negative_Buoyant_Fountain/control-1 index d66ff12e2..88504b40a 100644 --- a/Tests/Rans/Negative_Buoyant_Fountain/control-1 +++ b/Tests/Rans/Negative_Buoyant_Fountain/control-1 @@ -1,84 +1,83 @@ #---------- # Prologue #---------- - PROBLEM_NAME nbf - HEAT_TRANSFER yes + PROBLEM_NAME nbf + HEAT_TRANSFER yes - TIME_STEP 0.02 - NUMBER_OF_TIME_STEPS 36000 + TIME_STEP 0.02 + NUMBER_OF_TIME_STEPS 36000 #------------------ # Saving intervals #------------------ - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 2000 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 2000 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 12 - MONITORING_POINT_001 0.02 0.1 0.5 - MONITORING_POINT_002 0.02 0.3 0.5 - MONITORING_POINT_003 0.02 0.5 0.5 - MONITORING_POINT_004 0.24 0.1 0.5 - MONITORING_POINT_005 0.24 0.3 0.5 - MONITORING_POINT_006 0.24 0.5 0.5 - MONITORING_POINT_007 0.02 0.1 1.5 - MONITORING_POINT_008 0.02 0.3 1.5 - MONITORING_POINT_009 0.02 0.5 1.5 - MONITORING_POINT_010 0.24 0.1 1.5 - MONITORING_POINT_011 0.24 0.3 1.5 - MONITORING_POINT_012 0.24 0.5 1.5 - - POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 + NUMBER_OF_MONITORING_POINTS 12 + MONITORING_POINT_001 0.02 0.1 0.5 + MONITORING_POINT_002 0.02 0.3 0.5 + MONITORING_POINT_003 0.02 0.5 0.5 + MONITORING_POINT_004 0.24 0.1 0.5 + MONITORING_POINT_005 0.24 0.3 0.5 + MONITORING_POINT_006 0.24 0.5 0.5 + MONITORING_POINT_007 0.02 0.1 1.5 + MONITORING_POINT_008 0.02 0.3 1.5 + MONITORING_POINT_009 0.02 0.5 1.5 + MONITORING_POINT_010 0.24 0.1 1.5 + MONITORING_POINT_011 0.24 0.3 1.5 + MONITORING_POINT_012 0.24 0.5 1.5 + + POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 #----------------- # Physical models #----------------- + MASS_DENSITY 1000.0 + HEAT_CAPACITY 4184.0 + DYNAMIC_VISCOSITY 0.0010005 + THERMAL_CONDUCTIVITY 0.59803 + VOLUME_EXPANSION_COEFFICIENT 0.000385 + REFERENCE_TEMPERATURE 0.0 - MASS_DENSITY 1000.0 - HEAT_CAPACITY 4184.0 - DYNAMIC_VISCOSITY 0.0010005 - THERMAL_CONDUCTIVITY 0.59803 - VOLUME_EXPANSION_COEFFICIENT 0.000385 - REFERENCE_TEMPERATURE 0.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f # TURBULENCE_MODEL k_eps #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 - - MIN_SIMPLE_ITERATIONS 5 - MAX_SIMPLE_ITERATIONS 20 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 + + MIN_SIMPLE_ITERATIONS 5 + MAX_SIMPLE_ITERATIONS 20 #-------------------- # Initial conditions diff --git a/Tests/Rans/Negative_Buoyant_Fountain/control-2 b/Tests/Rans/Negative_Buoyant_Fountain/control-2 index 3d4242280..209662a7a 100644 --- a/Tests/Rans/Negative_Buoyant_Fountain/control-2 +++ b/Tests/Rans/Negative_Buoyant_Fountain/control-2 @@ -1,86 +1,83 @@ #---------- # Prologue #---------- - PROBLEM_NAME nbf - HEAT_TRANSFER yes + PROBLEM_NAME nbf + HEAT_TRANSFER yes - TIME_STEP 0.02 - NUMBER_OF_TIME_STEPS 36000 + TIME_STEP 0.02 + NUMBER_OF_TIME_STEPS 36000 #------------------ # Saving intervals #------------------ - RESULTS_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 600 - - LOAD_BACKUP_NAME nbf-ts004000.backup + RESULTS_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 12 - MONITORING_POINT_001 0.02 0.1 0.5 - MONITORING_POINT_002 0.02 0.3 0.5 - MONITORING_POINT_003 0.02 0.5 0.5 - MONITORING_POINT_004 0.24 0.1 0.5 - MONITORING_POINT_005 0.24 0.3 0.5 - MONITORING_POINT_006 0.24 0.5 0.5 - MONITORING_POINT_007 0.02 0.1 1.5 - MONITORING_POINT_008 0.02 0.3 1.5 - MONITORING_POINT_009 0.02 0.5 1.5 - MONITORING_POINT_010 0.24 0.1 1.5 - MONITORING_POINT_011 0.24 0.3 1.5 - MONITORING_POINT_012 0.24 0.5 1.5 - - POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 + NUMBER_OF_MONITORING_POINTS 12 + MONITORING_POINT_001 0.02 0.1 0.5 + MONITORING_POINT_002 0.02 0.3 0.5 + MONITORING_POINT_003 0.02 0.5 0.5 + MONITORING_POINT_004 0.24 0.1 0.5 + MONITORING_POINT_005 0.24 0.3 0.5 + MONITORING_POINT_006 0.24 0.5 0.5 + MONITORING_POINT_007 0.02 0.1 1.5 + MONITORING_POINT_008 0.02 0.3 1.5 + MONITORING_POINT_009 0.02 0.5 1.5 + MONITORING_POINT_010 0.24 0.1 1.5 + MONITORING_POINT_011 0.24 0.3 1.5 + MONITORING_POINT_012 0.24 0.5 1.5 + + POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 #----------------- # Physical models #----------------- + MASS_DENSITY 1000.0 + HEAT_CAPACITY 4184.0 + DYNAMIC_VISCOSITY 0.0010005 + THERMAL_CONDUCTIVITY 0.59803 + VOLUME_EXPANSION_COEFFICIENT 0.000385 + REFERENCE_TEMPERATURE 0.0 - MASS_DENSITY 1000.0 - HEAT_CAPACITY 4184.0 - DYNAMIC_VISCOSITY 0.0010005 - THERMAL_CONDUCTIVITY 0.59803 - VOLUME_EXPANSION_COEFFICIENT 0.000385 - REFERENCE_TEMPERATURE 0.0 - - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f # TURBULENCE_MODEL k_eps #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 - - MIN_SIMPLE_ITERATIONS 5 - MAX_SIMPLE_ITERATIONS 20 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 + + MIN_SIMPLE_ITERATIONS 5 + MAX_SIMPLE_ITERATIONS 20 #-------------------- # Initial conditions diff --git a/Tests/Rans/Negative_Buoyant_Fountain/control-3 b/Tests/Rans/Negative_Buoyant_Fountain/control-3 index 5b00634e6..675f43d49 100644 --- a/Tests/Rans/Negative_Buoyant_Fountain/control-3 +++ b/Tests/Rans/Negative_Buoyant_Fountain/control-3 @@ -1,86 +1,85 @@ #---------- # Prologue #---------- - PROBLEM_NAME nbf - HEAT_TRANSFER yes + PROBLEM_NAME nbf + HEAT_TRANSFER yes - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 24000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 24000 #------------------ # Saving intervals #------------------ - RESULTS_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 600 + RESULTS_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME nbf-ts016200.backup + LOAD_BACKUP_NAME nbf-ts016200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 12 - MONITORING_POINT_001 0.02 0.1 0.5 - MONITORING_POINT_002 0.02 0.3 0.5 - MONITORING_POINT_003 0.02 0.5 0.5 - MONITORING_POINT_004 0.24 0.1 0.5 - MONITORING_POINT_005 0.24 0.3 0.5 - MONITORING_POINT_006 0.24 0.5 0.5 - MONITORING_POINT_007 0.02 0.1 1.5 - MONITORING_POINT_008 0.02 0.3 1.5 - MONITORING_POINT_009 0.02 0.5 1.5 - MONITORING_POINT_010 0.24 0.1 1.5 - MONITORING_POINT_011 0.24 0.3 1.5 - MONITORING_POINT_012 0.24 0.5 1.5 - - POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 + NUMBER_OF_MONITORING_POINTS 12 + MONITORING_POINT_001 0.02 0.1 0.5 + MONITORING_POINT_002 0.02 0.3 0.5 + MONITORING_POINT_003 0.02 0.5 0.5 + MONITORING_POINT_004 0.24 0.1 0.5 + MONITORING_POINT_005 0.24 0.3 0.5 + MONITORING_POINT_006 0.24 0.5 0.5 + MONITORING_POINT_007 0.02 0.1 1.5 + MONITORING_POINT_008 0.02 0.3 1.5 + MONITORING_POINT_009 0.02 0.5 1.5 + MONITORING_POINT_010 0.24 0.1 1.5 + MONITORING_POINT_011 0.24 0.3 1.5 + MONITORING_POINT_012 0.24 0.5 1.5 + + POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 #----------------- # Physical models #----------------- + MASS_DENSITY 1000.0 + HEAT_CAPACITY 4184.0 + DYNAMIC_VISCOSITY 0.0010005 + THERMAL_CONDUCTIVITY 0.59803 + VOLUME_EXPANSION_COEFFICIENT 0.000385 + REFERENCE_TEMPERATURE 0.0 - MASS_DENSITY 1000.0 - HEAT_CAPACITY 4184.0 - DYNAMIC_VISCOSITY 0.0010005 - THERMAL_CONDUCTIVITY 0.59803 - VOLUME_EXPANSION_COEFFICIENT 0.000385 - REFERENCE_TEMPERATURE 0.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f # TURBULENCE_MODEL k_eps #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 - - MIN_SIMPLE_ITERATIONS 5 - MAX_SIMPLE_ITERATIONS 20 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 + + MIN_SIMPLE_ITERATIONS 5 + MAX_SIMPLE_ITERATIONS 20 #-------------------- # Initial conditions diff --git a/Tests/Rans/Negative_Buoyant_Fountain/control-4 b/Tests/Rans/Negative_Buoyant_Fountain/control-4 index bdba2e0b9..70f101840 100644 --- a/Tests/Rans/Negative_Buoyant_Fountain/control-4 +++ b/Tests/Rans/Negative_Buoyant_Fountain/control-4 @@ -1,86 +1,86 @@ #---------- # Prologue #---------- - PROBLEM_NAME nbf - HEAT_TRANSFER yes + PROBLEM_NAME nbf + HEAT_TRANSFER yes - TIME_STEP 0.01 - NUMBER_OF_TIME_STEPS 36000 + TIME_STEP 0.01 + NUMBER_OF_TIME_STEPS 36000 #------------------ # Saving intervals #------------------ - RESULTS_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 600 + RESULTS_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 600 - LOAD_BACKUP_NAME nbf-ts034200.backup + LOAD_BACKUP_NAME nbf-ts034200.backup #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 12 - MONITORING_POINT_001 0.02 0.1 0.5 - MONITORING_POINT_002 0.02 0.3 0.5 - MONITORING_POINT_003 0.02 0.5 0.5 - MONITORING_POINT_004 0.24 0.1 0.5 - MONITORING_POINT_005 0.24 0.3 0.5 - MONITORING_POINT_006 0.24 0.5 0.5 - MONITORING_POINT_007 0.02 0.1 1.5 - MONITORING_POINT_008 0.02 0.3 1.5 - MONITORING_POINT_009 0.02 0.5 1.5 - MONITORING_POINT_010 0.24 0.1 1.5 - MONITORING_POINT_011 0.24 0.3 1.5 - MONITORING_POINT_012 0.24 0.5 1.5 - - POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 + NUMBER_OF_MONITORING_POINTS 12 + MONITORING_POINT_001 0.02 0.1 0.5 + MONITORING_POINT_002 0.02 0.3 0.5 + MONITORING_POINT_003 0.02 0.5 0.5 + MONITORING_POINT_004 0.24 0.1 0.5 + MONITORING_POINT_005 0.24 0.3 0.5 + MONITORING_POINT_006 0.24 0.5 0.5 + MONITORING_POINT_007 0.02 0.1 1.5 + MONITORING_POINT_008 0.02 0.3 1.5 + MONITORING_POINT_009 0.02 0.5 1.5 + MONITORING_POINT_010 0.24 0.1 1.5 + MONITORING_POINT_011 0.24 0.3 1.5 + MONITORING_POINT_012 0.24 0.5 1.5 + + POINT_FOR_MONITORING_PLANES 0.1 0.1 0.1 #----------------- # Physical models #----------------- - MASS_DENSITY 1000.0 - HEAT_CAPACITY 4184.0 - DYNAMIC_VISCOSITY 0.0010005 - THERMAL_CONDUCTIVITY 0.59803 - VOLUME_EXPANSION_COEFFICIENT 0.000385 - REFERENCE_TEMPERATURE 0.0 + MASS_DENSITY 1000.0 + HEAT_CAPACITY 4184.0 + DYNAMIC_VISCOSITY 0.0010005 + THERMAL_CONDUCTIVITY 0.59803 + VOLUME_EXPANSION_COEFFICIENT 0.000385 + REFERENCE_TEMPERATURE 0.0 - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f # TURBULENCE_MODEL k_eps #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 - - MIN_SIMPLE_ITERATIONS 5 - MAX_SIMPLE_ITERATIONS 20 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 40 + + MIN_SIMPLE_ITERATIONS 5 + MAX_SIMPLE_ITERATIONS 20 #-------------------- # Initial conditions diff --git a/Tests/Rans/Pipe_Re_Tau_550/User_Mod/Save_Results.f90 b/Tests/Rans/Pipe_Re_Tau_550/User_Mod/Save_Results.f90 index ad9bd8252..9ed9fcdc8 100644 --- a/Tests/Rans/Pipe_Re_Tau_550/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Pipe_Re_Tau_550/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1r file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts ! time step integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid @@ -21,7 +20,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Var_Type), pointer :: kin, eps, zeta, f22 type(Var_Type), pointer :: uu, vv, ww, uv, uw, vw type(Var_Type), pointer :: ut, vt, wt - integer :: n_prob, pl, c, i, count, s, c1, c2, n_points + integer :: n_prob, pl, c, i, count, s, c1, c2, n_points, reg character(SL) :: coord_name, res_name, res_name_plus real, allocatable :: z_p(:), u_p(:), v_p(:), w_p(:), y_plus_p(:), & kin_p(:), eps_p(:), f22_p(:), & @@ -38,7 +37,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -51,30 +50,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call Turb % Alias_Heat_Fluxes (ut, vt, wt) ! Take constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity (visc_const) - call Control_Mod_Heat_Capacity (capa_const) - call Control_Mod_Thermal_Conductivity(cond_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity (visc_const) + call Control % Heat_Capacity (capa_const) + call Control % Thermal_Conductivity(cond_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1r') ! Set file name for results - call File % Set_Name(res_name, & - time_step=ts, & - appendix='-res', & - extension='.dat') - call File % Set_Name(res_name_plus, & - time_step=ts, & - appendix='-res-plus', & - extension='.dat') + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & + extension = '.dat') + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & + extension = '.dat') !------------------! ! Read 1r file ! !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -104,7 +103,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) allocate(ind(n_prob*2)) ! Read the intervals positions - do pl=1,n_prob + do pl = 1, n_prob read(9,*) ind(pl), z_p(pl) end do close(9) @@ -136,7 +135,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average the results ! !-------------------------! do i = 1, n_prob-1 - do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells + do c = Cells_In_Domain() rad = 1.0 - Grid % wall_dist(c) if( rad < (z_p(i)) .and. & rad > (z_p(i+1))) then @@ -175,36 +174,36 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p(pl)) - call Comm_Mod_Global_Sum_Real(eps_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(vis_t_p(pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(kin_p(pl)) + call Global % Sum_Real(eps_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(vis_t_p(pl)) + call Global % Sum_Real(y_plus_p(pl)) - call Comm_Mod_Global_Sum_Real(f22_p(pl)) - call Comm_Mod_Global_Sum_Real(zeta_p(pl)) + call Global % Sum_Real(f22_p(pl)) + call Global % Sum_Real(zeta_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p(pl)) - call Comm_Mod_Global_Sum_Real(tt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) + call Global % Sum_Real(t_p(pl)) + call Global % Sum_Real(tt_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -245,7 +244,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) end if if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if @@ -254,40 +253,40 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) if(Flow % heat_transfer) then d_wall = 0.0 - do c = 1, Grid % n_cells - Grid % Comm % n_buff_cells + do c = Cells_In_Domain() if(Grid % wall_dist(c) > d_wall) then d_wall = Grid % wall_dist(c) t_inf = t % n(c) end if end do - call Comm_Mod_Wait + call Global % Wait if(Flow % heat_flux > 0.0) then - call Comm_Mod_Global_Min_Real(t_inf) + call Global % Min_Real(t_inf) else - call Comm_Mod_Global_Max_Real(t_inf) + call Global % Max_Real(t_inf) end if - do s = 1, Grid % n_faces - c1 = Grid % faces_c(1,s) - c2 = Grid % faces_c(2,s) - if(c2 < 0) then - if( Grid % Bnd_Cond_Type(c2) .eq. WALL .or. & - Grid % Bnd_Cond_Type(c2) .eq. WALLFL) then + do reg = Boundary_Regions() + if(Grid % region % type(reg) .eq. WALL .or. & + Grid % region % type(reg) .eq. WALLFL) then + do s = Faces_In_Region(reg) + c1 = Grid % faces_c(1,s) + c2 = Grid % faces_c(2,s) t_wall = t_wall + t % n(c2) nu_mean = nu_mean + t % q(c2) / (cond_const*(t % n(c2) - t_inf)) n_points = n_points + 1 - end if - end if - end do + end do ! faces + end if ! boundary condition type + end do ! regions - call Comm_Mod_Global_Sum_Real(t_wall) - call Comm_Mod_Global_Sum_Real(nu_mean) - call Comm_Mod_Global_Sum_Int(n_points) + call Global % Sum_Real(t_wall) + call Global % Sum_Real(nu_mean) + call Global % Sum_Int(n_points) - call Comm_Mod_Wait + call Global % Wait t_wall = t_wall / n_points nu_mean = nu_mean / n_points @@ -303,17 +302,17 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) cf_dean = 0.0791*(re)**(-0.25) cf = u_tau_p**2/(0.5*ubulk**2) error = abs(cf_dean - cf)/cf_dean * 100.0 - write(i,'(a1,(a12,E12.6))') & + write(i,'(a1,(a12,e12.6))') & '#', 'ubulk = ', ubulk - write(i,'(a1,(a12,E12.6))') & + write(i,'(a1,(a12,e12.6))') & '#', 'Re = ', dens_const * ubulk * 2.0/visc_const - write(i,'(a1,(a12,E12.6))') & + write(i,'(a1,(a12,e12.6))') & '#', 'Re_tau = ', dens_const*u_tau_p/visc_const - write(i,'(a1,(a12,E12.6))') & + write(i,'(a1,(a12,e12.6))') & '#', 'Cf = ', 2.0*(u_tau_p/ubulk)**2 write(i,'(a1,(a12,F12.6))') & '#', 'Utau = ', u_tau_p - write(i,'(a1,(a12,F12.6,a2,a22))') & + write(i,'(a1,(a12,f12.6,a2,a22))') & '#', 'Cf_error = ', error, ' %', 'Dean formula is used.' if(Flow % heat_transfer) then write(i,'(a1,(a12, F12.6))')'#', 'Nu number =', nu_mean @@ -325,30 +324,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) if(Turb % model .eq. K_EPS) then if(Flow % heat_transfer) then - write(i,'(a1,2X,A60)') '#', ' r,' // & ! 1 - ' w,' // & ! 2 - ' kin, eps, uw,' // & ! 3, 4, 5 - ' vis_t/visc_const,' // & ! 6 - ' t, ut, vt, wt,' ! 7 - 10 + write(i,'(a1,2x,a60)') '#', ' r,' // & ! 1 + ' w,' // & ! 2 + ' kin, eps, uw,' // & ! 3, 4, 5 + ' vis_t/visc_const,' // & ! 6 + ' t, ut, vt, wt,' ! 7 - 10 else - write(i,'(a1,2X,A60)') '#', ' r,' // & ! 1 - ' w,' // & ! 2 + write(i,'(a1,2X,a60)') '#', ' r,' // & ! 1 + ' w,' // & ! 2 ' kin, eps, uw, vis_t/visc_const' ! 3-6 end if else if(Turb % model .eq. K_EPS_ZETA_F) then if(Flow % heat_transfer) then - write(i,'(a1,2X,A60)') '#', ' r,' // & ! 1 + write(i,'(a1,2x,a60)') '#', ' r,' // & ! 1 ' w,' // & ! 2 ' kin, eps, uw,' // & ! 3, 4, 5 ' f22, zeta,' // & ! 6, 7 - ' vis_t/visc_const,' // & ! 8 - 11 + ' vis_t/visc_const,' // & ! 8 - 11 ' t, ut, vt, wt' else - write(i,'(a1,2X,A50)') '#', ' r,' // & ! 1 + write(i,'(a1,2x,a50)') '#', ' r,' // & ! 1 ' w,' // & ! 2 ' kin, eps, uw,' // & ! 3, 4, 5 ' f22, zeta' // & ! 6, 7 - ' vis_t/visc_const,' ! 8 + ' vis_t/visc_const,' ! 8 end if end if end do @@ -462,6 +461,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Rans/Pipe_Re_Tau_550/control b/Tests/Rans/Pipe_Re_Tau_550/control index b200c483a..cb26ad5ad 100644 --- a/Tests/Rans/Pipe_Re_Tau_550/control +++ b/Tests/Rans/Pipe_Re_Tau_550/control @@ -1,82 +1,77 @@ #-------------------- # Problem definition #-------------------- + PROBLEM_NAME pipe_full - PROBLEM_NAME pipe_full -# LOAD_BACKUP_NAME pipe_full-ts000600.backup + HEAT_TRANSFER yes - HEAT_TRANSFER yes - - PRESSURE_DROPS 0.0 0.0 0.0036 - MASS_FLOW_RATES 0.0 0.0 11.5 + PRESSURE_DROPS 0.0 0.0 0.0036 + MASS_FLOW_RATES 0.0 0.0 11.5 #--------------- # Time stepping #--------------- - - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 7200 - RESULTS_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 7200 + RESULTS_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 600 #------------------- -# Monitoring points +# Monitoring points #------------------- + NUMBER_OF_MONITORING_POINTS 5 + MONITORING_POINT_001 0.0 0.99 0.5 + MONITORING_POINT_002 0.0 0.8 0.5 + MONITORING_POINT_003 0.0 0.7 0.5 + MONITORING_POINT_004 0.0 0.2 0.5 + MONITORING_POINT_005 0.0 0.0 0.5 - NUMBER_OF_MONITORING_POINTS 5 - MONITORING_POINT_001 0.0 0.99 0.5 - MONITORING_POINT_002 0.0 0.8 0.5 - MONITORING_POINT_003 0.0 0.7 0.5 - MONITORING_POINT_004 0.0 0.2 0.5 - MONITORING_POINT_005 0.0 0.0 0.5 - - POINT_FOR_MONITORING_PLANES 0.05 0.05 0.514 + POINT_FOR_MONITORING_PLANES 0.05 0.05 0.514 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4e-4 - REFERENCE_TEMPERATURE 0. - DYNAMIC_VISCOSITY 3.8296e-4 - HEAT_CAPACITY 1.0 - NUMBER_OF_SCALARS 1 - SPECIES_DIFFUSIVITY 1.4e-4 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4e-4 + REFERENCE_TEMPERATURE 0. + DYNAMIC_VISCOSITY 3.8296e-4 + HEAT_CAPACITY 1.0 + NUMBER_OF_SCALARS 1 + SPECIES_DIFFUSIVITY 1.4e-4 - TURBULENCE_MODEL k_eps_zeta_f - #TURBULENCE_MODEL rsm_hanjalic_jakirlic - #TURBULENCE_MODEL_VARIANT none - #TURBULENCE_WALL_TREATMENT high_re + TURBULENCE_MODEL k_eps_zeta_f +# TURBULENCE_MODEL rsm_hanjalic_jakirlic +# TURBULENCE_MODEL_VARIANT none +# TURBULENCE_WALL_TREATMENT high_re #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.4 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.4 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.4 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM superbee + ADVECTION_SCHEME_FOR_ENERGY superbee + ADVECTION_SCHEME_FOR_TURBULENCE superbee - ADVECTION_SCHEME_FOR_MOMENTUM superbee - ADVECTION_SCHEME_FOR_ENERGY superbee - ADVECTION_SCHEME_FOR_TURBULENCE superbee + MIN_SIMPLE_ITERATIONS 3 - MIN_SIMPLE_ITERATIONS 3 #------------------------ # Linear solver settings #------------------------ - - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1e-5 - TOLERANCE_FOR_PRESSURE_SOLVER 1e-5 - TOLERANCE_FOR_TURBULENCE_SOLVER 1e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1e-5 + TOLERANCE_FOR_PRESSURE_SOLVER 1e-5 + TOLERANCE_FOR_TURBULENCE_SOLVER 1e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1e-3 #-------------------- # Initial conditions diff --git a/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 b/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 index 9845589a9..f98406f46 100644 --- a/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 +++ b/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/User_Mod/Save_Results.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! @@ -12,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: ts integer, optional :: domain !-----------------------------------[Locals]-----------------------------------! integer :: n_prob, pl, c, i, count, s, c1, c2, n_points @@ -34,7 +33,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !==============================================================================! ! Don't save if this is intial condition, nothing is developed yet - if(ts .eq. 0) return + if(Time % Curr_Dt() .eq. 0) return ! Take aliases Grid => Flow % pnt_grid @@ -60,13 +59,13 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) call File % Set_Name(coord_name, extension='.1d') ! Set file names for results - call File % Set_Name(res_name, & - time_step = ts, & - appendix = '-res', & + call File % Set_Name(res_name, & + time_step = Time % Curr_Dt(), & + appendix = '-res', & extension = '.dat') - call File % Set_Name(res_name_plus, & - time_step = ts, & - appendix = '-res-plus', & + call File % Set_Name(res_name_plus, & + time_step = Time % Curr_Dt(), & + appendix = '-res-plus', & extension = '.dat') !------------------! @@ -74,7 +73,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -185,37 +184,37 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) + call Global % Sum_Int(n_count(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) + call Global % Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(tz_p(pl)) - call Comm_Mod_Global_Sum_Real(ti_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Real(tz_p(pl)) + call Global % Sum_Real(ti_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_mod_p(pl)) + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uw_p(pl)) + call Global % Sum_Real(kin_p(pl)) + call Global % Sum_Real(kin_mod_p(pl)) count = count + n_count(pl) if(Flow % heat_transfer) then - call Comm_Mod_Global_Sum_Real(t_p(pl)) - call Comm_Mod_Global_Sum_Real(t2_p(pl)) - call Comm_Mod_Global_Sum_Real(t2_mod_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_p(pl)) - call Comm_Mod_Global_Sum_Real(vt_p(pl)) - call Comm_Mod_Global_Sum_Real(wt_p(pl)) - call Comm_Mod_Global_Sum_Real(ut_mod(pl)) - call Comm_Mod_Global_Sum_Real(vt_mod(pl)) - call Comm_Mod_Global_Sum_Real(wt_mod(pl)) + call Global % Sum_Real(t_p(pl)) + call Global % Sum_Real(t2_p(pl)) + call Global % Sum_Real(t2_mod_p(pl)) + call Global % Sum_Real(ut_p(pl)) + call Global % Sum_Real(vt_p(pl)) + call Global % Sum_Real(wt_p(pl)) + call Global % Sum_Real(ut_mod(pl)) + call Global % Sum_Real(vt_mod(pl)) + call Global % Sum_Real(wt_mod(pl)) end if end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -248,7 +247,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) open(3, file = res_name) if(Flow % heat_transfer) then - if(this_proc < 2) then + if(First_Proc()) then write(*,'(a1,(a12, f12.6))')'#', ' Nu1 number = ', & -tz_p(1) / (t_hot - t_cold) write(*,'(a1,(a12, f12.6))')'#', ' Nu2 number = ', & @@ -302,6 +301,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, ts, domain) deallocate(wt_p) end if - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/control b/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/control index 93342c82a..1c5d7d96b 100644 --- a/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/control +++ b/Tests/Rans/Rayleigh_Benard_Convection_Ra_10e09/control @@ -1,82 +1,82 @@ #----------- # Prologue #----------- + PROBLEM_NAME rb_conv - PROBLEM_NAME rb_conv + HEAT_TRANSFER yes - HEAT_TRANSFER yes + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 3600 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 60 - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 3600 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 50 - -# LOAD_BACKUP_NAME rb_conv-ts000060.backup - RESULTS_SAVE_INTERVAL 50 - BACKUP_SAVE_INTERVAL 2000 + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 3600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 15 - MONITORING_POINT_001 0.5 0.5 1.0 - MONITORING_POINT_002 0.5 0.5 0.9 - MONITORING_POINT_003 0.5 0.5 0.8 - MONITORING_POINT_004 0.5 0.5 0.7 - MONITORING_POINT_005 0.5 0.5 0.6 - MONITORING_POINT_006 0.5 0.5 0.5 - MONITORING_POINT_007 0.1 0.1 0.5 - MONITORING_POINT_008 0.2 0.2 0.5 - MONITORING_POINT_009 0.3 0.3 0.5 - MONITORING_POINT_010 0.4 0.4 0.5 - MONITORING_POINT_011 0.5 0.5 0.5 - MONITORING_POINT_012 0.6 0.6 0.5 - MONITORING_POINT_013 0.7 0.7 0.5 - MONITORING_POINT_014 0.8 0.8 0.5 - MONITORING_POINT_015 0.9 0.9 0.5 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 15 + MONITORING_POINT_001 0.5 0.5 1.0 + MONITORING_POINT_002 0.5 0.5 0.9 + MONITORING_POINT_003 0.5 0.5 0.8 + MONITORING_POINT_004 0.5 0.5 0.7 + MONITORING_POINT_005 0.5 0.5 0.6 + MONITORING_POINT_006 0.5 0.5 0.5 + MONITORING_POINT_007 0.1 0.1 0.5 + MONITORING_POINT_008 0.2 0.2 0.5 + MONITORING_POINT_009 0.3 0.3 0.5 + MONITORING_POINT_010 0.4 0.4 0.5 + MONITORING_POINT_011 0.5 0.5 0.5 + MONITORING_POINT_012 0.6 0.6 0.5 + MONITORING_POINT_013 0.7 0.7 0.5 + MONITORING_POINT_014 0.8 0.8 0.5 + MONITORING_POINT_015 0.9 0.9 0.5 + + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - BUOYANCY thermal - GRAVITATIONAL_VECTOR 0.0, 0.0, -0.0327 - REFERENCE_TEMPERATURE 12.5 + BUOYANCY thermal + GRAVITATIONAL_VECTOR 0.0, 0.0, -0.0327 + REFERENCE_TEMPERATURE 12.5 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 2.594e-5 - DYNAMIC_VISCOSITY 1.846e-5 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 2.594e-5 + DYNAMIC_VISCOSITY 1.846e-5 + HEAT_CAPACITY 1.0 - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f +#TURBULENCE_MODEL k_eps - TURBULENT_HEAT_FLUX_MODEL GGDH + TURBULENT_HEAT_FLUX_MODEL GGDH #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.5 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.5 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.7 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.5 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.5 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - GU_CORRECTION yes + GU_CORRECTION yes - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 - TOLERANCE_FOR_TURBULENCE 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-4 + TOLERANCE_FOR_TURBULENCE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 120 #-------------------- # Initial conditions @@ -85,7 +85,6 @@ VARIABLES u v w t t2 kin eps zeta f22 VALUES 0.0 0.0 0.0 12.5 0.1 0.005 0.001 0.05 0.1 - #--------------------- # Boundary conditions #--------------------- diff --git a/Tests/Rans/Single_Rod/control.0 b/Tests/Rans/Single_Rod/control.0 index 5a48f146d..16c3fac52 100644 --- a/Tests/Rans/Single_Rod/control.0 +++ b/Tests/Rans/Single_Rod/control.0 @@ -1,20 +1,20 @@ - NUMBER_OF_DOMAINS 3 + NUMBER_OF_DOMAINS 3 - NUMBER_OF_TIME_STEPS 600 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 600 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.0001 + TIME_STEP 0.0001 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 - INTERFACE_CONDITION fuel cladding - BOUNDARY_CONDITIONS fuel_wall cladding_inner_wall + INTERFACE_CONDITION fuel cladding + BOUNDARY_CONDITIONS fuel_wall cladding_inner_wall - INTERFACE_CONDITION cladding water - BOUNDARY_CONDITIONS cladding_outer_wall cylinder_wall + INTERFACE_CONDITION cladding water + BOUNDARY_CONDITIONS cladding_outer_wall cylinder_wall diff --git a/Tests/Rans/Single_Rod/control.1 b/Tests/Rans/Single_Rod/control.1 index f83c2ae92..ebfa4258e 100644 --- a/Tests/Rans/Single_Rod/control.1 +++ b/Tests/Rans/Single_Rod/control.1 @@ -1,58 +1,56 @@ #---------- # Prologue #---------- - PROBLEM_NAME fuel - HEAT_TRANSFER yes + PROBLEM_NAME fuel + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 12 - RESULTS_SAVE_INTERVAL 3 - BACKUP_SAVE_INTERVAL 12 + NUMBER_OF_TIME_STEPS 12 + RESULTS_SAVE_INTERVAL 3 + BACKUP_SAVE_INTERVAL 12 - LOAD_BACKUP_NAME fuel-ts000240.backup + LOAD_BACKUP_NAME fuel-ts000240.backup - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- + MASS_DENSITY 6 + THERMAL_CONDUCTIVITY 0.24 + DYNAMIC_VISCOSITY 1.0e+6 + HEAT_CAPACITY 1.0 - MASS_DENSITY 6 - THERMAL_CONDUCTIVITY 0.24 - DYNAMIC_VISCOSITY 1.0e+6 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 12 #-------------------- # Initial conditions diff --git a/Tests/Rans/Single_Rod/control.2 b/Tests/Rans/Single_Rod/control.2 index ae9a963da..6f900f703 100644 --- a/Tests/Rans/Single_Rod/control.2 +++ b/Tests/Rans/Single_Rod/control.2 @@ -1,58 +1,54 @@ #---------- # Prologue #---------- - PROBLEM_NAME cladding - HEAT_TRANSFER yes + PROBLEM_NAME cladding + HEAT_TRANSFER yes - NUMBER_OF_TIME_STEPS 12 - RESULTS_SAVE_INTERVAL 3 - BACKUP_SAVE_INTERVAL 12 + NUMBER_OF_TIME_STEPS 12 + RESULTS_SAVE_INTERVAL 3 + BACKUP_SAVE_INTERVAL 12 - LOAD_BACKUP_NAME cladding-ts000240.backup - - TIME_STEP 0.1 + TIME_STEP 0.1 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- + MASS_DENSITY 10 + THERMAL_CONDUCTIVITY 240 + DYNAMIC_VISCOSITY 1.0e+6 + HEAT_CAPACITY 1.0 - MASS_DENSITY 10 - THERMAL_CONDUCTIVITY 240 - DYNAMIC_VISCOSITY 1.0e+6 - HEAT_CAPACITY 1.0 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 12 #-------------------- # Initial conditions diff --git a/Tests/Rans/Single_Rod/control.3 b/Tests/Rans/Single_Rod/control.3 index 46739a936..c60b5139f 100644 --- a/Tests/Rans/Single_Rod/control.3 +++ b/Tests/Rans/Single_Rod/control.3 @@ -1,61 +1,61 @@ #---------- # Prologue #---------- - PROBLEM_NAME water - HEAT_TRANSFER yes - BUOYANCY none + PROBLEM_NAME water + HEAT_TRANSFER yes + BUOYANCY none - TIME_STEP 0.0001 - NUMBER_OF_TIME_STEPS 12 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 - RESULTS_SAVE_INTERVAL 150 - BACKUP_SAVE_INTERVAL 600 + TIME_STEP 0.0001 + NUMBER_OF_TIME_STEPS 12 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 1200000 + RESULTS_SAVE_INTERVAL 150 + BACKUP_SAVE_INTERVAL 600 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.5 0.5 1.0 - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.5 0.5 1.0 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1000 - THERMAL_CONDUCTIVITY 0.007 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 - REFERENCE_TEMPERATURE 20.0 + MASS_DENSITY 1000 + THERMAL_CONDUCTIVITY 0.007 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 + REFERENCE_TEMPERATURE 20.0 - GRAVITATIONAL_VECTOR 0.0, 0.0, 0.0 + GRAVITATIONAL_VECTOR 0.0, 0.0, 0.0 - TURBULENCE_MODEL k_eps_zeta_f + TURBULENCE_MODEL k_eps_zeta_f #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.6 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM smart - ADVECTION_SCHEME_FOR_ENERGY smart - ADVECTION_SCHEME_FOR_TURBULENCE smart + ADVECTION_SCHEME_FOR_MOMENTUM smart + ADVECTION_SCHEME_FOR_ENERGY smart + ADVECTION_SCHEME_FOR_TURBULENCE smart - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 - TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 5.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_SIMPLE_ITERATIONS 12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control b/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control index e1c173259..fd419df49 100644 --- a/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control +++ b/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control @@ -1,18 +1,18 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 # Integrate in time for five seconds - TIME_STEP 0.005 - NUMBER_OF_TIME_STEPS 1000 + TIME_STEP 0.005 + NUMBER_OF_TIME_STEPS 1000 - RESULTS_SAVE_INTERVAL 100 - BACKUP_SAVE_INTERVAL 500 - SWARM_SAVE_INTERVAL 100 - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 1001 + RESULTS_SAVE_INTERVAL 100 + BACKUP_SAVE_INTERVAL 500 + SWARM_SAVE_INTERVAL 100 + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 1001 - SAVE_RESULTS_AT_BOUNDARIES no + SAVE_RESULTS_AT_BOUNDARIES no - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION pipe bend - BOUNDARY_CONDITIONS periodic_y bend_inlet + INTERFACE_CONDITION pipe bend + BOUNDARY_CONDITIONS periodic_y bend_inlet diff --git a/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.1 b/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.1 index 540c71a18..099632e26 100644 --- a/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.1 +++ b/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.1 @@ -1,50 +1,50 @@ #---------- # Prologue #---------- - PROBLEM_NAME pipe - HEAT_TRANSFER no + PROBLEM_NAME pipe + HEAT_TRANSFER no #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.0 0.145 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.145 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.2 - DYNAMIC_VISCOSITY 1.8e-5 + MASS_DENSITY 1.2 + DYNAMIC_VISCOSITY 1.8e-5 - TURBULENCE_MODEL k_eps - PRESSURE_DROPS 0.0 -9.0 0.0 - MASS_FLOW_RATES 0.0 -9.42e-4 0.0 + TURBULENCE_MODEL k_eps + PRESSURE_DROPS 0.0 -9.0 0.0 + MASS_FLOW_RATES 0.0 -9.42e-4 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear # ADVECTION_SCHEME_FOR_MOMENTUM upwind - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------- # Initial conditions diff --git a/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.2 b/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.2 index 206c1328f..53320f03f 100644 --- a/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.2 +++ b/Tests/Swarm/Bend_90_Degrees/Control_Flow_Development/control.2 @@ -1,59 +1,59 @@ #---------- # Prologue #---------- - PROBLEM_NAME bend - HEAT_TRANSFER no + PROBLEM_NAME bend + HEAT_TRANSFER no #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.07 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.07 0.0 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.2 - DYNAMIC_VISCOSITY 1.8e-5 + MASS_DENSITY 1.2 + DYNAMIC_VISCOSITY 1.8e-5 - TURBULENCE_MODEL k_eps + TURBULENCE_MODEL k_eps #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes + PARTICLE_TRACKING yes # SWARM_SUBGRID_SCALE_MODEL brownian_fukagata - SWARM_DIAMETER 2.5e-5 - SWARM_DENSITY 1000.0 - NUMBER_OF_SWARM_SUB_STEPS 8 - MAX_PARTICLES 10000 - SWARM_COEFFICIENT_OF_RESTITUTION 1.0 + SWARM_DIAMETER 2.5e-5 + SWARM_DENSITY 1000.0 + NUMBER_OF_SWARM_SUB_STEPS 8 + MAX_PARTICLES 10000 + SWARM_COEFFICIENT_OF_RESTITUTION 1.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear # ADVECTION_SCHEME_FOR_MOMENTUM upwind - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------- # Initial conditions diff --git a/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control b/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control index a3976733f..9245e2ae9 100644 --- a/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control +++ b/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control @@ -1,18 +1,18 @@ - NUMBER_OF_DOMAINS 2 + NUMBER_OF_DOMAINS 2 # Integrate in time for two seconds - TIME_STEP 0.0001 - NUMBER_OF_TIME_STEPS 20000 + TIME_STEP 0.0001 + NUMBER_OF_TIME_STEPS 20000 - RESULTS_SAVE_INTERVAL 5000 - SWARM_SAVE_INTERVAL 10 - BACKUP_SAVE_INTERVAL 5000 - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 1001 + RESULTS_SAVE_INTERVAL 5000 + SWARM_SAVE_INTERVAL 10 + BACKUP_SAVE_INTERVAL 5000 + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 1001 - SAVE_RESULTS_AT_BOUNDARIES yes + SAVE_RESULTS_AT_BOUNDARIES yes - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - INTERFACE_CONDITION pipe bend - BOUNDARY_CONDITIONS periodic_y bend_inlet + INTERFACE_CONDITION pipe bend + BOUNDARY_CONDITIONS periodic_y bend_inlet diff --git a/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.1 b/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.1 index 9300baf68..95296359d 100644 --- a/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.1 +++ b/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.1 @@ -1,52 +1,50 @@ #---------- # Prologue #---------- - PROBLEM_NAME pipe - HEAT_TRANSFER no - - LOAD_BACKUP_NAME pipe-ts001000.backup + PROBLEM_NAME pipe + HEAT_TRANSFER no #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.0 0.145 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.145 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.2 - DYNAMIC_VISCOSITY 1.8e-5 + MASS_DENSITY 1.2 + DYNAMIC_VISCOSITY 1.8e-5 - TURBULENCE_MODEL k_eps - PRESSURE_DROPS 0.0 -9.0 0.0 - MASS_FLOW_RATES 0.0 -9.42e-4 0.0 + TURBULENCE_MODEL k_eps + PRESSURE_DROPS 0.0 -9.0 0.0 + MASS_FLOW_RATES 0.0 -9.42e-4 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear # ADVECTION_SCHEME_FOR_MOMENTUM upwind - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------- # Initial conditions diff --git a/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.2 b/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.2 index 09adeba58..978c2cee3 100644 --- a/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.2 +++ b/Tests/Swarm/Bend_90_Degrees/Control_Particle_Tracking/control.2 @@ -1,30 +1,28 @@ #---------- # Prologue #---------- - PROBLEM_NAME bend - HEAT_TRANSFER no - - LOAD_BACKUP_NAME bend-ts001000.backup + PROBLEM_NAME bend + HEAT_TRANSFER no #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.07 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.07 0.0 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.2 - DYNAMIC_VISCOSITY 1.8e-5 + MASS_DENSITY 1.2 + DYNAMIC_VISCOSITY 1.8e-5 - TURBULENCE_MODEL k_eps + TURBULENCE_MODEL k_eps #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes + PARTICLE_TRACKING yes # SWARM_SUBGRID_SCALE_MODEL brownian_fukagata - SWARM_DIAMETER 3.0e-6 + SWARM_DIAMETER 3.0e-6 # SWARM_DIAMETER 5.0e-6 # SWARM_DIAMETER 10.0e-6 # SWARM_DIAMETER 15.0e-6 @@ -33,37 +31,37 @@ # SWARM_DIAMETER 30.0e-6 # SWARM_DIAMETER 40.0e-6 # SWARM_DIAMETER 50.0e-6 - SWARM_DENSITY 1000.0 - NUMBER_OF_SWARM_SUB_STEPS 16 - MAX_PARTICLES 10000 - SWARM_COEFFICIENT_OF_RESTITUTION 0.0 + SWARM_DENSITY 1000.0 + NUMBER_OF_SWARM_SUB_STEPS 16 + MAX_PARTICLES 10000 + SWARM_COEFFICIENT_OF_RESTITUTION 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_TURBULENCE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear # ADVECTION_SCHEME_FOR_MOMENTUM upwind - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 480 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem #-------------------- # Initial conditions diff --git a/Tests/Swarm/Bend_90_Degrees/User_Mod/Insert_Particles.f90 b/Tests/Swarm/Bend_90_Degrees/User_Mod/Insert_Particles.f90 index 3d023d5a0..c89ec73b7 100644 --- a/Tests/Swarm/Bend_90_Degrees/User_Mod/Insert_Particles.f90 +++ b/Tests/Swarm/Bend_90_Degrees/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! time step - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid integer :: i, j, k, c, n_parts_in_buffers @@ -40,10 +38,10 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) !-------------------------------------------! n_old = Swarm % n_particles ! old number of particles - if(curr_dt .eq. 1001 .or. & - curr_dt .eq. 1501 .or. & - curr_dt .eq. 2001 .or. & - curr_dt .eq. 2501) then ! should be after the flow is developed + if(Time % Curr_Dt() .eq. 1001 .or. & + Time % Curr_Dt() .eq. 1501 .or. & + Time % Curr_Dt() .eq. 2001 .or. & + Time % Curr_Dt() .eq. 2501) then ! should be after the flow is developed ! First Particle in the center k = n_old + 1 @@ -73,14 +71,14 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, curr_dt, time) n_new = k ! new number of particles if(n_new <= Swarm % max_particles) then - if(this_proc < 2) then + if(First_Proc()) then print *, '# @User_Mod_Insert_Particles: inserted', & n_new - n_old, ' particles' end if else - if(this_proc < 2) then + if(First_Proc()) then print *, '# @User_Mod_Insert_Particles: too many particles' - call Comm_Mod_End + call Global % End_Parallel stop end if end if diff --git a/Tests/Swarm/Channel_Re_Tau_150/control_a_flow_development b/Tests/Swarm/Channel_Re_Tau_150/control_a_flow_development index 26d4ed826..21926bf23 100644 --- a/Tests/Swarm/Channel_Re_Tau_150/control_a_flow_development +++ b/Tests/Swarm/Channel_Re_Tau_150/control_a_flow_development @@ -1,66 +1,66 @@ #---------- # Prologue #---------- - PROBLEM_NAME chan + PROBLEM_NAME chan - TIME_STEP 0.5 - NUMBER_OF_TIME_STEPS 24000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 18001 # 6000 for statistics - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # after the last time step - STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # beyond this computation + TIME_STEP 0.5 + NUMBER_OF_TIME_STEPS 24000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 18001 # 6000 for statistics + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # after the last time step + STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # beyond this computation - RESULTS_SAVE_INTERVAL 600 - SWARM_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 + RESULTS_SAVE_INTERVAL 600 + SWARM_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 3.0e-5 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 3.0e-5 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes + PARTICLE_TRACKING yes # SWARM_SUBGRID_SCALE_MODEL brownian_fukagata - SWARM_DIAMETER 3.66356E-03 - SWARM_DENSITY 1000 - NUMBER_OF_SWARM_SUB_STEPS 2 - MAX_PARTICLES 100000 - SWARM_COEFFICIENT_OF_RESTITUTION 1.0 + SWARM_DIAMETER 3.66356E-03 + SWARM_DENSITY 1000 + NUMBER_OF_SWARM_SUB_STEPS 2 + MAX_PARTICLES 100000 + SWARM_COEFFICIENT_OF_RESTITUTION 1.0 #------------------- # Turbulence model #------------------- - TURBULENCE_MODEL HYBRID_LES_RANS + TURBULENCE_MODEL HYBRID_LES_RANS - PRESSURE_DROPS 2.0e-5 0.0 0.0 - MASS_FLOW_RATES 0.4046 0.0 0.0 + PRESSURE_DROPS 2.0e-5 0.0 0.0 + MASS_FLOW_RATES 0.4046 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM central - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Channel_Re_Tau_150/control_b_particles b/Tests/Swarm/Channel_Re_Tau_150/control_b_particles index ad2f4ac2e..be269a700 100644 --- a/Tests/Swarm/Channel_Re_Tau_150/control_b_particles +++ b/Tests/Swarm/Channel_Re_Tau_150/control_b_particles @@ -1,68 +1,68 @@ #---------- # Prologue #---------- - PROBLEM_NAME chan + PROBLEM_NAME chan - TIME_STEP 0.5 - NUMBER_OF_TIME_STEPS 36000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 30001 # wait 6000 for statistics - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # start right from restart - STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # wait 6000 for statistics + TIME_STEP 0.5 + NUMBER_OF_TIME_STEPS 36000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 30001 # wait 6000 for statistics + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # start right from restart + STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # wait 6000 for statistics - RESULTS_SAVE_INTERVAL 600 - SWARM_SAVE_INTERVAL 600 - BACKUP_SAVE_INTERVAL 12000 + RESULTS_SAVE_INTERVAL 600 + SWARM_SAVE_INTERVAL 600 + BACKUP_SAVE_INTERVAL 12000 - LOAD_BACKUP_NAME chan-ts024000.backup + LOAD_BACKUP_NAME chan-ts024000.backup #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 3.0e-5 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 3.0e-5 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes + PARTICLE_TRACKING yes # SWARM_SUBGRID_SCALE_MODEL brownian_fukagata - SWARM_DIAMETER 3.66356E-03 - SWARM_DENSITY 1000 - NUMBER_OF_SWARM_SUB_STEPS 2 - MAX_PARTICLES 100000 - SWARM_COEFFICIENT_OF_RESTITUTION 1.0 + SWARM_DIAMETER 3.66356E-03 + SWARM_DENSITY 1000 + NUMBER_OF_SWARM_SUB_STEPS 2 + MAX_PARTICLES 100000 + SWARM_COEFFICIENT_OF_RESTITUTION 1.0 #------------------- # Turbulence model #------------------- - TURBULENCE_MODEL HYBRID_LES_RANS + TURBULENCE_MODEL HYBRID_LES_RANS - PRESSURE_DROPS 2.0e-5 0.0 0.0 - MASS_FLOW_RATES 0.4046 0.0 0.0 + PRESSURE_DROPS 2.0e-5 0.0 0.0 + MASS_FLOW_RATES 0.4046 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM central - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/End_Of_Time_Step.f90 b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/End_Of_Time_Step.f90 index e373d6345..7248a6b29 100644 --- a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/End_Of_Time_Step.f90 @@ -1,15 +1,8 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! -!------------------------------------------------------------------------------! -!----------------------------------[Modules]-----------------------------------! - use Grid_Mod, only: Grid_Type - use Field_Mod, only: Field_Type - use Var_Mod, only: Var_Type - use Const_Mod, only: PI - use Comm_Mod, only: Comm_Mod_Global_Max_Real, this_proc !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -17,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! current time step integer :: n_stat_t ! 1st t.s. for turb. stat. integer :: n_stat_p ! 1st t.s. for swarm. stat. - real :: time ! physical time !------------------------------[Local parameters]------------------------------! real, parameter :: LX = 6.28 ! streamwise real, parameter :: LY = 3.14 ! spanwise @@ -50,8 +41,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & t => Flow % t ! Reading starting time for Swarm statistics from control file - call Control_Mod_Starting_Time_Step_For_Swarm_Statistics & - (n_stat_p, verbose=.true.) + call Control % Starting_Time_Step_For_Swarm_Statistics & + (n_stat_p, verbose=.true.) ! Reynolds number should be passed from Save_Results and number of bins should ! be defined in control file, also same for n_bin... (it's okey for now!) @@ -79,7 +70,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !! nn = n - 340000 - 1 ! since we started having particle distribution from... ! ! ... n = 340001! !! if(mod(nn , 2500) .eq. 0 .or. n .eq. n_bin .and. n .le. 347500) then -! if(this_proc < 2) then +! if(First_Proc()) then ! ! level = 0.0 ! temp = 0 @@ -158,13 +149,13 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !------------------------! ! If not time for disturbing the velocity field, return - if(mod(n, 120) .ne. 0) return + if(mod(Time % Curr_Dt(), 120) .ne. 0) return ! If too late to disturb, get out too - if(n > 1200) return + if(Time % Curr_Dt() > 1200) return ! Print a message - if(this_proc < 2) then + if(First_Proc()) then print *, '# Superimposing random eddies on top of velocity field!' end if @@ -255,7 +246,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & vmax = max(vmax, abs(v % n(c))) vmax = max(vmax, abs(w % n(c))) end do - call Comm_Mod_Global_Max_Real(vmax) + call Global % Max_Real(vmax) do c = 1, Grid % n_cells v % n(c) = v % n(c) / vmax / 5.0 v % o(c) = v % o(c) / vmax / 5.0 diff --git a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Insert_Particles.f90 b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Insert_Particles.f90 index af49f4429..43c9c5abc 100644 --- a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Insert_Particles.f90 +++ b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! current time step - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid integer :: k, n_parts_in_buffers @@ -27,7 +25,7 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) !-----------------------! ! 24001st time step ! !-----------------------! - if(n .eq. 24001) then ! should be after the Flow is developed + if(Time % Curr_Dt() .eq. 24001) then ! should be after the Flow is developed ! Track maximum number of particles Swarm % n_particles = Swarm % max_particles diff --git a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Results.f90 b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Results.f90 index 7b507d370..3a1ba7205 100644 --- a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Results.f90 +++ b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Results.f90 @@ -1,18 +1,10 @@ !==============================================================================! - subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) + subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results in homogeneous directions. ! ! ! ! The results are then writen in files name_res.dat and name_res_plus.dat ! -!------------------------------------------------------------------------------! - use Const_Mod ! constants - use Comm_Mod ! parallel stuff - use Grid_Mod, only: Grid_Type - use Field_Mod, only: Field_Type - use Bulk_Mod, only: Bulk_Type - use Var_Mod, only: Var_Type - use Turb_Mod !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -20,7 +12,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! current time step integer, optional, intent(in) :: domain ! current domain !-----------------------------------[Locals]-----------------------------------! type(Var_Type), pointer :: u, v, w, t @@ -47,8 +38,8 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) call Flow % Alias_Energy (t) ! Take constant physical properties - call Control_Mod_Mass_Density (dens_const) - call Control_Mod_Dynamic_Viscosity(visc_const) + call Control % Mass_Density (dens_const) + call Control % Dynamic_Viscosity(visc_const) ! Set the name for coordinate file call File % Set_Name(coord_name, extension='.1d') @@ -58,7 +49,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -118,7 +109,7 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) !do c = 1, Grid % n_cells - Grid % comm % n_buff_cells ! ww_mod_p(c) = Turb % kin_mean(c) * Turb % zeta_mean(c) !end do - !if(this_proc < 2) then + !if(First_Proc()) then ! print *, "w_mod(503) = ", ww_mod_p(503) ! print *, "min_val_wmod = ", minval(ww_mod_p(:)) ! print *, "max_val_wmod = ", maxval(ww_mod_p(:)) @@ -166,30 +157,30 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) ! Average over all processors do pl=1, n_prob-1 - call Comm_Mod_Global_Sum_Int(n_count(pl)) - - call Comm_Mod_Global_Sum_Real(wall_p(pl)) - - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) - - call Comm_Mod_Global_Sum_Real(uu_p(pl)) - call Comm_Mod_Global_Sum_Real(vv_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_p(pl)) - call Comm_Mod_Global_Sum_Real(uw_p(pl)) - - call Comm_Mod_Global_Sum_Real(uw_mod_p(pl)) - call Comm_Mod_Global_Sum_Real(kin_p (pl)) - call Comm_Mod_Global_Sum_Real(eps_p (pl)) - call Comm_Mod_Global_Sum_Real(zeta_p (pl)) - call Comm_Mod_Global_Sum_Real(f22_p (pl)) - call Comm_Mod_Global_Sum_Real(vis_t_p (pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) - call Comm_Mod_Global_Sum_Real(ww_mod_p(pl)) + call Global % Sum_Int(n_count(pl)) + + call Global % Sum_Real(wall_p(pl)) + + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) + + call Global % Sum_Real(uu_p(pl)) + call Global % Sum_Real(vv_p(pl)) + call Global % Sum_Real(ww_p(pl)) + call Global % Sum_Real(uw_p(pl)) + + call Global % Sum_Real(uw_mod_p(pl)) + call Global % Sum_Real(kin_p (pl)) + call Global % Sum_Real(eps_p (pl)) + call Global % Sum_Real(zeta_p (pl)) + call Global % Sum_Real(f22_p (pl)) + call Global % Sum_Real(vis_t_p (pl)) + call Global % Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(ww_mod_p(pl)) end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 if(n_count(i) .ne. 0) then @@ -230,16 +221,16 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) end if if(u_tau_p < TINY) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Results.f90!' end if return end if - call File % Set_Name(result_name, time_step = curr_dt, & + call File % Set_Name(result_name, time_step = Time % Curr_Dt(), & appendix='-res', extension='.dat') call File % Open_For_Writing_Ascii(result_name, fu1) - call File % Set_Name(result_name_plus, time_step = curr_dt, & + call File % Set_Name(result_name_plus, time_step = Time % Curr_Dt(), & appendix='-res-plus', extension='.dat') call File % Open_For_Writing_Ascii(result_name_plus, fu2) @@ -344,6 +335,6 @@ subroutine User_Mod_Save_Results(Flow, Turb, Vof, Swarm, curr_dt, domain) close(fu1) close(fu2) - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Results.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Results.f90.' end subroutine diff --git a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Swarm.f90 b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Swarm.f90 index eacc1a694..b45d9fe67 100644 --- a/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Swarm.f90 +++ b/Tests/Swarm/Channel_Re_Tau_590/User_Mod/Save_Swarm.f90 @@ -1,20 +1,11 @@ !==============================================================================! - subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) + subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, domain) !------------------------------------------------------------------------------! ! This subroutine reads name.1d file created by Convert or Generator and ! ! averages the results for paerticles in homogeneous directions. ! ! ! ! The results are then writen in files swarm_name_res.dat and ! ! swarm_name_res_plus.dat ! -!------------------------------------------------------------------------------! - use Const_Mod ! constants - use Comm_Mod ! parallel stuff - use Grid_Mod, only: Grid_Type - use Field_Mod, only: Field_Type - use Bulk_Mod, only: Bulk_Type - use Var_Mod, only: Var_Type - use Turb_Mod - use Swarm_Mod !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -22,7 +13,6 @@ subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: curr_dt ! current time step integer, optional, intent(in) :: domain ! current domain !-----------------------------------[Locals]-----------------------------------! type(Var_Type), pointer :: u, v, w, t @@ -62,7 +52,7 @@ subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) !------------------! inquire(file=coord_name, exist=there) if(.not. there) then - if(this_proc < 2) then + if(First_Proc()) then print *, '#==============================================================' print *, '# In order to extract profiles and write them in ascii files' print *, '# the code has to read cell-faces coordinates ' @@ -181,27 +171,27 @@ subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) do pl = 1, n_prob-1 ! Carrier Flow - call Comm_Mod_Global_Sum_Int(n_count2(pl)) - call Comm_Mod_Global_Sum_Real(wall_p(pl)) - call Comm_Mod_Global_Sum_Real(u_p(pl)) - call Comm_Mod_Global_Sum_Real(v_p(pl)) - call Comm_Mod_Global_Sum_Real(w_p(pl)) + call Global % Sum_Int(n_count2(pl)) + call Global % Sum_Real(wall_p(pl)) + call Global % Sum_Real(u_p(pl)) + call Global % Sum_Real(v_p(pl)) + call Global % Sum_Real(w_p(pl)) - call Comm_Mod_Global_Sum_Real(vis_t_p (pl)) - call Comm_Mod_Global_Sum_Real(y_plus_p(pl)) + call Global % Sum_Real(vis_t_p (pl)) + call Global % Sum_Real(y_plus_p(pl)) ! Swarm - call Comm_Mod_Global_Sum_Int(n_states(pl)) - call Comm_Mod_Global_Sum_Real(u_pp(pl)) - call Comm_Mod_Global_Sum_Real(v_pp(pl)) - call Comm_Mod_Global_Sum_Real(w_pp(pl)) - call Comm_Mod_Global_Sum_Real(uu_pp(pl)) - call Comm_Mod_Global_Sum_Real(vv_pp(pl)) - call Comm_Mod_Global_Sum_Real(ww_pp(pl)) - call Comm_Mod_Global_Sum_Real(uw_pp(pl)) + call Global % Sum_Int(n_states(pl)) + call Global % Sum_Real(u_pp(pl)) + call Global % Sum_Real(v_pp(pl)) + call Global % Sum_Real(w_pp(pl)) + call Global % Sum_Real(uu_pp(pl)) + call Global % Sum_Real(vv_pp(pl)) + call Global % Sum_Real(ww_pp(pl)) + call Global % Sum_Real(uw_pp(pl)) end do - call Comm_Mod_Wait + call Global % Wait do i = 1, n_prob-1 @@ -231,10 +221,10 @@ subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) ! Creating files for swarm statistics call File % Set_Name(swarm_result_name, appendix='-swarm-res', & - time_step=curr_dt, extension='.dat') + time_step=Time % Curr_Dt(), extension='.dat') call File % Open_For_Writing_Ascii(swarm_result_name, fu1) call File % Set_Name(swarm_result_name_plus, appendix='-swarm-res-plus', & - time_step=curr_dt, extension='.dat') + time_step=Time % Curr_Dt(), extension='.dat') call File % Open_For_Writing_Ascii(swarm_result_name_plus, fu2) ! Calculating friction velocity and friction temperature (for the flow!) @@ -243,7 +233,7 @@ subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) w_p(1)**2) / wall_p(1))) if(u_tau_p .eq. 0.0) then - if(this_proc < 2) then + if(First_Proc()) then write(*,*) '# Friction velocity is zero in Save_Swarm.f90!' end if return @@ -329,6 +319,6 @@ subroutine User_Mod_Save_Swarm(Flow, Turb, Vof, Swarm, curr_dt, domain) close(fu1) close(fu2) - if(this_proc < 2) print *, '# Finished with User_Mod_Save_Swarm.f90.' + if(First_Proc()) print *, '# Finished with User_Mod_Save_Swarm.f90.' end subroutine diff --git a/Tests/Swarm/Channel_Re_Tau_590/control_a_flow_development b/Tests/Swarm/Channel_Re_Tau_590/control_a_flow_development index ebec6085b..b956aa827 100644 --- a/Tests/Swarm/Channel_Re_Tau_590/control_a_flow_development +++ b/Tests/Swarm/Channel_Re_Tau_590/control_a_flow_development @@ -1,66 +1,66 @@ #---------- # Prologue #---------- - PROBLEM_NAME chan + PROBLEM_NAME chan - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 24000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 18001 # 6000 for statistics - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # after the last time step - STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # beyond this computation + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 24000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 18001 # 6000 for statistics + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # after the last time step + STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # beyond this computation - RESULTS_SAVE_INTERVAL 1200 - SWARM_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 12000 + RESULTS_SAVE_INTERVAL 1200 + SWARM_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 12000 #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 3.0e-5 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 3.0e-5 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes + PARTICLE_TRACKING yes # SWARM_SUBGRID_SCALE_MODEL brownian_fukagata - SWARM_DIAMETER 9.144936E-04 - SWARM_DENSITY 1000 - NUMBER_OF_SWARM_SUB_STEPS 2 - MAX_PARTICLES 100000 - SWARM_COEFFICIENT_OF_RESTITUTION 1.0 + SWARM_DIAMETER 9.144936E-04 + SWARM_DENSITY 1000 + NUMBER_OF_SWARM_SUB_STEPS 2 + MAX_PARTICLES 100000 + SWARM_COEFFICIENT_OF_RESTITUTION 1.0 #------------------- # Turbulence model #------------------- - TURBULENCE_MODEL HYBRID_LES_RANS + TURBULENCE_MODEL HYBRID_LES_RANS - PRESSURE_DROPS 0.0003133 0.0 0.0 - MASS_FLOW_RATES 1.98 0.0 0.0 + PRESSURE_DROPS 0.0003133 0.0 0.0 + MASS_FLOW_RATES 1.98 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM central - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Channel_Re_Tau_590/control_b_particles b/Tests/Swarm/Channel_Re_Tau_590/control_b_particles index c92246d01..4029fb878 100644 --- a/Tests/Swarm/Channel_Re_Tau_590/control_b_particles +++ b/Tests/Swarm/Channel_Re_Tau_590/control_b_particles @@ -1,68 +1,68 @@ #---------- # Prologue #---------- - PROBLEM_NAME chan + PROBLEM_NAME chan - TIME_STEP 0.05 - NUMBER_OF_TIME_STEPS 36000 - STARTING_TIME_STEP_FOR_TURB_STATISTICS 30001 # wait 6000 for statistics - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # start right from restart - STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # wait 6000 for statistics + TIME_STEP 0.05 + NUMBER_OF_TIME_STEPS 36000 + STARTING_TIME_STEP_FOR_TURB_STATISTICS 30001 # wait 6000 for statistics + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 24001 # start right from restart + STARTING_TIME_STEP_FOR_SWARM_STATISTICS 30001 # wait 6000 for statistics - RESULTS_SAVE_INTERVAL 1200 - SWARM_SAVE_INTERVAL 1200 - BACKUP_SAVE_INTERVAL 12000 + RESULTS_SAVE_INTERVAL 1200 + SWARM_SAVE_INTERVAL 1200 + BACKUP_SAVE_INTERVAL 12000 - LOAD_BACKUP_NAME chan-ts024000.backup + LOAD_BACKUP_NAME chan-ts024000.backup #------------------- # Monitoring points #------------------- - POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 0.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 3.0e-5 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 3.0e-5 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes + PARTICLE_TRACKING yes # SWARM_SUBGRID_SCALE_MODEL brownian_fukagata - SWARM_DIAMETER 9.144936E-04 - SWARM_DENSITY 1000 - NUMBER_OF_SWARM_SUB_STEPS 2 - MAX_PARTICLES 100000 - SWARM_COEFFICIENT_OF_RESTITUTION 1.0 + SWARM_DIAMETER 9.144936E-04 + SWARM_DENSITY 1000 + NUMBER_OF_SWARM_SUB_STEPS 2 + MAX_PARTICLES 100000 + SWARM_COEFFICIENT_OF_RESTITUTION 1.0 #------------------- # Turbulence model #------------------- - TURBULENCE_MODEL HYBRID_LES_RANS + TURBULENCE_MODEL HYBRID_LES_RANS - PRESSURE_DROPS 0.0003133 0.0 0.0 - MASS_FLOW_RATES 1.98 0.0 0.0 + PRESSURE_DROPS 0.0003133 0.0 0.0 + MASS_FLOW_RATES 1.98 0.0 0.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.8 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.8 - TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central + TIME_INTEGRATION_SCHEME parabolic + ADVECTION_SCHEME_FOR_MOMENTUM central - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-4 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-4 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 240 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Cylinders_Periodic/User_Mod/Insert_Particles.f90 b/Tests/Swarm/Cylinders_Periodic/User_Mod/Insert_Particles.f90 index b5645b523..29a9bf46f 100644 --- a/Tests/Swarm/Cylinders_Periodic/User_Mod/Insert_Particles.f90 +++ b/Tests/Swarm/Cylinders_Periodic/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! integer :: i, j, k, n_parts_in_buffers real :: x, y, z, dy, dz, my, mz @@ -21,7 +19,7 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) !----------------------------------------------------! ! Initialize particles only in the 1st time step ! !----------------------------------------------------! - if(n .eq. 1) then + if(Time % Curr_Dt() .eq. 1) then dy = 4.0 / NJ dz = 1.0 / NK diff --git a/Tests/Swarm/Cylinders_Periodic/control b/Tests/Swarm/Cylinders_Periodic/control index acb4e68cc..8952fb689 100644 --- a/Tests/Swarm/Cylinders_Periodic/control +++ b/Tests/Swarm/Cylinders_Periodic/control @@ -1,66 +1,65 @@ #---------- # Prologue #--------- - PROBLEM_NAME cylinder - HEAT_TRANSFER no + PROBLEM_NAME cylinder + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 3600 - RESULTS_SAVE_INTERVAL 6 - SWARM_SAVE_INTERVAL 6 - BACKUP_SAVE_INTERVAL 300 - TIME_STEP 0.1 + NUMBER_OF_TIME_STEPS 3600 + RESULTS_SAVE_INTERVAL 6 + SWARM_SAVE_INTERVAL 6 + BACKUP_SAVE_INTERVAL 300 + TIME_STEP 0.1 #------------------- -# Monitoring points +# Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 1.5 0.5 0.5 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 1.5 0.5 0.5 - POINT_FOR_MONITORING_PLANES 1.5 0.5 0.5 + POINT_FOR_MONITORING_PLANES 1.5 0.5 0.5 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0e-4 - HEAT_CAPACITY 1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0e-4 + HEAT_CAPACITY 1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - TURBULENCE_MODEL none - MASS_FLOW_RATES 2.0 0.0 0.0 + TURBULENCE_MODEL none + MASS_FLOW_RATES 2.0 0.0 0.0 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes - SWARM_DIAMETER 1.8e-3 - SWARM_DENSITY 1.0e+3 - NUMBER_OF_SWARM_SUB_STEPS 12 - MAX_PARTICLES 64 - SWARM_COEFFICIENT_OF_RESTITUTION 1.00 - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 30 + PARTICLE_TRACKING yes + SWARM_DIAMETER 1.8e-3 + SWARM_DENSITY 1.0e+3 + NUMBER_OF_SWARM_SUB_STEPS 12 + MAX_PARTICLES 64 + SWARM_COEFFICIENT_OF_RESTITUTION 1.00 + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 30 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear - - ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Rod_Bundle_Hexagonal/control b/Tests/Swarm/Rod_Bundle_Hexagonal/control index 690d78c11..0c74208ca 100644 --- a/Tests/Swarm/Rod_Bundle_Hexagonal/control +++ b/Tests/Swarm/Rod_Bundle_Hexagonal/control @@ -1,67 +1,67 @@ #---------- # Prologue #--------- - PROBLEM_NAME rod_hex - HEAT_TRANSFER no + PROBLEM_NAME rod_hex + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 24000 - RESULTS_SAVE_INTERVAL 10 - BACKUP_SAVE_INTERVAL 3000 - TIME_STEP 0.003 + NUMBER_OF_TIME_STEPS 24000 + RESULTS_SAVE_INTERVAL 10 + BACKUP_SAVE_INTERVAL 3000 + TIME_STEP 0.003 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.007 0.00 0.002 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.007 0.00 0.002 - POINT_FOR_MONITORING_PLANES 0.007 0.00 0.002 + POINT_FOR_MONITORING_PLANES 0.007 0.00 0.002 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 2.0e-4 - HEAT_CAPACITY 1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 2.0e-4 + HEAT_CAPACITY 1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - TURBULENCE_MODEL les_smagorinsky - PRESSURE_DROPS 3.6 0.0 0.0 - MASS_FLOW_RATES 0.5 0.0 0.0 + TURBULENCE_MODEL les_smagorinsky + PRESSURE_DROPS 3.6 0.0 0.0 + MASS_FLOW_RATES 0.5 0.0 0.0 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes - SWARM_DIAMETER 5.0e-04 - SWARM_DENSITY 1.0e+03 - NUMBER_OF_SWARM_SUB_STEPS 12 - MAX_PARTICLES 256 - SWARM_COEFFICIENT_OF_RESTITUTION 1.00 - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 3000 + PARTICLE_TRACKING yes + SWARM_DIAMETER 5.0e-04 + SWARM_DENSITY 1.0e+03 + NUMBER_OF_SWARM_SUB_STEPS 12 + MAX_PARTICLES 256 + SWARM_COEFFICIENT_OF_RESTITUTION 1.00 + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 3000 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 - TIME_INTEGRATION_SCHEME parabolic + TIME_INTEGRATION_SCHEME parabolic - ADVECTION_SCHEME_FOR_MOMENTUM central - CHOI_CORRECTION yes + ADVECTION_SCHEME_FOR_MOMENTUM central + CHOI_CORRECTION yes #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Rod_Bundle_Polyhedral/User_Mod/Insert_Particles.f90 b/Tests/Swarm/Rod_Bundle_Polyhedral/User_Mod/Insert_Particles.f90 index eec9f8bcf..6a3c82544 100644 --- a/Tests/Swarm/Rod_Bundle_Polyhedral/User_Mod/Insert_Particles.f90 +++ b/Tests/Swarm/Rod_Bundle_Polyhedral/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! integer :: i, j, k, n_parts_in_buffers real :: x, y, z, xo, yo, zo, dy, dz, my, mz @@ -22,7 +20,7 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) !----------------------------------------------------! ! Initialize particles only in the 1st time step ! !----------------------------------------------------! - if(n .eq. 1) then + if(Time % Curr_Dt() .eq. 1) then ! Leave 10% margin xo = -1.0 diff --git a/Tests/Swarm/Rod_Bundle_Polyhedral/control b/Tests/Swarm/Rod_Bundle_Polyhedral/control index 16c6f3e54..264b254ff 100644 --- a/Tests/Swarm/Rod_Bundle_Polyhedral/control +++ b/Tests/Swarm/Rod_Bundle_Polyhedral/control @@ -1,64 +1,64 @@ #---------- # Prologue #--------- - PROBLEM_NAME rod_tet_dual - HEAT_TRANSFER no + PROBLEM_NAME rod_tet_dual + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 4500 - RESULTS_SAVE_INTERVAL 10 - SWARM_SAVE_INTERVAL 10 - BACKUP_SAVE_INTERVAL 500 - TIME_STEP 0.003 + NUMBER_OF_TIME_STEPS 4500 + RESULTS_SAVE_INTERVAL 10 + SWARM_SAVE_INTERVAL 10 + BACKUP_SAVE_INTERVAL 500 + TIME_STEP 0.003 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.007 0.00 0.002 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.007 0.00 0.002 - POINT_FOR_MONITORING_PLANES 0.007 0.00 0.002 + POINT_FOR_MONITORING_PLANES 0.007 0.00 0.002 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 2.0e-4 - HEAT_CAPACITY 1.0 - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 2.0e-4 + HEAT_CAPACITY 1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - TURBULENCE_MODEL none - PRESSURE_DROPS 3.6 0.0 0.0 - MASS_FLOW_RATES 0.5 0.0 0.0 + TURBULENCE_MODEL none + PRESSURE_DROPS 3.6 0.0 0.0 + MASS_FLOW_RATES 0.5 0.0 0.0 #---------------- # Swarm related #---------------- - PARTICLE_TRACKING yes - SWARM_DIAMETER 5.0e-04 - SWARM_DENSITY 1.0e+03 - NUMBER_OF_SWARM_SUB_STEPS 12 - MAX_PARTICLES 256 - SWARM_COEFFICIENT_OF_RESTITUTION 1.00 - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 500 + PARTICLE_TRACKING yes + SWARM_DIAMETER 5.0e-04 + SWARM_DENSITY 1.0e+03 + NUMBER_OF_SWARM_SUB_STEPS 12 + MAX_PARTICLES 256 + SWARM_COEFFICIENT_OF_RESTITUTION 1.00 + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 500 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 + PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 250 - TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod + TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM minmod #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 #-------------------- # Initial conditions diff --git a/Tests/Swarm/T_Junction_Circular/control b/Tests/Swarm/T_Junction_Circular/control index e11eb8890..b5c59d9e8 100644 --- a/Tests/Swarm/T_Junction_Circular/control +++ b/Tests/Swarm/T_Junction_Circular/control @@ -1,56 +1,54 @@ #---------- # Prologue #---------- - PROBLEM_NAME t_junction - HEAT_TRANSFER no + PROBLEM_NAME t_junction + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 1200 + NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 - TIME_STEP 0.001 + TIME_STEP 0.001 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.8e-5 - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.8e-5 - - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM upwind + ADVECTION_SCHEME_FOR_MOMENTUM upwind #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 6 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 666 + MIN_SIMPLE_ITERATIONS 6 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 666 #-------------------- # Initial conditions diff --git a/Tests/Swarm/T_Junction_Square/User_Mod/Force.f90 b/Tests/Swarm/T_Junction_Square/User_Mod/Force.f90 index cec3614b4..3608b0336 100644 --- a/Tests/Swarm/T_Junction_Square/User_Mod/Force.f90 +++ b/Tests/Swarm/T_Junction_Square/User_Mod/Force.f90 @@ -20,11 +20,11 @@ subroutine User_Mod_Force(Flow, Por, ui, a_matrix, b_vector) ! Take aliases Grid => Flow % pnt_grid - !----------------------------------------------------! + !----------------------------------------------------! ! ! ! Set source depending on the velocity component ! ! ! - !----------------------------------------------------! + !----------------------------------------------------! !-------------------------------------------------------! ! Set source for velocity component in "x" direction ! diff --git a/Tests/Swarm/T_Junction_Square/User_Mod/Insert_Particles.f90 b/Tests/Swarm/T_Junction_Square/User_Mod/Insert_Particles.f90 index db932a0f3..602ab18c7 100644 --- a/Tests/Swarm/T_Junction_Square/User_Mod/Insert_Particles.f90 +++ b/Tests/Swarm/T_Junction_Square/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the end of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! type(Grid_Type), pointer :: Grid integer :: k, n_parts_in_buffers, c @@ -23,7 +21,7 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) !----------------------! ! 1201st time step ! !----------------------! - if(n .eq. 1201) then ! should be after the flow is developed + if(Time % Curr_Dt() .eq. 1201) then ! should be after the flow is developed ! Compute all particles Swarm % n_particles = Swarm % max_particles diff --git a/Tests/Swarm/T_Junction_Square/control-1 b/Tests/Swarm/T_Junction_Square/control-1 index fca96a3b6..4d120b2e7 100644 --- a/Tests/Swarm/T_Junction_Square/control-1 +++ b/Tests/Swarm/T_Junction_Square/control-1 @@ -1,55 +1,55 @@ #---------- # Prologue #---------- - PROBLEM_NAME t_junction - HEAT_TRANSFER no + PROBLEM_NAME t_junction + HEAT_TRANSFER no - NUMBER_OF_TIME_STEPS 1200 + NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 120 - BACKUP_SAVE_INTERVAL 600 - SAVE_INITIAL_CONDITION no - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 120 + BACKUP_SAVE_INTERVAL 600 + SAVE_INITIAL_CONDITION no + SAVE_RESULTS_AT_BOUNDARIES no - TIME_STEP 1.0e-3 + TIME_STEP 1.0e-3 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.8e-5 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.8e-5 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.5 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.5 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.5 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.5 - TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM upwind + TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM upwind #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 3 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 33 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 333 + MIN_SIMPLE_ITERATIONS 3 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 33 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 333 #-------------------- # Initial conditions diff --git a/Tests/Swarm/T_Junction_Square/control-2 b/Tests/Swarm/T_Junction_Square/control-2 index 827d2db8b..674778aa3 100644 --- a/Tests/Swarm/T_Junction_Square/control-2 +++ b/Tests/Swarm/T_Junction_Square/control-2 @@ -1,63 +1,63 @@ #---------- # Prologue #---------- - PROBLEM_NAME t_junction - HEAT_TRANSFER no - PARTICLE_TRACKING yes + PROBLEM_NAME t_junction + HEAT_TRANSFER no + PARTICLE_TRACKING yes - NUMBER_OF_TIME_STEPS 3600 + NUMBER_OF_TIME_STEPS 3600 - RESULTS_SAVE_INTERVAL 120 - SWARM_SAVE_INTERVAL 6 - BACKUP_SAVE_INTERVAL 600 - SAVE_INITIAL_CONDITION no - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 120 + SWARM_SAVE_INTERVAL 6 + BACKUP_SAVE_INTERVAL 600 + SAVE_INITIAL_CONDITION no + SAVE_RESULTS_AT_BOUNDARIES no - LOAD_BACKUP_NAME t_junction-ts001200.backup - TIME_STEP 1.0e-4 + LOAD_BACKUP_NAME t_junction-ts001200.backup + TIME_STEP 1.0e-4 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 1 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 1 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.8e-5 - MAX_PARTICLES 16 - SWARM_DENSITY 1000.0 - SWARM_DIAMETER 2.5e-5 - SWARM_COEFFICIENT_OF_RESTITUTION 0.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.8e-5 + MAX_PARTICLES 16 + SWARM_DENSITY 1000.0 + SWARM_DIAMETER 2.5e-5 + SWARM_COEFFICIENT_OF_RESTITUTION 0.0 # NUMBER_OF_SWARM_SUBSTEPS 120 - TURBULENCE_MODEL none + TURBULENCE_MODEL none #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING piso - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.5 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.5 + PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.5 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.5 - TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM upwind + TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM upwind #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-3 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-5 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 - MIN_SIMPLE_ITERATIONS 1 - MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 33 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 333 + MIN_SIMPLE_ITERATIONS 1 + MAX_ITERATIONS_FOR_MOMENTUM_SOLVER 33 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 333 #-------------------- # Initial conditions diff --git a/Tests/Swarm/Three_Phase_Flow/User_Mod/Insert_Particles.f90 b/Tests/Swarm/Three_Phase_Flow/User_Mod/Insert_Particles.f90 index bf0f47d76..ef31fade3 100644 --- a/Tests/Swarm/Three_Phase_Flow/User_Mod/Insert_Particles.f90 +++ b/Tests/Swarm/Three_Phase_Flow/User_Mod/Insert_Particles.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) + subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm) !------------------------------------------------------------------------------! ! This function is called at the beginning of time step. ! !------------------------------------------------------------------------------! @@ -9,8 +9,6 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step - real, intent(in) :: time ! physical time !----------------------------------[Locals]------------------------------------! integer :: i, j, k, p, n_parts_in_buffers, c real :: x, y, z, xo, yo, zo, xn, yn, zn @@ -22,7 +20,7 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) !----------------------------------------------------! ! Initialize particles only in the 1st time step ! !----------------------------------------------------! - if(n .eq. 1) then + if(Time % Curr_Dt() .eq. 1) then ! Leave 10% margin xo = -0.005 @@ -59,12 +57,12 @@ subroutine User_Mod_Insert_Particles(Flow, Turb, Vof, Swarm, n, time) ! Cell is invalid if(Swarm % Particle(p) % cell .eq. -1) then - print '(a,i6,a,i6,a)', ' # PANIC: Particle ', p, & - ' from processor ', this_proc, & + print '(a,i6,a,i6,a)', ' # PANIC: Particle ', p, & + ' from processor ', This_Proc(), & ' couldn''t be located!' print *, '# Check initial placement of particles.' print *, '# This error is critical, exiting!' - call Comm_Mod_End + call Global % End_Parallel stop end if diff --git a/Tests/Swarm/Three_Phase_Flow/control b/Tests/Swarm/Three_Phase_Flow/control index e71816a4f..ac267287c 100644 --- a/Tests/Swarm/Three_Phase_Flow/control +++ b/Tests/Swarm/Three_Phase_Flow/control @@ -1,99 +1,93 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no - INTERFACE_TRACKING yes - TRACK_FRONT yes + PROBLEM_NAME cavity + HEAT_TRANSFER no + INTERFACE_TRACKING yes + TRACK_FRONT yes - NUMBER_OF_TIME_STEPS 1200 + NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 5 - SWARM_SAVE_INTERVAL 5 - BACKUP_SAVE_INTERVAL 3000 + RESULTS_SAVE_INTERVAL 5 + SWARM_SAVE_INTERVAL 5 + BACKUP_SAVE_INTERVAL 3000 #----------------------------------------------------- # dt <= sqrt( (rho_L + rho_G) * min_vol/(8 * sigma)) # # dt <= sqrt( 1001 * 5.5e-12 / (8 * 0.1)) = 8.29e-5 #----------------------------------------------------- - TIME_STEP 0.0001 # original (for finer grid) was 0.0005 + TIME_STEP 0.0001 # original (for finer grid) was 0.0005 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0e+3 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 0.001 - HEAT_CAPACITY 1.0 + MASS_DENSITY 1.0e+3 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 0.001 + HEAT_CAPACITY 1.0 #--------------------------------------------- # La = gamma * rho * L / mu^2 # = 0.05 * 1000 * 0.005 / 0.005^2 = 10'000 #--------------------------------------------- - PHASE_DENSITIES 1.0 1.0e3 - PHASE_VISCOSITIES 0.005 0.005 # 0.01 0.01 - SURFACE_TENSION 0.05 # 0.36 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 - - PARTICLE_TRACKING yes - SWARM_DIAMETER 5.0e-04 - SWARM_DENSITY 1.0e+04 - NUMBER_OF_SWARM_SUB_STEPS 12 - MAX_PARTICLES 1250 - SWARM_COEFFICIENT_OF_RESTITUTION 1.00 - STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 1 + PHASE_DENSITIES 1.0 1.0e3 + PHASE_VISCOSITIES 0.005 0.005 # 0.01 0.01 + SURFACE_TENSION 0.05 # 0.36 + + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 + + PARTICLE_TRACKING yes + SWARM_DIAMETER 5.0e-04 + SWARM_DENSITY 1.0e+04 + NUMBER_OF_SWARM_SUB_STEPS 12 + MAX_PARTICLES 1250 + SWARM_COEFFICIENT_OF_RESTITUTION 1.00 + STARTING_TIME_STEP_FOR_SWARM_COMPUTATION 1 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - - TIME_INTEGRATION_SCHEME linear + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.6 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.4 - ADVECTION_SCHEME_FOR_MOMENTUM quick - ADVECTION_SCHEME_FOR_VOF cicsam - GU_CORRECTION yes - CHOI_CORRECTION yes + TIME_INTEGRATION_SCHEME linear - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - GRADIENT_METHOD_FOR_VOF gauss_theorem - MAX_ITERATIONS_FOR_GAUSS_GRADIENTS 200 - MAX_ITERATIONS_FOR_VOF_GRADIENTS 200 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 + ADVECTION_SCHEME_FOR_MOMENTUM quick + ADVECTION_SCHEME_FOR_VOF cicsam + GU_CORRECTION yes + CHOI_CORRECTION yes -# NODAL_CURVATURE yes + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_VOF gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 200 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-6 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 - MAX_SIMPLE_ITERATIONS 20 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - MIN_SIMPLE_ITERATIONS 3 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-6 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-6 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-3 + TOLERANCE_FOR_VOF_SOLVER 1.e-6 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 + MAX_SIMPLE_ITERATIONS 20 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 + MIN_SIMPLE_ITERATIONS 3 +# DUAL_TIME_STEP_VOF yes #-------------------- # Initial conditions diff --git a/Tests/Swarm/Three_Phase_Flow/sphere.stl b/Tests/Swarm/Three_Phase_Flow/sphere.stl new file mode 100644 index 000000000..7b1341e79 Binary files /dev/null and b/Tests/Swarm/Three_Phase_Flow/sphere.stl differ diff --git a/Tests/Vof/Dam_Break_2d/control b/Tests/Vof/Dam_Break_2d/control index f68c5c6e4..c1cf7809e 100644 --- a/Tests/Vof/Dam_Break_2d/control +++ b/Tests/Vof/Dam_Break_2d/control @@ -1,73 +1,69 @@ #---------- # Prologue #---------- - PROBLEM_NAME dam_2d -INTERFACE_TRACKING yes + PROBLEM_NAME dam_2d + INTERFACE_TRACKING yes # sqrt(9.81/0.6) = 4.04351332383 # if dt = 1.0 / sqrt(9.81/0.6) / 1200 = 0.0002060914; # 1200 time steps will correspond to 1 in the thesis # 9600 time steps will correspond to 8 in the thesis # 12000 time steps will correspond to 8 in the thesis - TIME_STEP 0.0002060914 + TIME_STEP 0.0002060914 - NUMBER_OF_TIME_STEPS 12000 - RESULTS_SAVE_INTERVAL 300 - BACKUP_SAVE_INTERVAL 3000 - SAVE_RESULTS_AT_BOUNDARIES no + NUMBER_OF_TIME_STEPS 12000 + RESULTS_SAVE_INTERVAL 300 + BACKUP_SAVE_INTERVAL 3000 + SAVE_RESULTS_AT_BOUNDARIES no #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 1.5 0.0 0.75 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 1.5 0.0 0.75 - POINT_FOR_MONITORING_PLANES 1.5 0.0 0.75 + POINT_FOR_MONITORING_PLANES 1.5 0.0 0.75 #----------------- # Physical models #----------------- - MASS_DENSITY 1.0 - DYNAMIC_VISCOSITY 1.0 + MASS_DENSITY 1.0 + DYNAMIC_VISCOSITY 1.0 - PHASE_DENSITIES 1.0e3 1.0e0 - PHASE_VISCOSITIES 1.0e-3 1.8e-5 - SURFACE_TENSION 0.0 -TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 + PHASE_DENSITIES 1.0e3 1.0e0 + PHASE_VISCOSITIES 1.0e-3 1.8e-5 + SURFACE_TENSION 0.0 - REFERENCE_DENSITY 1.0 + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 + + REFERENCE_DENSITY 1.0 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_VOF cicsam + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_VOF cicsam #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 80 - MAX_SIMPLE_ITERATIONS 20 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - MIN_SIMPLE_ITERATIONS 1 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 80 + MAX_SIMPLE_ITERATIONS 20 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 + MIN_SIMPLE_ITERATIONS 1 #-------------------- # Initial conditions diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/Check_Inside_Box.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/Check_Inside_Box.f90 deleted file mode 120000 index 83b594885..000000000 --- a/Tests/Vof/Dam_Break_3d/User_Mod/Check_Inside_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Check_Inside_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/End_Of_Time_Step.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/End_Of_Time_Step.f90 index 2df077251..9b1649b71 100644 --- a/Tests/Vof/Dam_Break_3d/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Vof/Dam_Break_3d/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! - subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, n_stat_t, & - n_stat_p, time) + subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is computing benchmark for dam break ! !------------------------------------------------------------------------------! @@ -10,9 +10,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, n_stat_t, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer :: n ! time step integer :: n_stat_t, n_stat_p - real :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: fun @@ -78,7 +76,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, n_stat_t, & end do do i_probe = 1, N_PROBE - call Comm_Mod_Global_Max_Real(h_probe(i_probe)) + call Global % Max_Real(h_probe(i_probe)) end do ! Pressure probes: @@ -95,7 +93,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, n_stat_t, & end do do i_probe = 1, size(nod_probe) - call Comm_Mod_Global_Max_Real(p_probe(i_probe)) + call Global % Max_Real(p_probe(i_probe)) end do !---------------------! @@ -107,13 +105,13 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, n_stat_t, & b_volume = b_volume + Grid % vol(c) * fun % n(c) end do - call Comm_Mod_Global_Sum_Real(b_volume) + call Global % Sum_Real(b_volume) ! Write to file - if (this_proc < 2) then + if (First_Proc()) then call File % Append_For_Writing_Ascii('probe-data.dat', fu) - write(fu,'((e16.10e2),9(2x,e16.10e2),4(2x,e16.10e2))') & - time, b_volume, p_probe(1:size(nod_probe)), & + write(fu,'((e16.10e2),9(2x,e16.10e2),4(2x,e16.10e2))') & + Time % Get_Time(), b_volume, p_probe(1:size(nod_probe)), & h_probe(1:N_PROBE) close(fu) end if diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/Initialize_Variables.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/Initialize_Variables.f90 index cea67d4f9..f466bbf08 100644 --- a/Tests/Vof/Dam_Break_3d/User_Mod/Initialize_Variables.f90 +++ b/Tests/Vof/Dam_Break_3d/User_Mod/Initialize_Variables.f90 @@ -1,9 +1,6 @@ -include '../User_Mod/Vof_Initialization_Box.f90' -include '../User_Mod/Vof_Interface_Box.f90' -include '../User_Mod/Check_Inside_Box.f90' -include '../User_Mod/Vof_Quick_Sort.f90' -include '../User_Mod/Intersection_Line_Face.f90' -include '../User_Mod/Interpolate_From_Nodes.f90' +#include "Vof_Quick_Sort.f90" +#include "Intersection_Line_Face.f90" +#include "Interpolate_From_Nodes.f90" !==============================================================================! subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) @@ -68,7 +65,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) c1 = Grid % faces_c(1,s) c2 = Grid % faces_c(2,s) if(c2 < 0) then - if(Grid % Bnd_Cond_Name(c2) .eq. 'STEP') then + if(Grid % Bnd_Cond_Name_At_Cell(c2) .eq. 'STEP') then do n = 1, Grid % cells_n_nodes(c1) dist = sqrt( & (Grid % xn(Grid % cells_n(n,c1))-x_probe(i_probe)) ** 2 & @@ -87,7 +84,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) do i_probe = 1, N_PROBE glo_dist = p_dist(i_probe) - call Comm_Mod_Global_Min_Real(glo_dist) + call Global % Min_Real(glo_dist) if(.not. Math % Approx_Real( glo_dist, & p_dist(i_probe), TINY)) then @@ -150,7 +147,7 @@ subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) ! Sort probs by height do i_probe = 1, N_PROBE_F if (allocated(probes(i_probe) % s_probe)) then - write(*,*) this_proc,i_probe, N_PROBE_F,c_inters + write(*,*) This_Proc(), i_probe, N_PROBE_F, c_inters call Vof_Quick_Sort(probes(i_probe) % s_probe(1:c_inters), & probes(i_probe) % s_coor(:,:), 3, 1, & size(probes(i_probe) % s_probe)) diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Initialization_Box.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Initialization_Box.f90 deleted file mode 120000 index 62b82db5c..000000000 --- a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Initialization_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Initialization_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Interface_Box.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Interface_Box.f90 deleted file mode 120000 index b52a7b3dc..000000000 --- a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Interface_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Interface_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Quick_Sort.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Quick_Sort.f90 deleted file mode 120000 index d875714a9..000000000 --- a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Quick_Sort.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Quick_Sort.f90 \ No newline at end of file diff --git a/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Quick_Sort.f90 b/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Quick_Sort.f90 new file mode 100644 index 000000000..2804711aa --- /dev/null +++ b/Tests/Vof/Dam_Break_3d/User_Mod/Vof_Quick_Sort.f90 @@ -0,0 +1,25 @@ +recursive subroutine Vof_Quick_Sort(a, coords, dir, first, last) + implicit none + real :: coords(:,:), x, t(3) + integer :: a(:), first, last, ti, dir + integer :: i, j + + x = coords( (first+last) / 2, dir ) + i = first + j = last + do + do while (coords(i, dir) < x) + i=i+1 + end do + do while (x < coords(j, dir)) + j=j-1 + end do + if (i >= j) exit + ti = a(i); a(i) = a(j); a(j) = ti + t = coords(i,:); coords(i,:) = coords(j,:); coords(j,:) = t + i=i+1 + j=j-1 + end do + if (first < i-1) call Vof_Quick_Sort(a, coords, dir, first, i-1) + if (j+1 < last) call Vof_Quick_Sort(a, coords, dir, j+1, last) +end subroutine diff --git a/Tests/Vof/Dam_Break_3d/control b/Tests/Vof/Dam_Break_3d/control index a21772b19..eb9fedfe2 100644 --- a/Tests/Vof/Dam_Break_3d/control +++ b/Tests/Vof/Dam_Break_3d/control @@ -1,72 +1,66 @@ #---------- # Prologue #---------- - PROBLEM_NAME obstacle - HEAT_TRANSFER no - INTERFACE_TRACKING yes + PROBLEM_NAME obstacle + HEAT_TRANSFER no + INTERFACE_TRACKING yes - NUMBER_OF_TIME_STEPS 7000 + NUMBER_OF_TIME_STEPS 7000 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 60 - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 60 + SAVE_RESULTS_AT_BOUNDARIES no - #LOAD_BACKUP_NAME obstacle-ts005580.backup - TIME_STEP 1.0e-3 + TIME_STEP 1.0e-3 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- + MASS_DENSITY 1.0 + THERMAL_CONDUCTIVITY 1.4080e-4 + DYNAMIC_VISCOSITY 1.0 + HEAT_CAPACITY 1.0 - MASS_DENSITY 1.0 - THERMAL_CONDUCTIVITY 1.4080e-4 - DYNAMIC_VISCOSITY 1.0 - HEAT_CAPACITY 1.0 - - PHASE_DENSITIES 1.0e3 1.0e0 - PHASE_VISCOSITIES 1.0e-3 1.8e-5 - SURFACE_TENSION 0.0 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 + PHASE_DENSITIES 1.0e3 1.0e0 + PHASE_VISCOSITIES 1.0e-3 1.8e-5 + SURFACE_TENSION 0.0 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 0.0 0.0 -9.81 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso - - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.9 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.9 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_VOF cicsam + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_VOF cicsam #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 80 - MAX_SIMPLE_ITERATIONS 20 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - MIN_SIMPLE_ITERATIONS 1 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 80 + MAX_SIMPLE_ITERATIONS 20 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 + MIN_SIMPLE_ITERATIONS 1 #-------------------- # Initial conditions diff --git a/Tests/Vof/Fuel_Bundle/control b/Tests/Vof/Fuel_Bundle/control index 22e5ebf31..f7f845c82 100644 --- a/Tests/Vof/Fuel_Bundle/control +++ b/Tests/Vof/Fuel_Bundle/control @@ -1,71 +1,67 @@ #---------- # Prologue #---------- - PROBLEM_NAME fuel_bundle - HEAT_TRANSFER no - INTERFACE_TRACKING yes - TRACK_SURFACE yes + PROBLEM_NAME fuel_bundle + HEAT_TRANSFER no + INTERFACE_TRACKING yes + TRACK_FRONT yes - NUMBER_OF_TIME_STEPS 1200 - RESULTS_SAVE_INTERVAL 10 - BACKUP_SAVE_INTERVAL 120 + NUMBER_OF_TIME_STEPS 1200 + RESULTS_SAVE_INTERVAL 10 + BACKUP_SAVE_INTERVAL 120 - TIME_STEP 0.005 + TIME_STEP 0.005 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.5 0.1 0.75 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.5 0.1 0.75 - POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 + POINT_FOR_MONITORING_PLANES 0.5 0.1 0.75 #----------------- # Physical models #----------------- - PHASE_DENSITIES 1.0e2 1.0e3 - PHASE_VISCOSITIES 1.0e0 1.0e1 - SURFACE_TENSION 24.5 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -0.98 + PHASE_DENSITIES 1.0e2 1.0e3 + PHASE_VISCOSITIES 1.0e0 1.0e1 + SURFACE_TENSION 24.5 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 0.0 0.0 -0.98 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM quick + ADVECTION_SCHEME_FOR_VOF cicsam - ADVECTION_SCHEME_FOR_MOMENTUM quick - ADVECTION_SCHEME_FOR_VOF cicsam + GU_CORRECTION yes + CHOI_CORRECTION yes - GU_CORRECTION yes - CHOI_CORRECTION yes - - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_ITERATIONS_FOR_GAUSS_GRADIENTS 200 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 200 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 - MAX_SIMPLE_ITERATIONS 20 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - MIN_SIMPLE_ITERATIONS 3 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 + MAX_SIMPLE_ITERATIONS 20 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 + MIN_SIMPLE_ITERATIONS 3 #-------------------- # Initial conditions diff --git a/Tests/Vof/Fuel_Bundle/convert.scr b/Tests/Vof/Fuel_Bundle/convert.scr index d789cac7e..19021a4a1 100644 --- a/Tests/Vof/Fuel_Bundle/convert.scr +++ b/Tests/Vof/Fuel_Bundle/convert.scr @@ -3,6 +3,6 @@ no skip 1 skip -skip +1 skip diff --git a/Tests/Vof/Fuel_Bundle/two_spheres.stl b/Tests/Vof/Fuel_Bundle/two_spheres.stl new file mode 100644 index 000000000..98949de17 Binary files /dev/null and b/Tests/Vof/Fuel_Bundle/two_spheres.stl differ diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Beginning_Of_Correct_Velocity.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Beginning_Of_Correct_Velocity.f90 index fe80458ff..33241cb28 100644 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/Beginning_Of_Correct_Velocity.f90 +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/Beginning_Of_Correct_Velocity.f90 @@ -1,16 +1,13 @@ !==============================================================================! - subroutine User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Correct_Velocity function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u @@ -28,8 +25,8 @@ subroutine User_Mod_Beginning_Of_Correct_Velocity(Flow, Vof, Sol, & !-----------------------------------------------------------! ! Write down face-centered velocities before correction ! !-----------------------------------------------------------! - write(file_name(28:32), '(i5.5)') curr_dt - write(file_name(34:36), '(i3.3)') ini + write(file_name(28:32), '(i5.5)') Time % Curr_Dt() + write(file_name(34:36), '(i3.3)') Iter % Current() open(99, file=file_name) write(99, '(a)') '# User_Mod_Beginning_Of_Correct_Velocity: ' // & diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Check_Inside_Box.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Check_Inside_Box.f90 deleted file mode 120000 index 83b594885..000000000 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/Check_Inside_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Check_Inside_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Check_Inside_Box.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Check_Inside_Box.f90 new file mode 100644 index 000000000..ae72f9c06 --- /dev/null +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/Check_Inside_Box.f90 @@ -0,0 +1,82 @@ +!==============================================================================! + integer function Check_Inside_Box(Vof, p, dd, n_xyz, c) +!------------------------------------------------------------------------------! +! Determine if node of cell c lies inside box. Alteratively, if c is not ! +! given it can be used to determine if any given point p is inside the box ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Vof_Type), target :: Vof + real, allocatable :: p(:,:) + real :: dd(6) + real :: n_xyz(6,3) + integer, optional :: c +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + integer :: i_fac,n + integer :: infac_box(6) + integer, allocatable :: innod_box(:) + integer :: sum_inside + real :: res_dummy, dist, norm +!==============================================================================! + + ! First take aliasesd + Grid => Vof % pnt_grid + + ! loop in cell faces: + Check_Inside_Box = 0 + + if (present(c)) then + + allocate(innod_box(Grid % cells_n_nodes(c))) + + innod_box = 0 + + ! for every node: + do n = 1, Grid % cells_n_nodes(c) + infac_box = 0 + do i_fac = 1, 6 + res_dummy = n_xyz(i_fac,1) * Grid % xn(Grid % cells_n(n,c)) & + + n_xyz(i_fac,2) * Grid % yn(Grid % cells_n(n,c)) & + + n_xyz(i_fac,3) * Grid % zn(Grid % cells_n(n,c)) + norm = norm2(n_xyz(i_fac,1:3)) + dist = dot_product(n_xyz(i_fac,1:3) & + / norm, (/( Grid % xn(Grid % cells_n(n,c)) & + - p(i_fac,1) ), & + ( Grid % yn(Grid % cells_n(n,c)) & + - p(i_fac,2) ), & + ( Grid % zn(Grid % cells_n(n,c)) & + - p(i_fac,3) )/) ) + if (res_dummy <= dd(i_fac)) then + infac_box(i_fac) = 1 + end if + end do + if (sum(infac_box) == 6) then + innod_box(n) = 1 + end if + end do + + sum_inside = sum(innod_box) + if (sum_inside == Grid % cells_n_nodes(c)) then + Check_Inside_Box = 2 + else if (sum_inside < Grid % cells_n_nodes(c) .and. & + sum_inside > 0) then + Check_Inside_Box = 1 + end if + else + infac_box = 0 + do i_fac =1, 6 + res_dummy = n_xyz(i_fac,1) * p(1,1) & + + n_xyz(i_fac,2) * p(1,2) & + + n_xyz(i_fac,3) * p(1,3) + if (res_dummy <= dd(i_fac)) then + infac_box(i_fac) = 1 + end if + end do + + if (sum(infac_box) == 6) then + Check_Inside_Box = 1 + end if + end if + + end function diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Momentum.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Momentum.f90 index 8b14ca3d9..902e00250 100644 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Momentum.f90 +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Momentum.f90 @@ -1,6 +1,5 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol, & - curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Momentum function. ! !------------------------------------------------------------------------------! @@ -10,8 +9,6 @@ subroutine User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u, p @@ -27,8 +24,8 @@ subroutine User_Mod_End_Of_Compute_Momentum(Flow, Turb, Vof, Sol, & p => Flow % p M => Sol % Nat % M - write(file_name(28:32), '(i5.5)') curr_dt - write(file_name(34:36), '(i3.3)') ini + write(file_name(28:32), '(i5.5)') Time % Curr_Dt() + write(file_name(34:36), '(i3.3)') Iter % Current() open(99, file=file_name) write(99, '(a)') '# User_Mod_End_Of_Compute_Momentum ' // & diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Pressure.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Pressure.f90 index 6154344a6..2c0e2e838 100644 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Pressure.f90 +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Compute_Pressure.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Pressure function. ! !------------------------------------------------------------------------------! @@ -8,8 +8,6 @@ subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) type(Field_Type), target :: Flow type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: p, pp @@ -26,8 +24,8 @@ subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) A => Sol % Nat % A b => Sol % Nat % b % val - write(file_name(10:14), '(i5.5)') curr_dt - write(file_name(16:18), '(i3.3)') ini + write(file_name(10:14), '(i5.5)') Time % Curr_Dt() + write(file_name(16:18), '(i3.3)') Iter % Current() open(99, file=file_name) write(99, '(A)') '# compute_pressure: 1:x, 2:p, 3:pp, 4:p%x, 5:pp%x ' // & diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Correct_Velocity.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Correct_Velocity.f90 index e3494c579..59a1887bb 100644 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Correct_Velocity.f90 +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/End_Of_Correct_Velocity.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Correct_Velocity function. ! !------------------------------------------------------------------------------! @@ -8,8 +8,6 @@ subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) type(Field_Type), target :: Flow type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt - integer, intent(in) :: ini !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: u @@ -29,8 +27,8 @@ subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) !---------------------------------------------------! ! Write down corrected cell-centered velocities ! !---------------------------------------------------! - write(fil1_name(27:31), '(i5.5)') curr_dt - write(fil1_name(33:35), '(i3.3)') ini + write(fil1_name(27:31), '(i5.5)') Time % Curr_Dt() + write(fil1_name(33:35), '(i3.3)') Iter % Current() open(99, file=fil1_name) write(99, '(a)') '# User_Mod_End_Of_Correct_Velocity: 1:x 2:u 3:rho' @@ -48,8 +46,8 @@ subroutine User_Mod_End_Of_Correct_Velocity(Flow, Vof, Sol, curr_dt, ini) !---------------------------------------------------! ! Write down corrected face-centered velocities ! !---------------------------------------------------! - write(fil2_name(27:31), '(i5.5)') curr_dt - write(fil2_name(33:35), '(i3.3)') ini + write(fil2_name(27:31), '(i5.5)') Time % Curr_Dt() + write(fil2_name(33:35), '(i3.3)') Iter % Current() open(99, file=fil2_name) write(99, '(a)') '# User_Mod_End_Of_Correct_Velocity: ' // & diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Initialize_Variables.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Initialize_Variables.f90 index cd022160f..180b06f44 100644 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/Initialize_Variables.f90 +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/Initialize_Variables.f90 @@ -1,6 +1,6 @@ -include '../User_Mod/Check_Inside_Box.f90' -include '../User_Mod/Vof_Initialization_Box.f90' -include '../User_Mod/Vof_Interface_Box.f90' +#include "Check_Inside_Box.f90" +#include "Vof_Initialization_Box.f90" +#include "Vof_Interface_Box.f90" !==============================================================================! subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Initialization_Box.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Initialization_Box.f90 deleted file mode 120000 index 62b82db5c..000000000 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Initialization_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Initialization_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Initialization_Box.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Initialization_Box.f90 new file mode 100644 index 000000000..2a5a8b1fb --- /dev/null +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Initialization_Box.f90 @@ -0,0 +1,130 @@ +!==============================================================================! + subroutine Vof_Initialization_Box(Vof) +!------------------------------------------------------------------------------! +! Initialize as vof = 1 all cells inside a rectangular box defined by eight ! +! points, sorted as shown in the schematic below. It should work for any ! +! orientation of the box and possibly, it can be generalized to any convex ! +! polyedral ! +!------------------------------------------------------------------------------! +! ! +! 8-----------7 ! +! /| /| ! +! 5-----------6 | ! +! | | | | ! +! | | | | ! +! | | | | ! +! | 4 - - - - | 3 ! +! |/ |/ ! +! 1-----------2 ! +! ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Vof_Type), target :: Vof +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + real :: p_xyz(8,3) + real, allocatable :: p(:,:) + integer :: c, n, i, fu + integer :: ee, n_boxes, n_p, np_count, i_fac, seeds(1024) + integer :: trios(6,3) + real :: n_xyz(6,3), v1aux(3), v2aux(3) + real :: res_dummy + real :: dd(6) + character(20) :: p_name_aux + real, contiguous, pointer :: prelim_vof(:) + integer, contiguous, pointer :: inside_c(:) +!==============================================================================! + + call Work % Connect_Real_Cell(prelim_vof) + call Work % Connect_Int_Cell (inside_c) + + ! First take aliases + Grid => Vof % pnt_grid + + prelim_vof = 0.0 + + ! Initialize random seed + p_name_aux = 'obstacle' + call random_seed(size=n) + seeds = (/(i, i=1,n)/) + call random_seed(put=seeds(1:n)) + + allocate(p(6,3)) + + ! Initialize sorting for normals: + trios(1,:) = (/1, 4, 2/) + trios(2,:) = (/6, 7, 8/) + trios(3,:) = (/3, 7, 6/) + trios(4,:) = (/5, 8, 4/) + trios(5,:) = (/1, 2, 6/) + trios(6,:) = (/3, 4, 8/) + + ! Open file to read Plane parameters: + call File % Open_For_Reading_Ascii('box_parameters.ini', fu) + + call File % Read_Line(fu) + read(line % tokens(1), *) n_boxes + + np_count = 1 + + do ee = 1, n_boxes + + do n_p = 1, 8 + call File % Read_Line(fu) + read(line % tokens(1), *) p_xyz(n_p, 1) + read(line % tokens(2), *) p_xyz(n_p, 2) + read(line % tokens(3), *) p_xyz(n_p, 3) + end do + + ! Define Planes of the box + do i_fac = 1, 6 + + v1aux(:) = p_xyz(trios(i_fac,2),:) - p_xyz(trios(i_fac,1),:) + v2aux(:) = p_xyz(trios(i_fac,3),:) - p_xyz(trios(i_fac,1),:) + + n_xyz(i_fac,1) = v1aux(2) * v2aux(3) - v1aux(3) * v2aux(2) + n_xyz(i_fac,2) = - (v1aux(1) * v2aux(3) - v1aux(3) * v2aux(1)) + n_xyz(i_fac,3) = v1aux(1) * v2aux(2) - v1aux(2) * v2aux(1) + + dd(i_fac) = n_xyz(i_fac,1) * p_xyz(trios(i_fac,1),1) & + + n_xyz(i_fac,2) * p_xyz(trios(i_fac,1),2) & + + n_xyz(i_fac,3) * p_xyz(trios(i_fac,1),3) + + p(i_fac,:) = p_xyz(trios(i_fac,1), :) + end do + + do c = 1, Grid % n_cells + inside_c(c) = Check_Inside_Box(Vof, p, dd, n_xyz, c = c) + end do + + ! Simply interpolate linearly + do c = 1, Grid % n_cells + if (inside_c(c) == 1) then + !prelim_vof(c) = 1.0 - (min_max_crit_2(c) - dd) & + ! / (min_max_crit_2(c)-min_max_crit_1(c)) + call Vof_Interface_Box(Vof, & + c, & + n_xyz, & + dd, & + prelim_vof(c)) + prelim_vof(c) = 0.001 + + else if (inside_c(c) == 2) then + prelim_vof(c) = 1.0 + end if + end do + + ! Precision + do c = 1, Grid % n_cells + Vof % fun % n(c) = max(prelim_vof(c),Vof % fun % n(c)) + end do + + end do + + close(fu) + + call Work % Disconnect_Real_Cell(prelim_vof) + call Work % Disconnect_Int_Cell (inside_c) + + end subroutine diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Interface_Box.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Interface_Box.f90 deleted file mode 120000 index b52a7b3dc..000000000 --- a/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Interface_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Interface_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Interface_Box.f90 b/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Interface_Box.f90 new file mode 100644 index 000000000..08ec2694e --- /dev/null +++ b/Tests/Vof/Mencinger_And_Zun/User_Mod/Vof_Interface_Box.f90 @@ -0,0 +1,101 @@ +!==============================================================================! + subroutine Vof_Interface_Box(Vof, & + c, & + n_xyz, & + dd, & + vof_int) +!------------------------------------------------------------------------------! +! Computes volume fraction of cell at interface ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Vof_Type), target :: Vof + integer, intent(in) :: c + real :: n_xyz(6,3) + real :: dd(6) + real :: vof_int +!------------------------------[Local parameters]------------------------------! + integer, parameter :: N = 10000 +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + logical :: l_cel + integer :: nod, n_int, n_tot, fu + integer :: ee, n_cylinders, i_vari, n_vari + real :: r_num, res_func + real :: xmin, xmax, ymin, ymax, zmin, zmax + real, allocatable :: p(:,:) + real :: vof_0, vof_tol1, vof_tol2 + real :: avg_x, avg_y, avg_z + real :: var_comb, var_comb_0, dist_cent + real :: mean_x, mean_y, mean_z + real :: points(N,3) +!==============================================================================! + + ! First take aliasesd + Grid => Vof % pnt_grid + + ! Initialize variables + var_comb = HUGE + var_comb_0 = 0.0 + vof_tol1 = MICRO + vof_tol2 = MILI + dist_cent = Grid % vol(c) ** ONE_THIRD + vof_int = HUGE + + n_tot = 0 + n_int = 0 + allocate(p(1,3)) + + ! Find bounding box: + xmin = HUGE; ymin = HUGE; zmin = HUGE; + xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; + + do nod = 1, Grid % cells_n_nodes(c) + xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) + ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) + zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) + xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) + ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) + zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) + end do + + l_cel = .false. + + do while ( (n_tot < N) .and. (abs(var_comb - var_comb_0) > vof_tol1 .or. & + (var_comb / dist_cent) > vof_tol2) ) + + l_cel = .false. + + ! Check if p is inside cell + do while (l_cel .eqv. .false.) + call random_number(r_num) + p(1,1) = xmin + (xmax-xmin) * r_num + call random_number(r_num) + p(1,2) = ymin+ (ymax-ymin) * r_num + call random_number(r_num) + p(1,3) = zmin+ (zmax-zmin) * r_num + l_cel = Grid % Is_Point_In_Cell(c, p(1,1), p(1,2), p(1,3)) + end do + n_tot = n_tot + 1 + + points(n_tot,:) = p(1,:) + + ! Check if p is inside function: + if(Check_Inside_Box(Vof, p, dd, n_xyz) == 1) then + n_int = n_int + 1 + end if + + ! Compute maximum difference c/r center: + if(mod(n_tot, 500) == 0 .and. n_tot > 0) then + var_comb_0 = var_comb + vof_int = real(n_int) / real(n_tot) + mean_x = sum(points(1: n_tot,1)) / real(n_tot) + mean_y = sum(points(1: n_tot,2)) / real(n_tot) + mean_z = sum(points(1: n_tot,3)) / real(n_tot) + var_comb = abs(mean_x-Grid % xc(c)) & + + abs(mean_y-Grid % yc(c)) & + + abs(mean_z-Grid % zc(c)) + end if + end do + + end subroutine diff --git a/Tests/Vof/Mencinger_And_Zun/control b/Tests/Vof/Mencinger_And_Zun/control index 206c1fa80..2e9cb07a8 100644 --- a/Tests/Vof/Mencinger_And_Zun/control +++ b/Tests/Vof/Mencinger_And_Zun/control @@ -1,85 +1,81 @@ #---------- # Prologue #---------- - PROBLEM_NAME menc - HEAT_TRANSFER no - INTERFACE_TRACKING yes + PROBLEM_NAME menc + HEAT_TRANSFER no + INTERFACE_TRACKING yes - TIME_STEP 100 - TIME_INTEGRATION_SCHEME parabolic + TIME_STEP 100 + TIME_INTEGRATION_SCHEME parabolic + + CHOI_CORRECTION yes + GU_CORRECTION yes - CHOI_CORRECTION yes - GU_CORRECTION yes # 6000 time steps seems to be enough to reach a steady state with dt= 0.1 # 600 time steps seems to be enough to reach a steady state with dt= 1 # 200 time steps seems to be enough to reach a steady state with dt= 10 # 60 time steps seems to be enough to reach a steady state with dt=100 # 10 time steps seems to be enough to reach a steady state with dt=1e+5 - NUMBER_OF_TIME_STEPS 600 - MAX_SIMPLE_ITERATIONS 6 - MIN_SIMPLE_ITERATIONS 6 + NUMBER_OF_TIME_STEPS 600 + MAX_SIMPLE_ITERATIONS 6 + MIN_SIMPLE_ITERATIONS 6 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - MAX_GAUSS_GRADIENTS_ITERATIONS 2000 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-15 - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 2000 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-15 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - RESULTS_SAVE_INTERVAL 10 - BACKUP_SAVE_INTERVAL 10000 - SAVE_INITIAL_CONDITION yes - SAVE_RESULTS_AT_BOUNDARIES no + RESULTS_SAVE_INTERVAL 10 + BACKUP_SAVE_INTERVAL 10000 + SAVE_INITIAL_CONDITION yes + SAVE_RESULTS_AT_BOUNDARIES no #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.6 0.05 0.05 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.6 0.05 0.05 - POINT_FOR_MONITORING_PLANES 0.6 0.05 0.05 + POINT_FOR_MONITORING_PLANES 0.6 0.05 0.05 #----------------- # Physical models #----------------- # Phase 1 is liquid - PHASE_DENSITIES 1.00 1.0e+3 - PHASE_VISCOSITIES 1.0e-3 1.0e-3 - SURFACE_TENSION 0.0 - MASS_TRANSFER no - TRACK_FRONT no - SATURATION_TEMPERATURE 100.0 + PHASE_DENSITIES 1.00 1.0e+3 + PHASE_VISCOSITIES 1.0e-3 1.0e-3 + SURFACE_TENSION 0.0 + MASS_TRANSFER no + TRACK_FRONT no + SATURATION_TEMPERATURE 100.0 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 10.0 0.0 0.0 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 10.0 0.0 0.0 - REFERENCE_DENSITY 0.0 + REFERENCE_DENSITY 0.0 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple - - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_VOF cicsam + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_VOF cicsam #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-16 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-04 - TOLERANCE_FOR_VOF_SOLVER 1.e-06 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 900 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - TEMPORAL_PRESSURE_CORRECTION no - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-16 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-04 + TOLERANCE_FOR_VOF_SOLVER 1.e-06 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 900 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 #-------------------- # Initial conditions velocity was 0.05 for nice transport of vof diff --git a/Tests/Vof/Pie/User_Mod/End_Of_Time_Step.f90 b/Tests/Vof/Pie/User_Mod/End_Of_Time_Step.f90 index e37616478..ef6fe2154 100644 --- a/Tests/Vof/Pie/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Vof/Pie/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is computing benchmark for rising bubble. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! current time step integer, intent(in) :: n_stat_t ! 1st t.s. statistics turbulence integer, intent(in) :: n_stat_p ! 1st t.s. statistics particles - real, intent(in) :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: fun @@ -48,16 +46,16 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & rise_vel_int = rise_vel_int + Flow % v % n(c) * fun % n(c) * Grid % vol(c) end do - call Comm_Mod_Global_Sum_Real(b_volume) - call Comm_Mod_Global_Sum_Real(surface) - call Comm_Mod_Global_Sum_Real(y_pos_cen) - call Comm_Mod_Global_Sum_Real(rise_vel_int) + call Global % Sum_Real(b_volume) + call Global % Sum_Real(surface) + call Global % Sum_Real(y_pos_cen) + call Global % Sum_Real(rise_vel_int) y_pos_cen = y_pos_cen / b_volume rise_vel_int = rise_vel_int / b_volume rise_vel_cen = (y_pos_cen - y_pos_cen_old) / Flow % dt ! Just open the file benchmark.dat - if(n .eq. 1) then + if(Time % Curr_Dt() .eq. 1) then call File % Open_For_Writing_Ascii('benchmark.dat', fu) close(fu) end if @@ -65,9 +63,9 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & !-------------------! ! Write results ! !-------------------! - if(n > 1) then + if(Time % Curr_Dt() > 1) then - if(this_proc < 2) then + if(First_Proc()) then print *, 'y_pos_cen = ', y_pos_cen print *, 'y_pos_cen_old = ', y_pos_cen_old print *, 'rise_vel_int (1) = ', rise_vel_int @@ -76,15 +74,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & ! Write to file call File % Append_For_Writing_Ascii('benchmark.dat', fu) - ! With circularity 2D: - ! write(fu,'(6(2x,es16.10e2))') time, b_volume, & - ! 2.0*PI/surface*sqrt(b_volume/PI), & - ! y_pos_cen, & - ! rise_vel_int, & - ! rise_vel_cen - ! With sphericity 3D: - write(fu,'(6(2x,es16.10e2))') time, b_volume, & + write(fu,'(6(2x,es16.10e2))') Time % Get_Time(), b_volume, & PI**(1.0/3.0)*(6.0*b_volume)**(2.0/3.0) & /surface, & y_pos_cen, & @@ -92,7 +83,7 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & rise_vel_cen close(fu) - end if ! this_proc < 2 + end if ! First_Proc() end if ! n > 1 diff --git a/Tests/Vof/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 b/Tests/Vof/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 index ae26f4d9f..1070f74b8 100644 --- a/Tests/Vof/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Vof/Rising_Bubble/User_Mod/End_Of_Time_Step.f90 @@ -1,8 +1,8 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! -! This function is computing benchmark for rising bubble. ! +! This function is computing benchmark for rising bubble. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer :: n ! current time step integer :: n_stat_t ! 1st t.s. statistics turbulence integer :: n_stat_p ! 1st t.s. statistics particles - real :: time ! physical time !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: fun @@ -47,25 +45,21 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & rise_velocity = rise_velocity + Flow % w % n(c) * fun % n(c) * Grid % vol(c) end do - call Comm_Mod_Global_Sum_Real(b_volume) - call Comm_Mod_Global_Sum_Real(surface) - call Comm_Mod_Global_Sum_Real(c_position) - call Comm_Mod_Global_Sum_Real(rise_velocity) + call Global % Sum_Real(b_volume) + call Global % Sum_Real(surface) + call Global % Sum_Real(c_position) + call Global % Sum_Real(rise_velocity) ! Write to file - if (this_proc < 2) then + if (First_Proc()) then call File % Append_For_Writing_Ascii('bench-data.dat', fu) - !with circularity 2D: -! write(fu,'(5(2X,E16.10E2))') time, b_volume, & -! 2.0*PI/surface*sqrt(b_volume/PI), & -! c_position/b_volume, & -! rise_velocity/b_volume - !with sphericity 3D: - write(fu,'(5(2X,E16.10E2))') time, b_volume, & - PI**(1.0/3.0)*(6.0*b_volume)**(2.0/3.0) & - /surface, & - c_position/b_volume, & - rise_velocity/b_volume + + ! With sphericity 3D + write(fu,'(5(2X,E16.10E2))') Time % Get_Time(), b_volume, & + PI**(1.0/3.0)*(6.0*b_volume)**(2.0/3.0) & + /surface, & + c_position/b_volume, & + rise_velocity/b_volume close(fu) end if diff --git a/Tests/Vof/Rising_Bubble/control b/Tests/Vof/Rising_Bubble/control index b75bbd272..45b23c955 100644 --- a/Tests/Vof/Rising_Bubble/control +++ b/Tests/Vof/Rising_Bubble/control @@ -1,78 +1,73 @@ #---------- # Prologue #---------- - PROBLEM_NAME cavity - HEAT_TRANSFER no - INTERFACE_TRACKING yes + PROBLEM_NAME cavity + HEAT_TRANSFER no + INTERFACE_TRACKING yes - NUMBER_OF_TIME_STEPS 600 - TIME_STEP 0.005 # original (for finer grid) was 0.0005 + NUMBER_OF_TIME_STEPS 600 + TIME_STEP 0.005 # original (for finer grid) was 0.0005 - RESULTS_SAVE_INTERVAL 60 - BACKUP_SAVE_INTERVAL 300 - # LOAD_BACKUP_NAME cavity-ts000060.backup + RESULTS_SAVE_INTERVAL 60 + BACKUP_SAVE_INTERVAL 300 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.0 0.0 0.0 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.0 0.0 0.0 - POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 + POINT_FOR_MONITORING_PLANES 0.0 0.0 0.0 #----------------- # Physical models #----------------- - PHASE_DENSITIES 1.0e2 1.0e3 - PHASE_VISCOSITIES 1.0e0 1.0e1 - SURFACE_TENSION 24.5 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 -0.98 + PHASE_DENSITIES 1.0e2 1.0e3 + PHASE_VISCOSITIES 1.0e0 1.0e1 + SURFACE_TENSION 24.5 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 0.0 0.0 -0.98 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING piso - PRESSURE_MOMENTUM_COUPLING piso + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 1.0 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 1.0 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM quick + ADVECTION_SCHEME_FOR_VOF cicsam - ADVECTION_SCHEME_FOR_MOMENTUM quick - ADVECTION_SCHEME_FOR_VOF cicsam + GU_CORRECTION yes + CHOI_CORRECTION yes - GU_CORRECTION yes - CHOI_CORRECTION yes - - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - MAX_ITERATIONS_FOR_GAUSS_GRADIENTS 200 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + MAX_GAUSS_GRADIENTS_ITERATIONS 200 + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 #------------------------ # Linear solver settings #------------------------ - LINEAR_SOLVERS native - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-12 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 - MAX_SIMPLE_ITERATIONS 20 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - MIN_SIMPLE_ITERATIONS 3 - #DUAL_TIME_STEP_VOF yes - - PETSC_OPTIONS_FOR_PRESSURE - SOLVER cg - PREC hypre # asm or hypre - PREC_OPTS - TOLERANCE 1.0e-3 + LINEAR_SOLVERS native + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-12 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-12 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 100 + MAX_SIMPLE_ITERATIONS 20 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 12 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 + MIN_SIMPLE_ITERATIONS 3 + + PETSC_OPTIONS_FOR_PRESSURE + SOLVER cg + PREC hypre # asm or hypre + PREC_OPTS + TOLERANCE 1.0e-3 #-------------------- # Initial conditions diff --git a/Tests/Vof/Rising_Bubble/generate.scr b/Tests/Vof/Rising_Bubble/generate.scr index afb80b3b2..a4a8c8e8f 100644 --- a/Tests/Vof/Rising_Bubble/generate.scr +++ b/Tests/Vof/Rising_Bubble/generate.scr @@ -1,5 +1,5 @@ cavity -0 +skip skip skip diff --git a/Tests/Vof/Rising_Bubble/sphere.stl b/Tests/Vof/Rising_Bubble/sphere.stl new file mode 100644 index 000000000..ed9683262 Binary files /dev/null and b/Tests/Vof/Rising_Bubble/sphere.stl differ diff --git a/Tests/Vof/Spurious/User_Mod/End_Of_Time_Step.f90 b/Tests/Vof/Spurious/User_Mod/End_Of_Time_Step.f90 index 8d050f7f9..d6dd6b2e0 100644 --- a/Tests/Vof/Spurious/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Vof/Spurious/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! - subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, & - n_stat_t, n_stat_p, time) + subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function computes position of contact line and high of droplet ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer, intent(in) :: n ! time step integer, intent(in) :: n_stat_t integer, intent(in) :: n_stat_p - real, intent(in) :: time ! physical time !--------------------------------[Locals]--------------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: fun @@ -53,8 +51,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, & min_vfrac = minval(fun % n(1:Grid % n_cells - Grid % Comm % n_buff_cells)) max_vfrac = maxval(fun % n(1:Grid % n_cells - Grid % Comm % n_buff_cells)) - call Comm_Mod_Global_Min_Real(min_vfrac) - call Comm_Mod_Global_Max_Real(max_vfrac) + call Global % Min_Real(min_vfrac) + call Global % Max_Real(max_vfrac) n_tot_cells = Grid % n_cells - Grid % Comm % n_buff_cells @@ -79,42 +77,42 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, n, & end do - call Comm_Mod_Global_Sum_Real(a_vof) + call Global % Sum_Real(a_vof) - call Comm_Mod_Global_Sum_Int(n_tot_cells) - call Comm_Mod_Global_Sum_Real(u_rms) + call Global % Sum_Int(n_tot_cells) + call Global % Sum_Real(u_rms) u_rms = sqrt(1.0 / real(n_tot_cells) * u_rms) u_max = maxval(sum_v1(1:Grid % n_cells - Grid % Comm % n_buff_cells)) - call Comm_Mod_Global_Max_Real(u_max) + call Global % Max_Real(u_max) p_max = maxval(Flow % p % n(1:Grid % n_cells - Grid % Comm % n_buff_cells)) p_min = minval(Flow % p % n(1:Grid % n_cells - Grid % Comm % n_buff_cells)) - call Comm_Mod_Global_Max_Real(p_max) - call Comm_Mod_Global_Min_Real(p_min) + call Global % Max_Real(p_max) + call Global % Min_Real(p_min) - call Comm_Mod_Global_Sum_Real(p_in) - call Comm_Mod_Global_Sum_Real(p_out) - call Comm_Mod_Global_Sum_Real(a_in) - call Comm_Mod_Global_Sum_Real(a_out) + call Global % Sum_Real(p_in) + call Global % Sum_Real(p_out) + call Global % Sum_Real(a_in) + call Global % Sum_Real(a_out) p_in = p_in / a_in p_out = p_out / a_out ! Write Results - if (this_proc < 2) then - if(n .eq. 1) then + if (First_Proc()) then + if(Time % Curr_Dt() .eq. 1) then call File % Delete('spurious.dat') end if call File % Append_For_Writing_Ascii('spurious.dat', fu) - write(fu,'(6(2X,E16.10E2))') time, a_vof, u_rms, u_max, & + write(fu,'(6(2X,E16.10E2))') Time % Get_Time(), a_vof, u_rms, u_max, & p_max-p_min, p_in-p_out close(fu) end if !! Calculate distance to center of cylinder !! For normals for curvature - !if(this_proc <= 2) then + !if(This_Proc() <= 2) then ! dist_n = 0 ! do c = 1, Grid % n_cells ! norm_res = norm2((/fun % x(c), fun % y(c), fun % z(c)/)) diff --git a/Tests/Vof/Stefan/User_Mod/Check_Inside_Box.f90 b/Tests/Vof/Stefan/User_Mod/Check_Inside_Box.f90 deleted file mode 120000 index 83b594885..000000000 --- a/Tests/Vof/Stefan/User_Mod/Check_Inside_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Check_Inside_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Stefan/User_Mod/Check_Inside_Box.f90 b/Tests/Vof/Stefan/User_Mod/Check_Inside_Box.f90 new file mode 100644 index 000000000..ae72f9c06 --- /dev/null +++ b/Tests/Vof/Stefan/User_Mod/Check_Inside_Box.f90 @@ -0,0 +1,82 @@ +!==============================================================================! + integer function Check_Inside_Box(Vof, p, dd, n_xyz, c) +!------------------------------------------------------------------------------! +! Determine if node of cell c lies inside box. Alteratively, if c is not ! +! given it can be used to determine if any given point p is inside the box ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Vof_Type), target :: Vof + real, allocatable :: p(:,:) + real :: dd(6) + real :: n_xyz(6,3) + integer, optional :: c +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + integer :: i_fac,n + integer :: infac_box(6) + integer, allocatable :: innod_box(:) + integer :: sum_inside + real :: res_dummy, dist, norm +!==============================================================================! + + ! First take aliasesd + Grid => Vof % pnt_grid + + ! loop in cell faces: + Check_Inside_Box = 0 + + if (present(c)) then + + allocate(innod_box(Grid % cells_n_nodes(c))) + + innod_box = 0 + + ! for every node: + do n = 1, Grid % cells_n_nodes(c) + infac_box = 0 + do i_fac = 1, 6 + res_dummy = n_xyz(i_fac,1) * Grid % xn(Grid % cells_n(n,c)) & + + n_xyz(i_fac,2) * Grid % yn(Grid % cells_n(n,c)) & + + n_xyz(i_fac,3) * Grid % zn(Grid % cells_n(n,c)) + norm = norm2(n_xyz(i_fac,1:3)) + dist = dot_product(n_xyz(i_fac,1:3) & + / norm, (/( Grid % xn(Grid % cells_n(n,c)) & + - p(i_fac,1) ), & + ( Grid % yn(Grid % cells_n(n,c)) & + - p(i_fac,2) ), & + ( Grid % zn(Grid % cells_n(n,c)) & + - p(i_fac,3) )/) ) + if (res_dummy <= dd(i_fac)) then + infac_box(i_fac) = 1 + end if + end do + if (sum(infac_box) == 6) then + innod_box(n) = 1 + end if + end do + + sum_inside = sum(innod_box) + if (sum_inside == Grid % cells_n_nodes(c)) then + Check_Inside_Box = 2 + else if (sum_inside < Grid % cells_n_nodes(c) .and. & + sum_inside > 0) then + Check_Inside_Box = 1 + end if + else + infac_box = 0 + do i_fac =1, 6 + res_dummy = n_xyz(i_fac,1) * p(1,1) & + + n_xyz(i_fac,2) * p(1,2) & + + n_xyz(i_fac,3) * p(1,3) + if (res_dummy <= dd(i_fac)) then + infac_box(i_fac) = 1 + end if + end do + + if (sum(infac_box) == 6) then + Check_Inside_Box = 1 + end if + end if + + end function diff --git a/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Energy.f90 b/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Energy.f90 index 98be15634..56ab00a03 100644 --- a/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Energy.f90 +++ b/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Energy.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Energy function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid integer :: s, fu @@ -26,10 +24,10 @@ subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) if(any(Vof % Front % elems_at_face(1:2,s) .ne. 0)) then ! Write down Stefan's solution - if(ini .eq. 1 .and. & + if(Iter % Current() .eq. 1 .and. & Math % Approx_Real(Grid % ys(s), 0.0) .and. & Math % Approx_Real(Grid % zs(s), 0.0)) then - write(fu, '(99(es12.4))') curr_dt * Flow % dt, Grid % xs(s) + write(fu, '(99(es12.4))') Time % Curr_Dt() * Flow % dt, Grid % xs(s) end if end if diff --git a/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Pressure.f90 b/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Pressure.f90 index 783e7a06e..bd89a140e 100644 --- a/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Pressure.f90 +++ b/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Pressure.f90 @@ -1,15 +1,13 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Pressure function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: p, pp diff --git a/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Vof.f90 b/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Vof.f90 index 39fd48a07..d2c72d1da 100644 --- a/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Vof.f90 +++ b/Tests/Vof/Stefan/User_Mod/End_Of_Compute_Vof.f90 @@ -1,5 +1,5 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol, curr_dt) + subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Vof function. ! !------------------------------------------------------------------------------! @@ -7,7 +7,6 @@ subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol, curr_dt) !---------------------------------[Arguments]----------------------------------! type(Vof_Type), target :: Vof type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow diff --git a/Tests/Vof/Stefan/User_Mod/Initialize_Variables.f90 b/Tests/Vof/Stefan/User_Mod/Initialize_Variables.f90 index d3ce976e9..3ead8febc 100644 --- a/Tests/Vof/Stefan/User_Mod/Initialize_Variables.f90 +++ b/Tests/Vof/Stefan/User_Mod/Initialize_Variables.f90 @@ -1,6 +1,6 @@ -include '../User_Mod/Check_Inside_Box.f90' -include '../User_Mod/Vof_Initialization_Box.f90' -include '../User_Mod/Vof_Interface_Box.f90' +#include "Vof_Initialization_Box.f90" +#include "Vof_Interface_Box.f90" +#include "Check_Inside_Box.f90" !==============================================================================! subroutine User_Mod_Initialize_Variables(Flow, Turb, Vof, Swarm, Sol) diff --git a/Tests/Vof/Stefan/User_Mod/Vof_Initialization_Box.f90 b/Tests/Vof/Stefan/User_Mod/Vof_Initialization_Box.f90 deleted file mode 120000 index 62b82db5c..000000000 --- a/Tests/Vof/Stefan/User_Mod/Vof_Initialization_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Initialization_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Stefan/User_Mod/Vof_Initialization_Box.f90 b/Tests/Vof/Stefan/User_Mod/Vof_Initialization_Box.f90 new file mode 100644 index 000000000..2a5a8b1fb --- /dev/null +++ b/Tests/Vof/Stefan/User_Mod/Vof_Initialization_Box.f90 @@ -0,0 +1,130 @@ +!==============================================================================! + subroutine Vof_Initialization_Box(Vof) +!------------------------------------------------------------------------------! +! Initialize as vof = 1 all cells inside a rectangular box defined by eight ! +! points, sorted as shown in the schematic below. It should work for any ! +! orientation of the box and possibly, it can be generalized to any convex ! +! polyedral ! +!------------------------------------------------------------------------------! +! ! +! 8-----------7 ! +! /| /| ! +! 5-----------6 | ! +! | | | | ! +! | | | | ! +! | | | | ! +! | 4 - - - - | 3 ! +! |/ |/ ! +! 1-----------2 ! +! ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Vof_Type), target :: Vof +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + real :: p_xyz(8,3) + real, allocatable :: p(:,:) + integer :: c, n, i, fu + integer :: ee, n_boxes, n_p, np_count, i_fac, seeds(1024) + integer :: trios(6,3) + real :: n_xyz(6,3), v1aux(3), v2aux(3) + real :: res_dummy + real :: dd(6) + character(20) :: p_name_aux + real, contiguous, pointer :: prelim_vof(:) + integer, contiguous, pointer :: inside_c(:) +!==============================================================================! + + call Work % Connect_Real_Cell(prelim_vof) + call Work % Connect_Int_Cell (inside_c) + + ! First take aliases + Grid => Vof % pnt_grid + + prelim_vof = 0.0 + + ! Initialize random seed + p_name_aux = 'obstacle' + call random_seed(size=n) + seeds = (/(i, i=1,n)/) + call random_seed(put=seeds(1:n)) + + allocate(p(6,3)) + + ! Initialize sorting for normals: + trios(1,:) = (/1, 4, 2/) + trios(2,:) = (/6, 7, 8/) + trios(3,:) = (/3, 7, 6/) + trios(4,:) = (/5, 8, 4/) + trios(5,:) = (/1, 2, 6/) + trios(6,:) = (/3, 4, 8/) + + ! Open file to read Plane parameters: + call File % Open_For_Reading_Ascii('box_parameters.ini', fu) + + call File % Read_Line(fu) + read(line % tokens(1), *) n_boxes + + np_count = 1 + + do ee = 1, n_boxes + + do n_p = 1, 8 + call File % Read_Line(fu) + read(line % tokens(1), *) p_xyz(n_p, 1) + read(line % tokens(2), *) p_xyz(n_p, 2) + read(line % tokens(3), *) p_xyz(n_p, 3) + end do + + ! Define Planes of the box + do i_fac = 1, 6 + + v1aux(:) = p_xyz(trios(i_fac,2),:) - p_xyz(trios(i_fac,1),:) + v2aux(:) = p_xyz(trios(i_fac,3),:) - p_xyz(trios(i_fac,1),:) + + n_xyz(i_fac,1) = v1aux(2) * v2aux(3) - v1aux(3) * v2aux(2) + n_xyz(i_fac,2) = - (v1aux(1) * v2aux(3) - v1aux(3) * v2aux(1)) + n_xyz(i_fac,3) = v1aux(1) * v2aux(2) - v1aux(2) * v2aux(1) + + dd(i_fac) = n_xyz(i_fac,1) * p_xyz(trios(i_fac,1),1) & + + n_xyz(i_fac,2) * p_xyz(trios(i_fac,1),2) & + + n_xyz(i_fac,3) * p_xyz(trios(i_fac,1),3) + + p(i_fac,:) = p_xyz(trios(i_fac,1), :) + end do + + do c = 1, Grid % n_cells + inside_c(c) = Check_Inside_Box(Vof, p, dd, n_xyz, c = c) + end do + + ! Simply interpolate linearly + do c = 1, Grid % n_cells + if (inside_c(c) == 1) then + !prelim_vof(c) = 1.0 - (min_max_crit_2(c) - dd) & + ! / (min_max_crit_2(c)-min_max_crit_1(c)) + call Vof_Interface_Box(Vof, & + c, & + n_xyz, & + dd, & + prelim_vof(c)) + prelim_vof(c) = 0.001 + + else if (inside_c(c) == 2) then + prelim_vof(c) = 1.0 + end if + end do + + ! Precision + do c = 1, Grid % n_cells + Vof % fun % n(c) = max(prelim_vof(c),Vof % fun % n(c)) + end do + + end do + + close(fu) + + call Work % Disconnect_Real_Cell(prelim_vof) + call Work % Disconnect_Int_Cell (inside_c) + + end subroutine diff --git a/Tests/Vof/Stefan/User_Mod/Vof_Interface_Box.f90 b/Tests/Vof/Stefan/User_Mod/Vof_Interface_Box.f90 deleted file mode 120000 index b52a7b3dc..000000000 --- a/Tests/Vof/Stefan/User_Mod/Vof_Interface_Box.f90 +++ /dev/null @@ -1 +0,0 @@ -../../User_Mod/Vof_Interface_Box.f90 \ No newline at end of file diff --git a/Tests/Vof/Stefan/User_Mod/Vof_Interface_Box.f90 b/Tests/Vof/Stefan/User_Mod/Vof_Interface_Box.f90 new file mode 100644 index 000000000..08ec2694e --- /dev/null +++ b/Tests/Vof/Stefan/User_Mod/Vof_Interface_Box.f90 @@ -0,0 +1,101 @@ +!==============================================================================! + subroutine Vof_Interface_Box(Vof, & + c, & + n_xyz, & + dd, & + vof_int) +!------------------------------------------------------------------------------! +! Computes volume fraction of cell at interface ! +!------------------------------------------------------------------------------! + implicit none +!---------------------------------[Arguments]----------------------------------! + type(Vof_Type), target :: Vof + integer, intent(in) :: c + real :: n_xyz(6,3) + real :: dd(6) + real :: vof_int +!------------------------------[Local parameters]------------------------------! + integer, parameter :: N = 10000 +!-----------------------------------[Locals]-----------------------------------! + type(Grid_Type), pointer :: Grid + logical :: l_cel + integer :: nod, n_int, n_tot, fu + integer :: ee, n_cylinders, i_vari, n_vari + real :: r_num, res_func + real :: xmin, xmax, ymin, ymax, zmin, zmax + real, allocatable :: p(:,:) + real :: vof_0, vof_tol1, vof_tol2 + real :: avg_x, avg_y, avg_z + real :: var_comb, var_comb_0, dist_cent + real :: mean_x, mean_y, mean_z + real :: points(N,3) +!==============================================================================! + + ! First take aliasesd + Grid => Vof % pnt_grid + + ! Initialize variables + var_comb = HUGE + var_comb_0 = 0.0 + vof_tol1 = MICRO + vof_tol2 = MILI + dist_cent = Grid % vol(c) ** ONE_THIRD + vof_int = HUGE + + n_tot = 0 + n_int = 0 + allocate(p(1,3)) + + ! Find bounding box: + xmin = HUGE; ymin = HUGE; zmin = HUGE; + xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; + + do nod = 1, Grid % cells_n_nodes(c) + xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) + ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) + zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) + xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) + ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) + zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) + end do + + l_cel = .false. + + do while ( (n_tot < N) .and. (abs(var_comb - var_comb_0) > vof_tol1 .or. & + (var_comb / dist_cent) > vof_tol2) ) + + l_cel = .false. + + ! Check if p is inside cell + do while (l_cel .eqv. .false.) + call random_number(r_num) + p(1,1) = xmin + (xmax-xmin) * r_num + call random_number(r_num) + p(1,2) = ymin+ (ymax-ymin) * r_num + call random_number(r_num) + p(1,3) = zmin+ (zmax-zmin) * r_num + l_cel = Grid % Is_Point_In_Cell(c, p(1,1), p(1,2), p(1,3)) + end do + n_tot = n_tot + 1 + + points(n_tot,:) = p(1,:) + + ! Check if p is inside function: + if(Check_Inside_Box(Vof, p, dd, n_xyz) == 1) then + n_int = n_int + 1 + end if + + ! Compute maximum difference c/r center: + if(mod(n_tot, 500) == 0 .and. n_tot > 0) then + var_comb_0 = var_comb + vof_int = real(n_int) / real(n_tot) + mean_x = sum(points(1: n_tot,1)) / real(n_tot) + mean_y = sum(points(1: n_tot,2)) / real(n_tot) + mean_z = sum(points(1: n_tot,3)) / real(n_tot) + var_comb = abs(mean_x-Grid % xc(c)) & + + abs(mean_y-Grid % yc(c)) & + + abs(mean_z-Grid % zc(c)) + end if + end do + + end subroutine diff --git a/Tests/Vof/Stefan/control b/Tests/Vof/Stefan/control index 8d17c9927..3c9ab2150 100644 --- a/Tests/Vof/Stefan/control +++ b/Tests/Vof/Stefan/control @@ -36,76 +36,70 @@ #----------------- # Phase 0 is vapor, phase 1 is liquid - PHASE_DENSITIES 0.597 958.4 - PHASE_VISCOSITIES 1.0e-3 1.0e-3 - PHASE_CONDUCTIVITIES 0.025 0.679 - PHASE_CAPACITIES 2030.0 4216.0 - SURFACE_TENSION 0.0 - MASS_TRANSFER yes - SATURATION_TEMPERATURE 0.1 + PHASE_DENSITIES 0.597 958.4 + PHASE_VISCOSITIES 1.0e-3 1.0e-3 + PHASE_CONDUCTIVITIES 0.025 0.679 + PHASE_CAPACITIES 2030.0 4216.0 + SURFACE_TENSION 0.0 + MASS_TRANSFER yes + SATURATION_TEMPERATURE 0.1 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - REFERENCE_DENSITY 1.0 + REFERENCE_DENSITY 1.0 #---------------------- # Numerical parameters #---------------------- + PRESSURE_MOMENTUM_COUPLING simple - PRESSURE_MOMENTUM_COUPLING simple + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.95 - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.95 + TIME_INTEGRATION_SCHEME linear - TIME_INTEGRATION_SCHEME linear + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_VOF cicsam - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_VOF cicsam + GU_CORRECTION yes + CHOI_CORRECTION yes - GU_CORRECTION yes - CHOI_CORRECTION yes - - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - GRADIENT_METHOD_FOR_VOF gauss_theorem - TOLERANCE_FOR_VOF GRADIENTS 1.0e-4 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 - MAX_ITERATIONS_FOR_GAUSS_GRADIENTS 200 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_VOF gauss_theorem + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 + MAX_GAUSS_GRADIENTS_ITERATIONS 200 #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-05 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-05 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-05 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 8 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - TEMPORAL_PRESSURE_CORRECTION yes - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-05 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-05 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-05 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 8 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 #--------------------- # Boundary conditions #--------------------- BOUNDARY_CONDITION wall TYPE inflow - VARIABLES u v w vof vof_c_ang t - VALUES 0.00 0.0 0.0 0.0 90.0 10.1 + VARIABLES u v w vof vof_c_ang t + VALUES 0.0 0.0 0.0 0.0 90.0 10.1 BOUNDARY_CONDITION outlet TYPE outflow - VARIABLES u v w vof vof_c_ang q - VALUES 0.00 0.0 0.0 0.0 90.0 0.0 + VARIABLES u v w vof vof_c_ang q + VALUES 0.0 0.0 0.0 0.0 90.0 0.0 BOUNDARY_CONDITION symmetry TYPE symmetry - VARIABLES u v w vof vof_c_ang q - VALUES 0.00 0.0 0.0 0.0 90.0 0.0 + VARIABLES u v w vof vof_c_ang q + VALUES 0.0 0.0 0.0 0.0 90.0 0.0 diff --git a/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Energy.f90 b/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Energy.f90 index 90f9fde72..12a36863f 100644 --- a/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Energy.f90 +++ b/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Energy.f90 @@ -1,16 +1,14 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Energy function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Turb_Type), target :: Turb - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Turb_Type), target :: Turb + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid integer :: c1, c2, s, fui, fut @@ -25,7 +23,7 @@ subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) ! Write out temperature distribution ! !----------------------------------------! profile_name = 'temperature_distribution_0000.num' - write(profile_name(26:29), '(i4.4)') curr_dt + write(profile_name(26:29), '(i4.4)') Time % Curr_Dt() call File % Open_For_Writing_Ascii(profile_name, fut) do s = 1, Grid % n_faces @@ -51,7 +49,7 @@ subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) ! Write out temperature gradients ! !-------------------------------------! profile_name = 'temperature_gradients_0000.num' - write(profile_name(23:26), '(i4.4)') curr_dt + write(profile_name(23:26), '(i4.4)') Time % Curr_Dt() call File % Open_For_Writing_Ascii(profile_name, fut) do s = 1, Grid % n_faces @@ -80,10 +78,10 @@ subroutine User_Mod_End_Of_Compute_Energy(Flow, Turb, Vof, Sol, curr_dt, ini) if(any(Vof % Front % elems_at_face(1:2,s) .ne. 0)) then ! Write down Stefan's solution - if(ini .eq. 1 .and. & + if(Iter % Current() .eq. 1 .and. & Math % Approx_Real(Grid % ys(s), 0.0) .and. & Math % Approx_Real(Grid % zs(s), 0.0)) then - write(fui, '(99(es12.4))') curr_dt * Flow % dt, Grid % xs(s) + write(fui, '(99(es12.4))') Time % Curr_Dt() * Flow % dt, Grid % xs(s) end if end if diff --git a/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Pressure.f90 b/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Pressure.f90 index 783e7a06e..bd89a140e 100644 --- a/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Pressure.f90 +++ b/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Pressure.f90 @@ -1,15 +1,13 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol, curr_dt, ini) + subroutine User_Mod_End_Of_Compute_Pressure(Flow, Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Pressure function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Field_Type), target :: Flow - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step - integer, intent(in) :: ini ! inner iteration + type(Field_Type), target :: Flow + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: p, pp diff --git a/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Vof.f90 b/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Vof.f90 index 39fd48a07..6821bb44a 100644 --- a/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Vof.f90 +++ b/Tests/Vof/Sucking/User_Mod/End_Of_Compute_Vof.f90 @@ -1,13 +1,12 @@ !==============================================================================! - subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol, curr_dt) + subroutine User_Mod_End_Of_Compute_Vof(Vof, Sol) !------------------------------------------------------------------------------! ! This function is called at the end of Compute_Vof function. ! !------------------------------------------------------------------------------! implicit none !---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - type(Solver_Type), target :: Sol - integer, intent(in) :: curr_dt ! current time step + type(Vof_Type), target :: Vof + type(Solver_Type), target :: Sol !-----------------------------------[Locals]-----------------------------------! type(Grid_Type), pointer :: Grid type(Field_Type), pointer :: Flow diff --git a/Tests/Vof/Sucking/control b/Tests/Vof/Sucking/control index 045d8917b..2b815cc23 100644 --- a/Tests/Vof/Sucking/control +++ b/Tests/Vof/Sucking/control @@ -1,111 +1,106 @@ #---------- # Prologue #---------- - PROBLEM_NAME sucking - HEAT_TRANSFER yes - INTERFACE_TRACKING yes - TRACK_FRONT yes + PROBLEM_NAME sucking + HEAT_TRANSFER yes + INTERFACE_TRACKING yes + TRACK_FRONT yes # TIME_STEP 2.5e-3 # NUMBER_OF_TIME_STEPS 3600 - TIME_STEP 2.5e-3 - NUMBER_OF_TIME_STEPS 12 + TIME_STEP 2.5e-3 + NUMBER_OF_TIME_STEPS 12 # TIME_STEP 1.0e-2 # NUMBER_OF_TIME_STEPS 900 - MAX_SIMPLE_ITERATIONS 12 - MIN_SIMPLE_ITERATIONS 6 + MAX_SIMPLE_ITERATIONS 12 + MIN_SIMPLE_ITERATIONS 6 - RESULTS_SAVE_INTERVAL 1 - SAVE_INITIAL_CONDITION yes - SAVE_RESULTS_AT_BOUNDARIES no - BACKUP_SAVE_INTERVAL 1200 + RESULTS_SAVE_INTERVAL 1 + SAVE_INITIAL_CONDITION yes + SAVE_RESULTS_AT_BOUNDARIES no + BACKUP_SAVE_INTERVAL 1200 #------------------- # Monitoring points #------------------- - NUMBER_OF_MONITORING_POINTS 0 - MONITORING_POINT_001 0.6 0.05 0.05 + NUMBER_OF_MONITORING_POINTS 0 + MONITORING_POINT_001 0.6 0.05 0.05 - POINT_FOR_MONITORING_PLANES 0.6 0.05 0.05 + POINT_FOR_MONITORING_PLANES 0.6 0.05 0.05 #----------------- # Physical models #----------------- # Phase 0 is vapor, phase 1 is liquid - PHASE_DENSITIES 0.597 958.4 - PHASE_VISCOSITIES 1.0e-3 1.0e-3 - PHASE_CONDUCTIVITIES 0.025 0.679 - PHASE_CAPACITIES 2030.0 4216.0 - SURFACE_TENSION 0.0 - MASS_TRANSFER yes - SATURATION_TEMPERATURE 10.0 + PHASE_DENSITIES 0.597 958.4 + PHASE_VISCOSITIES 1.0e-3 1.0e-3 + PHASE_CONDUCTIVITIES 0.025 0.679 + PHASE_CAPACITIES 2030.0 4216.0 + SURFACE_TENSION 0.0 + MASS_TRANSFER yes + SATURATION_TEMPERATURE 10.0 - TURBULENCE_MODEL none - GRAVITATIONAL_VECTOR 0.0 0.0 0.0 + TURBULENCE_MODEL none + GRAVITATIONAL_VECTOR 0.0 0.0 0.0 - REFERENCE_DENSITY 1.0 + REFERENCE_DENSITY 1.0 #---------------------- # Numerical parameters #---------------------- - PRESSURE_MOMENTUM_COUPLING simple + PRESSURE_MOMENTUM_COUPLING simple - SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 - SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 - SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.95 + SIMPLE_UNDERRELAXATION_FOR_MOMENTUM 0.7 + SIMPLE_UNDERRELAXATION_FOR_PRESSURE 0.3 + SIMPLE_UNDERRELAXATION_FOR_ENERGY 0.95 - TIME_INTEGRATION_SCHEME linear + TIME_INTEGRATION_SCHEME linear - ADVECTION_SCHEME_FOR_MOMENTUM minmod - ADVECTION_SCHEME_FOR_VOF cicsam + ADVECTION_SCHEME_FOR_MOMENTUM minmod + ADVECTION_SCHEME_FOR_VOF cicsam - GU_CORRECTION yes - CHOI_CORRECTION yes + GU_CORRECTION yes + CHOI_CORRECTION yes - GRADIENT_METHOD_FOR_PRESSURE gauss_theorem - GRADIENT_METHOD_FOR_VOF gauss_theorem - TOLERANCE_FOR_VOF GRADIENTS 1.0e-4 - TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 - MAX_ITERATIONS_FOR_GAUSS_GRADIENTS 200 + GRADIENT_METHOD_FOR_PRESSURE gauss_theorem + GRADIENT_METHOD_FOR_VOF gauss_theorem + TOLERANCE_FOR_GAUSS_GRADIENTS 1.0e-4 + MAX_GAUSS_GRADIENTS_ITERATIONS 200 #------------------------ # Linear solver settings #------------------------ - PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky - TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-05 - TOLERANCE_FOR_ENERGY_SOLVER 1.e-05 - TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 - TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 - TOLERANCE_FOR_VOF_SOLVER 1.e-05 - MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 - MAX_ITERATIONS_FOR_ENERGY_SOLVER 8 - MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 - MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 - TEMPORAL_PRESSURE_CORRECTION yes - COMPRESION_VOF no - COMPRESION_FACTOR_VOF 1.0 - #DUAL_TIME_STEP_VOF yes + PRECONDITIONER_FOR_SYSTEM_MATRIX incomplete_cholesky + TOLERANCE_FOR_MOMENTUM_SOLVER 1.e-05 + TOLERANCE_FOR_ENERGY_SOLVER 1.e-05 + TOLERANCE_FOR_PRESSURE_SOLVER 1.e-12 + TOLERANCE_FOR_SIMPLE_ALGORITHM 1.e-03 + TOLERANCE_FOR_VOF_SOLVER 1.e-05 + MAX_ITERATIONS_FOR_PRESSURE_SOLVER 256 + MAX_ITERATIONS_FOR_ENERGY_SOLVER 8 + MAX_SMOOTHING_CYCLES_CURVATURE_VOF 8 + MAX_SMOOTHING_CYCLES_NORMAL_VOF 0 #--------------------- # Boundary conditions #--------------------- BOUNDARY_CONDITION wall TYPE inflow - VARIABLES u v w vof vof_c_ang t - VALUES 0.00 0.0 0.0 0.0 90.0 10.0 + VARIABLES u v w vof vof_c_ang t + VALUES 0.0 0.0 0.0 0.0 90.0 10.0 BOUNDARY_CONDITION outlet TYPE outflow - VARIABLES u v w vof vof_c_ang q - VALUES 0.00 0.0 0.0 0.0 90.0 0.0 + VARIABLES u v w vof vof_c_ang q + VALUES 0.0 0.0 0.0 0.0 90.0 0.0 BOUNDARY_CONDITION symmetry TYPE symmetry - VARIABLES u v w vof vof_c_ang q - VALUES 0.00 0.0 0.0 0.0 90.0 0.0 + VARIABLES u v w vof vof_c_ang q + VALUES 0.0 0.0 0.0 0.0 90.0 0.0 diff --git a/Tests/Vof/User_Mod/Check_Inside_Box.f90 b/Tests/Vof/User_Mod/Check_Inside_Box.f90 deleted file mode 100644 index ae72f9c06..000000000 --- a/Tests/Vof/User_Mod/Check_Inside_Box.f90 +++ /dev/null @@ -1,82 +0,0 @@ -!==============================================================================! - integer function Check_Inside_Box(Vof, p, dd, n_xyz, c) -!------------------------------------------------------------------------------! -! Determine if node of cell c lies inside box. Alteratively, if c is not ! -! given it can be used to determine if any given point p is inside the box ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - real, allocatable :: p(:,:) - real :: dd(6) - real :: n_xyz(6,3) - integer, optional :: c -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - integer :: i_fac,n - integer :: infac_box(6) - integer, allocatable :: innod_box(:) - integer :: sum_inside - real :: res_dummy, dist, norm -!==============================================================================! - - ! First take aliasesd - Grid => Vof % pnt_grid - - ! loop in cell faces: - Check_Inside_Box = 0 - - if (present(c)) then - - allocate(innod_box(Grid % cells_n_nodes(c))) - - innod_box = 0 - - ! for every node: - do n = 1, Grid % cells_n_nodes(c) - infac_box = 0 - do i_fac = 1, 6 - res_dummy = n_xyz(i_fac,1) * Grid % xn(Grid % cells_n(n,c)) & - + n_xyz(i_fac,2) * Grid % yn(Grid % cells_n(n,c)) & - + n_xyz(i_fac,3) * Grid % zn(Grid % cells_n(n,c)) - norm = norm2(n_xyz(i_fac,1:3)) - dist = dot_product(n_xyz(i_fac,1:3) & - / norm, (/( Grid % xn(Grid % cells_n(n,c)) & - - p(i_fac,1) ), & - ( Grid % yn(Grid % cells_n(n,c)) & - - p(i_fac,2) ), & - ( Grid % zn(Grid % cells_n(n,c)) & - - p(i_fac,3) )/) ) - if (res_dummy <= dd(i_fac)) then - infac_box(i_fac) = 1 - end if - end do - if (sum(infac_box) == 6) then - innod_box(n) = 1 - end if - end do - - sum_inside = sum(innod_box) - if (sum_inside == Grid % cells_n_nodes(c)) then - Check_Inside_Box = 2 - else if (sum_inside < Grid % cells_n_nodes(c) .and. & - sum_inside > 0) then - Check_Inside_Box = 1 - end if - else - infac_box = 0 - do i_fac =1, 6 - res_dummy = n_xyz(i_fac,1) * p(1,1) & - + n_xyz(i_fac,2) * p(1,2) & - + n_xyz(i_fac,3) * p(1,3) - if (res_dummy <= dd(i_fac)) then - infac_box(i_fac) = 1 - end if - end do - - if (sum(infac_box) == 6) then - Check_Inside_Box = 1 - end if - end if - - end function diff --git a/Tests/Vof/User_Mod/Vof_Area_Square_Circle.f90 b/Tests/Vof/User_Mod/Vof_Area_Square_Circle.f90 deleted file mode 100644 index af61676e1..000000000 --- a/Tests/Vof/User_Mod/Vof_Area_Square_Circle.f90 +++ /dev/null @@ -1,47 +0,0 @@ -!==============================================================================! - subroutine Vof_Area_Square_Circle(xint0, xint1, cx, cy, r, h, area) -!------------------------------------------------------------------------------! -! Computes intersection area between square and circl ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - real :: xint0, xint1, cx, cy, r, h, area -!-----------------------------------[Locals]-----------------------------------! - real :: x1, x2, xmin, xmax, tmin, tmax, xaux - real :: integ1, integ2, epsloc -!==============================================================================! - - epsloc = epsilon(epsloc) - - if (xint0 > xint1) then - xaux = xint1 - xint1 = xint0 - xint0 = xaux - end if - - if (h > r) then - area = 0.0 - else - x1 = cx - sqrt(r ** 2 - h ** 2) - x2 = cx + sqrt(r ** 2 - h ** 2) - - xmin = max(xint0, x1) - xmax = min(xint1, x2) - - if (xmin > xmax) then - area = 0.0 - else - tmin = r ** 2 - (cx - xmin) ** 2 + epsloc - tmax = r ** 2 - (cx - xmax) ** 2 + epsloc - - integ1 = -0.5 * (cx - xmax) * sqrt(tmax) & - +0.5 * r ** 2 * atan( (xmax - cx) * sqrt(tmax) / tmax) - h * xmax - - integ2 = -0.5 * (cx - xmin) * sqrt(tmin) & - +0.5 * r ** 2 * atan( (xmin - cx) * sqrt(tmin) / tmin) - h * xmin - - area = integ1 - integ2 - end if - end if - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Divide_Cuboid.f90 b/Tests/Vof/User_Mod/Vof_Divide_Cuboid.f90 deleted file mode 100644 index c66d52278..000000000 --- a/Tests/Vof/User_Mod/Vof_Divide_Cuboid.f90 +++ /dev/null @@ -1,78 +0,0 @@ -!==============================================================================! - subroutine Vof_Divide_Cuboid(Vof, c) -!------------------------------------------------------------------------------! -! Divides cuboid recursively to make an accurate initialization ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - integer :: c -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - integer :: n, fu, n_node_vol, s - integer :: ee, n_cylinders, iterat - integer :: alloc_nod, alloc_fac - integer :: i_nod, i_fac - integer :: level_r - real :: radius, height - real :: p1_x, p1_y, p1_z - real :: p2_x, p2_y, p2_z - real :: res_dummy - real :: seed_node(3) - real, allocatable :: nod_x(:),nod_y(:),nod_z(:) - integer, allocatable :: faces_nod(:,:) - real, contiguous, pointer :: prelim_vof(:),min_max_crit_1(:),min_max_crit_2(:) -!==============================================================================! - - call Work % Connect_Real_Cell(prelim_vof, min_max_crit_1, min_max_crit_2) - - ! First take aliasesd - Grid => Vof % pnt_grid - n_nod_vol = 8 - alloc_nod = 0 - alloc_fac = 0 - - level_r = 1 - do iterat = 0, level_r - alloc_nod = alloc_nod + n_nod_vol * 8 ** iterat - end do - - do iterat = 0, level_r - alloc_fac = alloc_fac + 6 * 8 ** iterat - end do - - allocate(nod_x(alloc_nod), nod_y(alloc_nod), nod_z(alloc_nod)) - nod_x = 0.0; nod_y = 0.0; nod_z = 0.0 - allocate(faces_nod(alloc_fac,4)) - - !list nodes first cuboid: - i_nod = 1 - do n = 1, Grid % cells_n_nodes(c) - nod_x(inod) = Grid % xn(Grid % cells_n(n,c)) - nod_y(inod) = Grid % yn(Grid % cells_n(n,c)) - nod_z(inod) = Grid % zn(Grid % cells_n(n,c)) - i_nod = i_nod + 1 - end do - - !list of nodes on faces: - i_fac = 1 - do iterat = 1, Grid % cells_n_faces(c) - s = Grid % cells_f(iterat, c) - do n = 1, Grid % faces_n_nodes(s) - faces_nod(i_fac,n) = Grid % faces_n(n,s) - i_fac = i_fac + 1 - end do - end do - - - ! find center (which is also nod on the slicing plane) - seed_node = 0.0; - do n = i_nod, 1, -1 - seed_node(1) = seed_node(1) + nod_x(n) / 8.0 - seed_node(2) = seed_node(2) + nod_y(n) / 8.0 - seed_node(3) = seed_node(3) + nod_z(n) / 8.0 - end do - - call Work % Disconnect_Real_Cell(prelim_vof, min_max_crit_1, min_max_crit_2) - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Exact_Cylinder.f90 b/Tests/Vof/User_Mod/Vof_Exact_Cylinder.f90 deleted file mode 100644 index 63cdc9931..000000000 --- a/Tests/Vof/User_Mod/Vof_Exact_Cylinder.f90 +++ /dev/null @@ -1,97 +0,0 @@ -!==============================================================================! - subroutine Vof_Exact_Cylinder(Vof, & - c, & - p1_x, p1_y, p1_z, & - p2_x, p2_y, p2_z, & - radius, height, & - min_max_c1, min_max_c2, & - vof_int) -!------------------------------------------------------------------------------! -! Computes volume fraction of cell at interface ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - integer :: c - real :: p1_x, p1_y, p1_z - real :: p2_x, p2_y, p2_z - real :: radius, height - real :: vof_int - real :: min_max_c1, min_max_c2 -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - integer :: nod, n_int, n_tot, n_tot_int, fu - real :: xmin, xmax, ymin, ymax, zmin, zmax - real :: zminprim, zmaxprim - real :: area1, area2, area3, thick_y, h - real :: dist -!==============================================================================! - - ! First take aliasesd - Grid => Vof % pnt_grid - - ! find bounding box: - xmin = HUGE; ymin = HUGE; zmin = HUGE; - xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; - - do nod = 1, abs(Grid % cells_n_nodes(c)) - xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) - ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) - zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) - xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) - ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) - zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) - end do - - thick_y = ymax-ymin - - ! Area with open top - h = zmin - p1_z - - if (h >= 0.0) then ! Cell is above cylinder center, no problem - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area1) - - h = zmax - p1_z - - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area2) - - vof_int = ( area1 - area2 ) / ((zmax - zmin) * (xmax - xmin)) - - if (min_max_c2 <= 1.0) then - vof_int = 1.0 - end if - - else - if (zmax > p1_z) then ! Cell intersects cylinder center in z - h = 0.0 - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area1) - - h = zmax - p1_z - - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area2) - - h = p1_z - zmin - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area3) - - vof_int = ( 2.0 * area1 - area2 - area3)/ ((zmax - zmin) * (xmax - xmin)) - - else ! Cell below cylinder center in z - zminprim = 2.0 * p1_z - zmax - zmaxprim = zminprim + zmax- zmin - zmin = zminprim - zmax = zmaxprim - - h = zmin - p1_z - - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area1) - - h = zmax - p1_z - - call Vof_Area_Square_Circle(xmin, xmax, p1_x, p1_z, radius, h, area2) - - vof_int = ( area1 - area2 ) / ((zmax - zmin) * (xmax - xmin)) - - end if - end if - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Initialization_Box.f90 b/Tests/Vof/User_Mod/Vof_Initialization_Box.f90 deleted file mode 100644 index 2a5a8b1fb..000000000 --- a/Tests/Vof/User_Mod/Vof_Initialization_Box.f90 +++ /dev/null @@ -1,130 +0,0 @@ -!==============================================================================! - subroutine Vof_Initialization_Box(Vof) -!------------------------------------------------------------------------------! -! Initialize as vof = 1 all cells inside a rectangular box defined by eight ! -! points, sorted as shown in the schematic below. It should work for any ! -! orientation of the box and possibly, it can be generalized to any convex ! -! polyedral ! -!------------------------------------------------------------------------------! -! ! -! 8-----------7 ! -! /| /| ! -! 5-----------6 | ! -! | | | | ! -! | | | | ! -! | | | | ! -! | 4 - - - - | 3 ! -! |/ |/ ! -! 1-----------2 ! -! ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - real :: p_xyz(8,3) - real, allocatable :: p(:,:) - integer :: c, n, i, fu - integer :: ee, n_boxes, n_p, np_count, i_fac, seeds(1024) - integer :: trios(6,3) - real :: n_xyz(6,3), v1aux(3), v2aux(3) - real :: res_dummy - real :: dd(6) - character(20) :: p_name_aux - real, contiguous, pointer :: prelim_vof(:) - integer, contiguous, pointer :: inside_c(:) -!==============================================================================! - - call Work % Connect_Real_Cell(prelim_vof) - call Work % Connect_Int_Cell (inside_c) - - ! First take aliases - Grid => Vof % pnt_grid - - prelim_vof = 0.0 - - ! Initialize random seed - p_name_aux = 'obstacle' - call random_seed(size=n) - seeds = (/(i, i=1,n)/) - call random_seed(put=seeds(1:n)) - - allocate(p(6,3)) - - ! Initialize sorting for normals: - trios(1,:) = (/1, 4, 2/) - trios(2,:) = (/6, 7, 8/) - trios(3,:) = (/3, 7, 6/) - trios(4,:) = (/5, 8, 4/) - trios(5,:) = (/1, 2, 6/) - trios(6,:) = (/3, 4, 8/) - - ! Open file to read Plane parameters: - call File % Open_For_Reading_Ascii('box_parameters.ini', fu) - - call File % Read_Line(fu) - read(line % tokens(1), *) n_boxes - - np_count = 1 - - do ee = 1, n_boxes - - do n_p = 1, 8 - call File % Read_Line(fu) - read(line % tokens(1), *) p_xyz(n_p, 1) - read(line % tokens(2), *) p_xyz(n_p, 2) - read(line % tokens(3), *) p_xyz(n_p, 3) - end do - - ! Define Planes of the box - do i_fac = 1, 6 - - v1aux(:) = p_xyz(trios(i_fac,2),:) - p_xyz(trios(i_fac,1),:) - v2aux(:) = p_xyz(trios(i_fac,3),:) - p_xyz(trios(i_fac,1),:) - - n_xyz(i_fac,1) = v1aux(2) * v2aux(3) - v1aux(3) * v2aux(2) - n_xyz(i_fac,2) = - (v1aux(1) * v2aux(3) - v1aux(3) * v2aux(1)) - n_xyz(i_fac,3) = v1aux(1) * v2aux(2) - v1aux(2) * v2aux(1) - - dd(i_fac) = n_xyz(i_fac,1) * p_xyz(trios(i_fac,1),1) & - + n_xyz(i_fac,2) * p_xyz(trios(i_fac,1),2) & - + n_xyz(i_fac,3) * p_xyz(trios(i_fac,1),3) - - p(i_fac,:) = p_xyz(trios(i_fac,1), :) - end do - - do c = 1, Grid % n_cells - inside_c(c) = Check_Inside_Box(Vof, p, dd, n_xyz, c = c) - end do - - ! Simply interpolate linearly - do c = 1, Grid % n_cells - if (inside_c(c) == 1) then - !prelim_vof(c) = 1.0 - (min_max_crit_2(c) - dd) & - ! / (min_max_crit_2(c)-min_max_crit_1(c)) - call Vof_Interface_Box(Vof, & - c, & - n_xyz, & - dd, & - prelim_vof(c)) - prelim_vof(c) = 0.001 - - else if (inside_c(c) == 2) then - prelim_vof(c) = 1.0 - end if - end do - - ! Precision - do c = 1, Grid % n_cells - Vof % fun % n(c) = max(prelim_vof(c),Vof % fun % n(c)) - end do - - end do - - close(fu) - - call Work % Disconnect_Real_Cell(prelim_vof) - call Work % Disconnect_Int_Cell (inside_c) - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Initialization_Cylinder.f90 b/Tests/Vof/User_Mod/Vof_Initialization_Cylinder.f90 deleted file mode 100644 index 0a34a3727..000000000 --- a/Tests/Vof/User_Mod/Vof_Initialization_Cylinder.f90 +++ /dev/null @@ -1,106 +0,0 @@ -!==============================================================================! - subroutine Vof_Initialization_Cylinder(Vof) -!------------------------------------------------------------------------------! -! Initialize dependent variables. (It is a bit of a mess still) ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - integer :: c, n, fu - integer :: ee, n_cylinders - real :: radius, height - real :: p1_x, p1_y, p1_z - real :: p2_x, p2_y, p2_z - real :: res_dummy, minnody, maxnody - real, contiguous, pointer :: prelim_vof(:),min_max_crit_1(:),min_max_crit_2(:) -!==============================================================================! - - call Work % Connect_Real_Cell(prelim_vof, min_max_crit_1, min_max_crit_2) - - ! First take aliasesd - Grid => Vof % pnt_grid - - prelim_vof = 0.0 - - ! call Vof_Init_Random_Seed(problem_name) - - ! Open file to read cylinder parameters: - call File % Open_For_Reading_Ascii('cylinder_parameters.ini', fu) - - call File % Read_Line(fu) - read(line % tokens(1), *) n_cylinders - - do ee = 1, n_cylinders - - ! Taking extrema - min_max_crit_1(:) = HUGE - min_max_crit_2(:) = -HUGE - - call File % Read_Line(fu) - read(line % tokens(1), *) radius - - call File % Read_Line(fu) - read(line % tokens(1), *) p1_x - read(line % tokens(2), *) p1_y - read(line % tokens(3), *) p1_z - - call File % Read_Line(fu) - read(line % tokens(1), *) p2_x - read(line % tokens(2), *) p2_y - read(line % tokens(3), *) p2_z - - height = sqrt((p1_x-p2_x)**2+(p1_y-p2_y)**2+(p1_z-p2_z)**2) - - do c = 1, Grid % n_cells - - ! For every node - do n = 1, Grid % cells_n_nodes(c) - - res_dummy = ( & - ( (p2_y-p1_y)*(p1_z-Grid % zn(Grid % cells_n(n,c))) & - -(p1_y-Grid % yn(Grid % cells_n(n,c)))*(p2_z-p1_z))**2 & - +( (p2_x-p1_x)*(p1_z-Grid % zn(Grid % cells_n(n,c))) & - -(p1_x-Grid % xn(Grid % cells_n(n,c)))*(p2_z-p1_z))**2 & - +( (p2_x-p1_x)*(p1_y-Grid % yn(Grid % cells_n(n,c))) & - -(p1_x-Grid % xn(Grid % cells_n(n,c)))*(p2_y-p1_y))**2 ) & - / (radius*height) ** 2 - - min_max_crit_1(c)= min(res_dummy, min_max_crit_1(c)) - min_max_crit_2(c)= max(res_dummy, min_max_crit_2(c)) - end do - end do - - ! Interpolate from exact cylinder - do c = 1, Grid % n_cells - call Vof_Exact_Cylinder(Vof, & - c, & - p1_x, p1_y, p1_z, & - p2_x, p2_y, p2_z, & - radius, height, & - min_max_crit_1(c), min_max_crit_2(c), & - prelim_vof(c)) - end do - ! Simply interpolate linearly - ! do c = 1, Grid % n_cells - ! if (min_max_crit_1(c) < 1.0 .and. min_max_crit_2(c) > 1.0) then - ! prelim_vof(c) = (1.0 - min_max_crit_1(c)) & - ! / (min_max_crit_2(c)-min_max_crit_1(c)) - ! else if (min_max_crit_2(c) <= 1.0) then - ! prelim_vof(c) = 1.0 - ! end if - ! end do - - ! Precision - do c = 1, Grid % n_cells - Vof % fun % n(c) = max(prelim_vof(c),Vof % fun % n(c)) - end do - - end do - - close(fu) - - call Work % Disconnect_Real_Cell(prelim_vof, min_max_crit_1, min_max_crit_2) - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Initialization_Ellipsoid.f90 b/Tests/Vof/User_Mod/Vof_Initialization_Ellipsoid.f90 deleted file mode 100644 index c98820aa2..000000000 --- a/Tests/Vof/User_Mod/Vof_Initialization_Ellipsoid.f90 +++ /dev/null @@ -1,92 +0,0 @@ -!==============================================================================! - subroutine Vof_Initialization_Ellipsoid(Vof) -!------------------------------------------------------------------------------! -! Initialize dependent variables. (It is a bit of a mess still) ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - integer :: c, n, fu, i_nod - integer :: ee, n_ellipses - real :: radius_1, radius_2, radius_3 - real :: cent_x, cent_y, cent_z, dist_norm - real, contiguous, pointer :: prelim_vof(:), min_dist(:), max_dist(:) - real, contiguous, pointer :: dist_node(:) -!==============================================================================! - - call Work % Connect_Real_Cell(prelim_vof, min_dist, max_dist) - call Work % Connect_Real_Node(dist_node) - - ! First take aliases - Grid => Vof % pnt_grid - - ! Open file to read Ellipsoid parameters: - call File % Open_For_Reading_Ascii('ellipsoid_parameters.ini', fu) - - call File % Read_Line(fu) - read(line % tokens(1), *) n_ellipses - - do ee = 1, n_ellipses - - ! Initialize working arrays - prelim_vof(:) = 0.0 - - call File % Read_Line(fu) - read(line % tokens(1), *) radius_1 - read(line % tokens(2), *) radius_2 - read(line % tokens(3), *) radius_3 - - call File % Read_Line(fu) - read(line % tokens(1), *) cent_x - read(line % tokens(2), *) cent_y - read(line % tokens(3), *) cent_z - - ! Normalized distance from ellipsoid center in nodes - dist_node (:) = 0.0 - do n = 1, Grid % n_nodes - dist_node(n) = sqrt( ((Grid % xn(n) - cent_x) / radius_1)**2 & - + ((Grid % yn(n) - cent_y) / radius_2)**2 & - + ((Grid % zn(n) - cent_z) / radius_3)**2) - end do - - ! Minimum and maximum normalized distance in cells - min_dist(:) = +HUGE - max_dist(:) = -HUGE - do c = 1, Grid % n_cells - do i_nod = 1, abs(Grid % cells_n_nodes(c)) - n = Grid % cells_n(i_nod, c) - - min_dist(c)= min(dist_node(n), min_dist(c)) - max_dist(c)= max(dist_node(n), max_dist(c)) - end do - end do - - ! Simply interpolate linearly - do c = 1, Grid % n_cells - - ! Since surface is at 1.0 this checks if cell crosses the surface - if (min_dist(c) < 1.0 .and. max_dist(c) > 1.0) then - prelim_vof(c) = (1.0 - min_dist(c)) & - / (max_dist(c)-min_dist(c)) - - else if (max_dist(c) <= 1.0) then - prelim_vof(c) = 1.0 - end if - - end do - - ! Precision (what on earth?) - do c = 1, Grid % n_cells - Vof % fun % n(c) = max(prelim_vof(c), Vof % fun % n(c)) - end do - - end do - - close(fu) - - call Work % Disconnect_Real_Cell(prelim_vof, min_dist, max_dist) - call Work % Disconnect_Real_Node(dist_node) - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Initialization_Plane.f90 b/Tests/Vof/User_Mod/Vof_Initialization_Plane.f90 deleted file mode 100644 index 1d84ff1a6..000000000 --- a/Tests/Vof/User_Mod/Vof_Initialization_Plane.f90 +++ /dev/null @@ -1,105 +0,0 @@ -!==============================================================================! - subroutine Vof_Initialization_Plane(Vof) -!------------------------------------------------------------------------------! -! Initialize as vof = 1 all cells beneath the plane given by 3 points ! -! sorted anticlockwise to the direction of the plane normal ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - real, allocatable :: p_xyz(:,:) - integer :: c, n, fu - integer :: ee, n_planes - real :: n_xyz(3), v1aux(3), v2aux(3) - real :: res_dummy - real :: dd - real, contiguous, pointer :: prelim_vof(:),min_max_crit_1(:),min_max_crit_2(:) -!==============================================================================! - - call Work % Connect_Real_Cell(prelim_vof, min_max_crit_1, min_max_crit_2) - - ! First take aliases - Grid => Vof % pnt_grid - - prelim_vof = 0.0 - - ! Open file to read Plane parameters: - call File % Open_For_Reading_Ascii('plane_parameters.ini', fu) - - call File % Read_Line(fu) - read(line % tokens(1), *) n_planes - - if (allocated(p_xyz)) deallocate(p_xyz) - allocate(p_xyz(n_planes*3,3)) - - do ee = 1, n_planes - - ! Taking extrema - min_max_crit_1(:) = HUGE - min_max_crit_2(:) = -HUGE - - ! Read point 1 - call File % Read_Line(fu) - read(line % tokens(1), *) p_xyz(1, 1) - read(line % tokens(2), *) p_xyz(1, 2) - read(line % tokens(3), *) p_xyz(1, 3) - - ! Read point 2 - call File % Read_Line(fu) - read(line % tokens(1), *) p_xyz(2, 1) - read(line % tokens(2), *) p_xyz(2, 2) - read(line % tokens(3), *) p_xyz(2, 3) - - ! Read point 3 - call File % Read_Line(fu) - read(line % tokens(1), *) p_xyz(3, 1) - read(line % tokens(2), *) p_xyz(3, 2) - read(line % tokens(3), *) p_xyz(3, 3) - - v1aux(:) = p_xyz(2,:) - p_xyz(1,:) - v2aux(:) = p_xyz(3,:) - p_xyz(1,:) - - n_xyz(1) = v1aux(2) * v2aux(3) - v1aux(3) * v2aux(2) - n_xyz(2) = - (v1aux(1) * v2aux(3) - v1aux(3) * v2aux(1)) - n_xyz(3) = v1aux(1) * v2aux(2) - v1aux(2) * v2aux(1) - - dd = n_xyz(1) * p_xyz(1,1) + n_xyz(2) * p_xyz(1,2) + n_xyz(3) * p_xyz(1,3) - - do c = 1, Grid % n_cells - - ! For every node: - do n = 1, Grid % cells_n_nodes(c) - - res_dummy = n_xyz(1) * Grid % xn(Grid % cells_n(n,c)) & - + n_xyz(2) * Grid % yn(Grid % cells_n(n,c)) & - + n_xyz(3) * Grid % zn(Grid % cells_n(n,c)) - - min_max_crit_1(c)= min(res_dummy, min_max_crit_1(c)) - min_max_crit_2(c)= max(res_dummy, min_max_crit_2(c)) - end do - end do - - ! Simply interpolate linearly - do c = 1, Grid % n_cells - if (min_max_crit_1(c) < dd .and. min_max_crit_2(c) > dd) then - prelim_vof(c) = 1.0 - (min_max_crit_2(c) - dd) & - / (min_max_crit_2(c)-min_max_crit_1(c)) - else if (min_max_crit_2(c) <= dd) then - prelim_vof(c) = 1.0 - end if - end do - - ! Precision - do c = 1, Grid % n_cells - Vof % fun % n(c) = max(prelim_vof(c),Vof % fun % n(c)) - end do - - end do - - close(fu) - - call Work % Disconnect_Real_Cell(prelim_vof, min_max_crit_1, min_max_crit_2) - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Interface_Box.f90 b/Tests/Vof/User_Mod/Vof_Interface_Box.f90 deleted file mode 100644 index 08ec2694e..000000000 --- a/Tests/Vof/User_Mod/Vof_Interface_Box.f90 +++ /dev/null @@ -1,101 +0,0 @@ -!==============================================================================! - subroutine Vof_Interface_Box(Vof, & - c, & - n_xyz, & - dd, & - vof_int) -!------------------------------------------------------------------------------! -! Computes volume fraction of cell at interface ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - integer, intent(in) :: c - real :: n_xyz(6,3) - real :: dd(6) - real :: vof_int -!------------------------------[Local parameters]------------------------------! - integer, parameter :: N = 10000 -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - logical :: l_cel - integer :: nod, n_int, n_tot, fu - integer :: ee, n_cylinders, i_vari, n_vari - real :: r_num, res_func - real :: xmin, xmax, ymin, ymax, zmin, zmax - real, allocatable :: p(:,:) - real :: vof_0, vof_tol1, vof_tol2 - real :: avg_x, avg_y, avg_z - real :: var_comb, var_comb_0, dist_cent - real :: mean_x, mean_y, mean_z - real :: points(N,3) -!==============================================================================! - - ! First take aliasesd - Grid => Vof % pnt_grid - - ! Initialize variables - var_comb = HUGE - var_comb_0 = 0.0 - vof_tol1 = MICRO - vof_tol2 = MILI - dist_cent = Grid % vol(c) ** ONE_THIRD - vof_int = HUGE - - n_tot = 0 - n_int = 0 - allocate(p(1,3)) - - ! Find bounding box: - xmin = HUGE; ymin = HUGE; zmin = HUGE; - xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; - - do nod = 1, Grid % cells_n_nodes(c) - xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) - ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) - zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) - xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) - ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) - zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) - end do - - l_cel = .false. - - do while ( (n_tot < N) .and. (abs(var_comb - var_comb_0) > vof_tol1 .or. & - (var_comb / dist_cent) > vof_tol2) ) - - l_cel = .false. - - ! Check if p is inside cell - do while (l_cel .eqv. .false.) - call random_number(r_num) - p(1,1) = xmin + (xmax-xmin) * r_num - call random_number(r_num) - p(1,2) = ymin+ (ymax-ymin) * r_num - call random_number(r_num) - p(1,3) = zmin+ (zmax-zmin) * r_num - l_cel = Grid % Is_Point_In_Cell(c, p(1,1), p(1,2), p(1,3)) - end do - n_tot = n_tot + 1 - - points(n_tot,:) = p(1,:) - - ! Check if p is inside function: - if(Check_Inside_Box(Vof, p, dd, n_xyz) == 1) then - n_int = n_int + 1 - end if - - ! Compute maximum difference c/r center: - if(mod(n_tot, 500) == 0 .and. n_tot > 0) then - var_comb_0 = var_comb - vof_int = real(n_int) / real(n_tot) - mean_x = sum(points(1: n_tot,1)) / real(n_tot) - mean_y = sum(points(1: n_tot,2)) / real(n_tot) - mean_z = sum(points(1: n_tot,3)) / real(n_tot) - var_comb = abs(mean_x-Grid % xc(c)) & - + abs(mean_y-Grid % yc(c)) & - + abs(mean_z-Grid % zc(c)) - end if - end do - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Interface_Cylinder.f90 b/Tests/Vof/User_Mod/Vof_Interface_Cylinder.f90 deleted file mode 100644 index 74a6e3959..000000000 --- a/Tests/Vof/User_Mod/Vof_Interface_Cylinder.f90 +++ /dev/null @@ -1,109 +0,0 @@ -!==============================================================================! - subroutine Vof_Interface_Cylinder(Vof, & - c, & - p1_x, p1_y, p1_z, & - p2_x, p2_y, p2_z, & - radius, height, & - vof_int) -!------------------------------------------------------------------------------! -! Computes volume fraction of cell at interface ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - integer, intent(in) :: c - real :: p1_x, p1_y, p1_z - real :: p2_x, p2_y, p2_z - real :: radius, height - real :: vof_int -!------------------------------[Local parameters]------------------------------! - integer, parameter :: N = 10000 -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - logical :: l_cel - integer :: nod, n_int, n_tot, n_tot_int, fu - integer :: ee, n_cylinders, i_vari, j_vari, n_vari - real :: r_num, res_func - real :: xmin, xmax, ymin, ymax, zmin, zmax - real :: p(3) - real :: vof_0, vof_tol1, vof_tol2 - real :: avg_x, avg_y, avg_z - real :: var_comb, var_comb_0, dist_cent - real :: mean_x, mean_y, mean_z - real :: points(N,3) -!==============================================================================! - - ! First take aliasesd - Grid => Vof % pnt_grid - - ! Initialize variables - var_comb = HUGE - var_comb_0 = 0.0 - vof_tol1 = MICRO - vof_tol2 = MILI - dist_cent = Grid % vol(c) ** ONE_THIRD - vof_int = HUGE - - n_tot = 0 - n_int = 0 - - ! find bounding box: - xmin = HUGE; ymin = HUGE; zmin = HUGE; - xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; - - do nod = 1, Grid % cells_n_nodes(c) - xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) - ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) - zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) - xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) - ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) - zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) - end do - - l_cel = .false. - - do while ( (n_tot < N) .and. (abs(var_comb - var_comb_0) > vof_tol1 .or. & - (var_comb / dist_cent) > vof_tol2) ) - - l_cel = .false. - - ! check if p is inside cell - do while (l_cel .eqv. .false.) - call random_number(r_num) - p(1) = xmin + (xmax-xmin) * r_num - call random_number(r_num) - p(2) = ymin+ (ymax-ymin) * r_num - call random_number(r_num) - p(3) = zmin+ (zmax-zmin) * r_num - l_cel = Grid % Is_Point_In_Cell(c, p(1), p(2), p(3)) - end do - n_tot = n_tot + 1 - - points(n_tot,:) = p(:) - - ! Check if p is inside function: - res_func = ( ( (p2_y-p1_y)*(p1_z-p(3)) & - -(p1_y-p(2))*(p2_z-p1_z))**2 & - +( (p2_x-p1_x)*(p1_z-p(3)) & - -(p1_x-p(1))*(p2_z-p1_z))**2 & - +( (p2_x-p1_x)*(p1_y-p(2)) & - -(p1_x-p(1))*(p2_y-p1_y))**2 ) & - / (radius*height) ** 2 - if (res_func <= 1.0) then - n_int = n_int + 1 - end if - - ! Compute maximum difference c/r center: - if (mod(n_tot,500) == 0 .and. n_tot > 0) then - var_comb_0 = var_comb - vof_int = real(n_int) / real(n_tot) - mean_x = sum(points(1: n_tot,1)) / real(n_tot) - mean_y = sum(points(1: n_tot,2)) / real(n_tot) - mean_z = sum(points(1: n_tot,3)) / real(n_tot) - var_comb = abs(mean_x-Grid % xc(c)) & - + abs(mean_y-Grid % yc(c)) & - + abs(mean_z-Grid % zc(c)) - end if - end do - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Interface_Ellipsoid.f90 b/Tests/Vof/User_Mod/Vof_Interface_Ellipsoid.f90 deleted file mode 100644 index 41c58afc2..000000000 --- a/Tests/Vof/User_Mod/Vof_Interface_Ellipsoid.f90 +++ /dev/null @@ -1,104 +0,0 @@ -!==============================================================================! - subroutine Vof_Interface_Ellipsoid(Vof, & - c, & - cent_x, cent_y, cent_z, & - radius_1, radius_2, radius_3, & - vof_int) -!------------------------------------------------------------------------------! -! Computes volume fraction of cell at interface ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - integer, intent(in) :: c - real :: cent_x, cent_y, cent_z - real :: radius_1, radius_2, radius_3 - real :: vof_int -!------------------------------[Local parameters]------------------------------! - integer, parameter :: N = 10000 -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - logical :: l_cel - integer :: nod, n_int, n_tot, fu - integer :: ee, n_cylinders, i_vari, n_vari - real :: r_num, res_func - real :: xmin, xmax, ymin, ymax, zmin, zmax - real :: p(3) - real :: vof_0, vof_tol1, vof_tol2 - real :: avg_x, avg_y, avg_z - real :: var_comb, var_comb_0, dist_cent - real :: mean_x, mean_y, mean_z - real :: points(N,3) -!==============================================================================! - - ! First take aliases - Grid => Vof % pnt_grid - - ! Initialize variables - var_comb = HUGE - var_comb_0 = 0.0 - vof_tol1 = MICRO - vof_tol2 = MILI - dist_cent = Grid % vol(c) ** ONE_THIRD - vof_int = HUGE - - n_tot = 0 - n_int = 0 - - ! Find bounding box: - xmin = HUGE; ymin = HUGE; zmin = HUGE; - xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; - - do nod = 1, abs(Grid % cells_n_nodes(c)) - xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) - ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) - zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) - xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) - ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) - zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) - end do - - l_cel = .false. - - do while ( (n_tot < N) .and. (abs(var_comb - var_comb_0) > vof_tol1 .or. & - (var_comb / dist_cent) > vof_tol2) ) - - l_cel = .false. - - ! Check if p is inside cell - do while (l_cel .eqv. .false.) - call random_number(r_num) - p(1) = xmin + (xmax-xmin) * r_num - call random_number(r_num) - p(2) = ymin+ (ymax-ymin) * r_num - call random_number(r_num) - p(3) = zmin+ (zmax-zmin) * r_num - l_cel = Grid % Is_Point_In_Cell(c, p(1), p(2), p(3)) - end do - n_tot = n_tot + 1 - - points(n_tot,:) = p(:) - - ! Check if p is inside function: - res_func = sqrt( ((p(1)-cent_x)/radius_1)**2 & - + ((p(2)-cent_y)/radius_2)**2 & - + ((p(3)-cent_z)/radius_3)**2 ) - - if (res_func <= 1.0) then - n_int = n_int + 1 - end if - - ! Compute maximum difference c/r center: - if (mod(n_tot,500) == 0 .and. n_tot > 0) then - var_comb_0 = var_comb - vof_int = real(n_int) / real(n_tot) - mean_x = sum(points(1: n_tot,1)) / real(n_tot) - mean_y = sum(points(1: n_tot,2)) / real(n_tot) - mean_z = sum(points(1: n_tot,3)) / real(n_tot) - var_comb = abs(mean_x-Grid % xc(c)) & - + abs(mean_y-Grid % yc(c)) & - + abs(mean_z-Grid % zc(c)) - end if - end do - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Interface_Plane.f90 b/Tests/Vof/User_Mod/Vof_Interface_Plane.f90 deleted file mode 100644 index cca4f3d2a..000000000 --- a/Tests/Vof/User_Mod/Vof_Interface_Plane.f90 +++ /dev/null @@ -1,102 +0,0 @@ -!==============================================================================! - subroutine Vof_Interface_Plane(Vof, & - c, & - n_xyz, & - dd, & - vof_int) -!------------------------------------------------------------------------------! -! Computes volume fraction of cell at interface ! -!------------------------------------------------------------------------------! - implicit none -!---------------------------------[Arguments]----------------------------------! - type(Vof_Type), target :: Vof - integer, intent(in) :: c - real :: n_xyz(3) - real :: dd - real :: vof_int -!------------------------------[Local parameters]------------------------------! - integer, parameter :: N = 10000 -!-----------------------------------[Locals]-----------------------------------! - type(Grid_Type), pointer :: Grid - logical :: l_cel - integer :: nod, n_int, n_tot, fu - integer :: ee, n_cylinders, i_vari, n_vari - real :: r_num, res_func - real :: xmin, xmax, ymin, ymax, zmin, zmax - real :: p(3) - real :: vof_0, vof_tol1, vof_tol2 - real :: avg_x, avg_y, avg_z - real :: var_comb, var_comb_0, dist_cent - real :: mean_x, mean_y, mean_z - real :: points(N,3) -!==============================================================================! - - ! First take aliases - Grid => Vof % pnt_grid - - ! Initialize variables - var_comb = HUGE - var_comb_0 = 0.0 - vof_tol1 = MICRO - vof_tol2 = MILI - dist_cent = Grid % vol(c) ** ONE_THIRD - vof_int = HUGE - - n_tot = 0 - n_int = 0 - - ! Find bounding box - xmin = HUGE; ymin = HUGE; zmin = HUGE; - xmax = -HUGE; ymax = -HUGE; zmax = -HUGE; - - do nod = 1, Grid % cells_n_nodes(c) - xmin = min(xmin, Grid % xn(Grid % cells_n(nod,c))) - ymin = min(ymin, Grid % yn(Grid % cells_n(nod,c))) - zmin = min(zmin, Grid % zn(Grid % cells_n(nod,c))) - xmax = max(xmax, Grid % xn(Grid % cells_n(nod,c))) - ymax = max(ymax, Grid % yn(Grid % cells_n(nod,c))) - zmax = max(zmax, Grid % zn(Grid % cells_n(nod,c))) - end do - - l_cel = .false. - - do while ( (n_tot < N) .and. (abs(var_comb - var_comb_0) > vof_tol1 .or. & - (var_comb / dist_cent) > vof_tol2) ) - - l_cel = .false. - - ! Check if p is inside cell - do while (l_cel .eqv. .false.) - call random_number(r_num) - p(1) = xmin + (xmax-xmin) * r_num - call random_number(r_num) - p(2) = ymin + (ymax-ymin) * r_num - call random_number(r_num) - p(3) = zmin + (zmax-zmin) * r_num - l_cel = Grid % Is_Point_In_Cell(c, p(1), p(2), p(3)) - end do - n_tot = n_tot + 1 - - points(n_tot, :) = p(:) - - ! Check if p is inside function: - res_func = n_xyz(1) * p(1) + n_xyz(2) * p(2) + n_xyz(3) * p(3) - - if (res_func <= dd) then - n_int = n_int + 1 - end if - - ! Compute maximum difference c/r center: - if (mod(n_tot,500) == 0 .and. n_tot > 0) then - var_comb_0 = var_comb - vof_int = real(n_int) / real(n_tot) - mean_x = sum(points(1: n_tot,1)) / real(n_tot) - mean_y = sum(points(1: n_tot,2)) / real(n_tot) - mean_z = sum(points(1: n_tot,3)) / real(n_tot) - var_comb = abs(mean_x-Grid % xc(c)) & - + abs(mean_y-Grid % yc(c)) & - + abs(mean_z-Grid % zc(c)) - end if - end do - - end subroutine diff --git a/Tests/Vof/User_Mod/Vof_Quick_Sort.f90 b/Tests/Vof/User_Mod/Vof_Quick_Sort.f90 deleted file mode 100644 index 2804711aa..000000000 --- a/Tests/Vof/User_Mod/Vof_Quick_Sort.f90 +++ /dev/null @@ -1,25 +0,0 @@ -recursive subroutine Vof_Quick_Sort(a, coords, dir, first, last) - implicit none - real :: coords(:,:), x, t(3) - integer :: a(:), first, last, ti, dir - integer :: i, j - - x = coords( (first+last) / 2, dir ) - i = first - j = last - do - do while (coords(i, dir) < x) - i=i+1 - end do - do while (x < coords(j, dir)) - j=j-1 - end do - if (i >= j) exit - ti = a(i); a(i) = a(j); a(j) = ti - t = coords(i,:); coords(i,:) = coords(j,:); coords(j,:) = t - i=i+1 - j=j-1 - end do - if (first < i-1) call Vof_Quick_Sort(a, coords, dir, first, i-1) - if (j+1 < last) call Vof_Quick_Sort(a, coords, dir, j+1, last) -end subroutine diff --git a/Tests/Vof/User_Mod/readme b/Tests/Vof/User_Mod/readme deleted file mode 100644 index fbeaa1773..000000000 --- a/Tests/Vof/User_Mod/readme +++ /dev/null @@ -1 +0,0 @@ -Common (shared) user sources for VOF are here. diff --git a/Tests/Vof/Vertical_Tube/User_Mod/End_Of_Time_Step.f90 b/Tests/Vof/Vertical_Tube/User_Mod/End_Of_Time_Step.f90 index e1dc82aad..1f70544fa 100644 --- a/Tests/Vof/Vertical_Tube/User_Mod/End_Of_Time_Step.f90 +++ b/Tests/Vof/Vertical_Tube/User_Mod/End_Of_Time_Step.f90 @@ -1,6 +1,6 @@ !==============================================================================! subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & - n, n_stat_t, n_stat_p, time) + n_stat_t, n_stat_p) !------------------------------------------------------------------------------! ! This function is computing benchmark for rising bubble. ! !------------------------------------------------------------------------------! @@ -10,10 +10,8 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & type(Turb_Type), target :: Turb type(Vof_Type), target :: Vof type(Swarm_Type), target :: Swarm - integer :: n ! time step integer :: n_stat_t ! 1st step for turbulence statist. integer :: n_stat_p ! 1st step for particle statistics - real :: time ! physical time !--------------------------------[Locals]--------------------------------------! type(Grid_Type), pointer :: Grid type(Var_Type), pointer :: fun @@ -43,12 +41,12 @@ subroutine User_Mod_End_Of_Time_Step(Flow, Turb, Vof, Swarm, & rise_velocity = rise_velocity + Flow % w % n(c) * fun % n(c) * Grid % vol(c) end do - call Comm_Mod_Global_Sum_Real(b_volume) - call Comm_Mod_Global_Sum_Real(surface) - call Comm_Mod_Global_Sum_Real(c_position) - call Comm_Mod_Global_Sum_Real(rise_velocity) + call Global % Sum_Real(b_volume) + call Global % Sum_Real(surface) + call Global % Sum_Real(c_position) + call Global % Sum_Real(rise_velocity) - if (this_proc < 2) then + if (First_Proc()) then ! !with circularity: ! open(unit = 70359, file='Bench-data.dat',position='APPEND') ! write(70359,*) b_volume, 2.0*PI/surface*sqrt(b_volume/PI), & diff --git a/Tests/test_build.sh b/Tests/test_build.sh index 6a98285d0..3b1c7fd23 100755 --- a/Tests/test_build.sh +++ b/Tests/test_build.sh @@ -31,13 +31,11 @@ set -e FORTRAN="gnu" FCOMP="" DEBUG="no" -OPENMP="yes" # Intel compiler (python is messed up with Intel, don't plot for now) # FORTRAN="intel" # FCOMP="mpiifort" # DEBUG="no" -# OPENMP="yes" # Variable MODE can be set to "interactive" or "noninteractive", depending if # the script is ran in interactive mode (without command line options) or in @@ -87,6 +85,7 @@ RANS_FUEL_BUNDLE_DIR=Rans/Fuel_Bundle RANS_IMPINGING_JET_DIR=Rans/Impinging_Jet_2d_Distant_Re_23000 MULTDOM_BACKSTEP_DIR=Laminar/Copy_Inlet +MULTDOM_HEAT_EXCHANGER_2_DIR=Laminar/Heat_Exchanger/2_Domains MULTDOM_MEMBRANE_DIR=Rans/Membrane ELBOW_ASCII_DIR=Functionality/Meshes/Ansys/Elbow_Ascii @@ -106,45 +105,9 @@ LES_RB_109_DIR=Les/Rayleigh_Benard_Convection_Ra_10e09 HYB_CHANNEL_HR_STRETCHED_DIR=Hybrid_Les_Rans/Channel_Re_Tau_2000/Stretched_Mesh HYB_CHANNEL_HR_UNIFORM_DIR=Hybrid_Les_Rans/Channel_Re_Tau_2000/Uniform_Mesh -# Add compressed meshes for these: -# MULTDOM_SINGLE_ROD_DIR=Rans/Single_Rod -# MULTDOM_COPY_INLET_DIR=Laminar/Copy_Inlet -# MULTDOM_HEAT_EXCHANGER_2_DIR=Laminar/Heat_Exchanger/2_Domains +# Not used (yet ... if ever): # MULTDOM_HEAT_EXCHANGER_3_DIR=Laminar/Heat_Exchanger/3_Domains -#---------------------------------------------------------------------------- -# All compilation tests including those with User_Mod/ -# (These are essentially most tests, but maybe not all of them -# have the User_Mod directory, so there is some redundancy here) -#---------------------------------------------------------------------------- -ALL_COMPILE_TESTS=( \ - "$LAMINAR_CAVITY_THERM_DRIVEN_106_DIR" \ - "$LAMINAR_CAVITY_THERM_DRIVEN_108_DIR" \ - "$LAMINAR_T_JUNCTION_DIR" \ - "$LAMINAR_CHANNEL_DIR" \ - "$RANS_BACKSTEP_05100_DIR" \ - "$RANS_BACKSTEP_28000_DIR" \ - "$RANS_CHANNEL_LR_LONG_DIR" \ - "$RANS_CHANNEL_LR_RSM_DIR" \ - "$RANS_CHANNEL_LR_STRETCHED_DIR" \ - "$RANS_CHANNEL_LR_UNIFORM_DIR" \ - "$RANS_FUEL_BUNDLE_DIR" \ - "$RANS_IMPINGING_JET_DIR" \ - "$MULTDOM_BACKSTEP_DIR" \ - "$MULTDOM_MEMBRANE_DIR" \ - "$SWARM_PERIODIC_CYL_DIR" \ - "$SWARM_ROD_BUNDLE_POLYHEDRAL_DIR" \ - "$VOF_RISING_BUBBLE_DIR" \ - "$SWARM_VOF_THREE_PHASE_DIR" \ - "$LES_CHANNEL_180_LONG_DIR" \ - "$LES_CHANNEL_180_PERIODIC_DIR" \ - "$LES_PIPE_DIR" \ - "$LES_RB_109_DIR" \ - "$HYB_CHANNEL_HR_UNIFORM_DIR" \ - "$HYB_CHANNEL_HR_STRETCHED_DIR" \ - ) -DONE_COMPILE_TESTS=0 - #-------------------------------------------------------------- # All directories to test Generate # (All the tests minus those which come with third party grid) @@ -185,6 +148,7 @@ ALL_CONVERT_TESTS=( \ "$LAMINAR_CONVECTIVE_DIR" \ "$RANS_FUEL_BUNDLE_DIR" \ "$RANS_IMPINGING_JET_DIR" \ + "$MULTDOM_HEAT_EXCHANGER_2_DIR" \ "$MULTDOM_MEMBRANE_DIR" \ "$SWARM_PERIODIC_CYL_DIR" \ "$SWARM_ROD_BUNDLE_POLYHEDRAL_DIR" \ @@ -218,6 +182,7 @@ ALL_DIVIDE_TESTS=( \ "$RANS_FUEL_BUNDLE_DIR" \ "$RANS_IMPINGING_JET_DIR" \ "$MULTDOM_BACKSTEP_DIR" \ + "$MULTDOM_HEAT_EXCHANGER_2_DIR" \ "$MULTDOM_MEMBRANE_DIR" \ "$SWARM_PERIODIC_CYL_DIR" \ "$SWARM_ROD_BUNDLE_POLYHEDRAL_DIR" \ @@ -256,6 +221,7 @@ ALL_PROCESS_TESTS=( \ "$RANS_CHANNEL_LR_RSM_DIR" \ "$RANS_IMPINGING_JET_DIR" \ "$MULTDOM_BACKSTEP_DIR" \ + "$MULTDOM_HEAT_EXCHANGER_2_DIR" \ "$SWARM_PERIODIC_CYL_DIR" \ "$SWARM_ROD_BUNDLE_POLYHEDRAL_DIR" \ "$VOF_DAM_BREAK_2D_DIR" \ @@ -287,6 +253,7 @@ ALL_TURBULENCE_MODELS=( \ "none" \ "none" \ "none" \ + "none" \ "les_dynamic" \ "hybrid_les_rans" \ "hybrid_les_rans" \ @@ -310,6 +277,7 @@ ALL_INTERFACE_TRACKING=( \ "no" \ "no" \ "no" \ + "no" \ "yes" \ "yes" \ "yes" \ @@ -334,6 +302,7 @@ ALL_PARTICLE_TRACKING=( \ "no" \ "no" \ "no" \ + "no" \ "yes" \ "yes" \ "no" \ @@ -437,21 +406,19 @@ function user_compile { git checkout User_Mod/*.f90 >> $FULL_LOG 2>&1 if [ -z "${3+xxx}" ]; then - elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG OPENMP=$OPENMP MPI=$2" + elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG MPI=$2" make \ FORTRAN=$FORTRAN \ FCOMP=$FCOMP \ DEBUG=$DEBUG \ - OPENMP=$OPENMP \ MPI=$2 >> $FULL_LOG 2>&1 success=$? else - elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG OPENMP=$OPENMP MPI=$2 DIR_CASE=$3" + elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG MPI=$2 DIR_CASE=$3" make \ FORTRAN=$FORTRAN \ FCOMP=$FCOMP \ DEBUG=$DEBUG \ - OPENMP=$OPENMP \ MPI=$2 \ DIR_CASE=$3 >> $FULL_LOG 2>&1 success=$? @@ -489,21 +456,19 @@ function clean_compile { make clean >> $FULL_LOG 2>&1 if [ -z "${3+xxx}" ]; then - elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG OPENMP=$OPENMP MPI=$2" + elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG MPI=$2" make \ FORTRAN=$FORTRAN \ FCOMP=$FCOMP \ DEBUG=$DEBUG \ - OPENMP=$OPENMP \ MPI=$2 >> $FULL_LOG 2>&1 success=$? else - elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG OPENMP=$OPENMP MPI=$2 DIR_CASE=$3" + elog "make FORTRAN=$FORTRAN FCOMP=$FCOMP DEBUG=$DEBUG MPI=$2 DIR_CASE=$3" make \ FORTRAN=$FORTRAN \ FCOMP=$FCOMP \ DEBUG=$DEBUG \ - OPENMP=$OPENMP \ MPI=$2 \ DIR_CASE=$3 >> $FULL_LOG 2>&1 success=$? @@ -865,8 +830,8 @@ function process_backup_test { nproc_in_div=$(head -n2 divide.1.scr | tail -n1) # BEGIN:---------------------------------------# - elog "np=1, MPI=no, start from 0, make a backup" - user_compile $PROC_DIR no # dir MPI + elog "np=1, MPI=yes, start from 0, make a backup" + user_compile $PROC_DIR yes # dir MPI for (( i=1; i<=$n_dom; i++ )); do name_in_div=$(head -n1 divide."$i".scr) @@ -895,7 +860,7 @@ function process_backup_test { # BEGIN:---------------------------------------------# - elog "np=1, MPI=no, load from backup(produced by seq)" + elog "np=1, MPI=yes, load from backup(produced by seq)" for (( i=1; i<=$n_dom; i++ )); do name_in_div=$(head -n1 divide."$i".scr) @@ -976,7 +941,7 @@ function process_backup_test { # BEGIN:------------------------------------------# elog "np=1, MPI=yes, backup=(produced by par.np=2)" - user_compile $PROC_DIR no # dir MPI + user_compile $PROC_DIR yes # dir MPI launch_process par 1 #--------------------------------------------:END # @@ -1126,8 +1091,8 @@ function process_save_exit_now_test { nproc_in_div=$(head -n2 divide.1.scr | tail -n1) # BEGIN:---------------------------------------# - elog "np=1, MPI=no, start from 0, make a backup" - user_compile $PROC_DIR no # dir MPI + elog "np=1, MPI=yes, start from 0, make a backup" + user_compile $PROC_DIR yes # dir MPI for (( i=1; i<=$n_dom; i++ )); do name_in_div=$(head -n1 divide."$i".scr) @@ -1149,7 +1114,7 @@ function process_save_exit_now_test { elog "" elog "#====================================================================" if [ "$i" = 1 ]; then - elog "# Test np=1, MPI=no" + elog "# Test np=1, MPI=yes" fi if [ "$i" = 2 ]; then elog "# Test np=1, MPI=yes" @@ -1160,7 +1125,7 @@ function process_save_exit_now_test { elog "#--------------------------------------------------------------------" # BEGIN:---------------------------------------------# - elog "np=1, MPI=no, load from backup(produced by seq)" + elog "np=1, MPI=yes, load from backup(produced by seq)" for (( i=1; i<=$n_dom; i++ )); do name_in_div=$(head -n1 divide."$i".scr) @@ -1176,7 +1141,7 @@ function process_save_exit_now_test { #-----------------------------------------------:END # if [ "$i" = 1 ]; then - user_compile $PROC_DIR no + user_compile $PROC_DIR yes elif [ "$i" = 2 ]; then user_compile $PROC_DIR yes elif [ "$i" = 3 ]; then @@ -1313,6 +1278,7 @@ function launch_matplotlib { fi time_in_seconds } + #------------------------------------------------------------------------------# # Individual process tests for compilation #------------------------------------------------------------------------------# @@ -1369,25 +1335,6 @@ function process_compilation_test { fi } -#------------------------------------------------------------------------------# -# All process compilation tests -#------------------------------------------------------------------------------# -function process_compilation_tests { - # $1 = dir with test - - elog "" - elog "#======================================================================" - elog "#" - elog "# Running Processor compilation tests" - elog "#" - elog "#----------------------------------------------------------------------" - echo "# Running Processor compilation tests" - - for CASE_DIR in ${ALL_COMPILE_TESTS[@]}; do - process_compilation_test $CASE_DIR - done -} - #------------------------------------------------------------------------------# # Individual process tests for full length #------------------------------------------------------------------------------# @@ -1675,67 +1622,87 @@ function chose_test { option=$1 if [ $option -eq 0 ]; then exit 1; fi + + # 1. Generate tests" if [ $option -eq 1 ]; then generate_tests fi + + # 2. Convert tests" if [ $option -eq 2 ]; then convert_tests fi + + # 3. Divide tests" if [ $option -eq 3 ]; then if [ $DONE_GENERATE_TESTS -eq 0 ]; then generate_tests; fi if [ $DONE_CONVERT_TESTS -eq 0 ]; then convert_tests; fi divide_tests fi - if [ $option -eq 4 ]; then process_compilation_tests; fi - if [ $option -eq 5 ]; then + + # 4. Processor backup tests" + if [ $option -eq 4 ]; then if [ $DONE_GENERATE_TESTS -eq 0 ]; then generate_tests; fi if [ $DONE_CONVERT_TESTS -eq 0 ]; then convert_tests; fi if [ $DONE_DIVIDE_TESTS -eq 0 ]; then divide_tests; fi process_backup_tests fi - if [ $option -eq 6 ]; then + + # 5. Processor save_now/exit_now tests" + if [ $option -eq 5 ]; then if [ $DONE_GENERATE_TESTS -eq 0 ]; then generate_tests; fi if [ $DONE_CONVERT_TESTS -eq 0 ]; then convert_tests; fi if [ $DONE_DIVIDE_TESTS -eq 0 ]; then divide_tests; fi process_save_exit_now_tests fi - if [ $option -eq 7 ]; then + + # 6. Processor full lenght tests" + if [ $option -eq 6 ]; then if [ $DONE_GENERATE_TESTS -eq 0 ]; then generate_tests; fi if [ $DONE_CONVERT_TESTS -eq 0 ]; then convert_tests; fi if [ $DONE_DIVIDE_TESTS -eq 0 ]; then divide_tests; fi process_full_length_tests fi - if [ $option -eq 8 ]; then + + # 7. Process accuracy test" + if [ $option -eq 7 ]; then process_accuracy_tests fi - if [ $option -eq 9 ]; then + + # 8. Perform all tests" + if [ $option -eq 8 ]; then generate_tests convert_tests divide_tests - process_compilation_tests process_backup_tests process_save_exit_now_tests process_full_length_tests process_accuracy_tests fi - if [ $option -eq 10 ]; then + + # 9. Clean all test directories" + if [ $option -eq 9 ]; then git clean -dfx $TEST_DIR/.. make_clean $GENE_DIR make_clean $CONV_DIR make_clean $DIVI_DIR make_clean $PROC_DIR fi - if [ $option -eq 11 ]; then + + # 10. Change the compiler" + if [ $option -eq 10 ]; then if [ $FORTRAN == "gnu" ]; then FORTRAN="intel" FCOMP="mpiifort" DEBUG="no" - OPENMP="yes" elif [ $FORTRAN == "intel" ]; then + FORTRAN="nvidia" + FCOMP="" + DEBUG="no" + elif [ $FORTRAN == "nvidia" ]; then FORTRAN="gnu" FCOMP="" DEBUG="no" - OPENMP="yes" fi fi @@ -1786,6 +1753,14 @@ else echo "# compiler. In that case, purge the Intel environment." echo "# to get rid of the Python from Intel compiler." fi + if [ $FORTRAN == "nvidia" ]; then + echo "# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" + echo "# Remark: When using Nvidia Fortran, please make sure that you are" + echo "# using version 4 of the OpenMPI library." + echo "#" + echo "# For most installations, you should adjust the link mpi in" + echo "# directory /opt/nvidia/hpc_sdk/Linux_x86_64/23.1/comm_libs" + fi echo "#--------------------------------------------------------------------" echo "" echo " Chose the type of test you want to perform:" @@ -1794,14 +1769,13 @@ else echo " 1. Generate tests" echo " 2. Convert tests" echo " 3. Divide tests" - echo " 4. Processor compilation tests with User_Mod" - echo " 5. Processor backup tests" - echo " 6. Processor save_now/exit_now tests" - echo " 7. Processor full lenght tests" - echo " 8. Process accuracy test" - echo " 9. Perform all tests" - echo " 10. Clean all test directories" - echo " 11. Change the compiler" + echo " 4. Processor backup tests" + echo " 5. Processor save_now/exit_now tests" + echo " 6. Processor full lenght tests" + echo " 7. Process accuracy test" + echo " 8. Perform all tests" + echo " 9. Clean all test directories" + echo " 10. Change the compiler" echo "" read -p " Enter the desired type of test: " option chose_test $option diff --git a/Tests/test_user_functions_compile.sh b/Tests/test_user_functions_compile.sh index fa7d8f11e..cb5b579f9 100755 --- a/Tests/test_user_functions_compile.sh +++ b/Tests/test_user_functions_compile.sh @@ -4,19 +4,28 @@ echo "#!/bin/bash" > worker.sh echo "" >> worker.sh echo "cd ../Sources/Process" >> worker.sh +echo "" >> worker.sh +echo "make clean" >> worker.sh +echo "" >> worker.sh +echo "old_directory=$PWD" >> worker.sh +echo "" >> worker.sh # Find all directories with user function and append commands # for their compilation to the beginning of the test script find . -name "User_Mod" \ -| sed 's/\.\//make clean; make DIR_CASE=..\/..\/Tests\//g' \ +| sed 's/\.\//rm -f ..\/..\/Binaries\/Process; rm -fR User_Mod; git checkout User_Mod; make OMP=yes DIR_CASE=..\/..\/Tests\//g' \ | sed 's/\/User_Mod/\nif \[ -f ..\/..\/Binaries\/Process \]; then echo "SUCCESS"; else echo "FAILURE"; fi/g' \ >> worker.sh -echo "make clean" >> worker.sh +echo "make clean" >> worker.sh +echo "" >> worker.sh +echo "cd $old_directory" >> worker.sh # Make the test script executable chmod 755 worker.sh source ./worker.sh > test_user_functions_compile.$(date +%y-%m-%d-%T).log +cd $old_directory + /bin/rm worker.sh