6
! This file is part of the Code_Saturne Kernel, element of the
7
! Code_Saturne CFD tool.
9
! Copyright (C) 1998-2009 EDF S.A., France
11
! contact: saturne-support@edf.fr
13
! The Code_Saturne Kernel is free software; you can redistribute it
14
! and/or modify it under the terms of the GNU General Public License
15
! as published by the Free Software Foundation; either version 2 of
16
! the License, or (at your option) any later version.
18
! The Code_Saturne Kernel is distributed in the hope that it will be
19
! useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20
! of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
! GNU General Public License for more details.
23
! You should have received a copy of the GNU General Public License
24
! along with the Code_Saturne Kernel; if not, write to the
25
! Free Software Foundation, Inc.,
26
! 51 Franklin St, Fifth Floor,
27
! Boston, MA 02110-1301 USA
5
! This file is part of Code_Saturne, a general-purpose CFD tool.
7
! Copyright (C) 1998-2011 EDF S.A.
9
! This program is free software; you can redistribute it and/or modify it under
10
! the terms of the GNU General Public License as published by the Free Software
11
! Foundation; either version 2 of the License, or (at your option) any later
14
! This program is distributed in the hope that it will be useful, but WITHOUT
15
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19
! You should have received a copy of the GNU General Public License along with
20
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
21
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
23
!-------------------------------------------------------------------------------
71
66
!__________________.____._____.________________________________________________.
72
67
! name !type!mode ! role !
73
68
!__________________!____!_____!________________________________________________!
74
! nphmax ! i ! <-- ! maximum number of phases !
75
! nphas ! i ! <-- ! number of active phases !
76
69
! iihmpu ! i ! <-- ! indicates if the XML file from the GUI is !
77
70
! ! ! ! used (1: yes, 0: no) !
78
71
! nfecra ! i ! <-- ! Fortran unit number for standard output !
79
! iturb(nphmax) ! ia ! <-> ! turbulence model !
80
! icp(nphmax) ! ia ! <-> ! flag for uniform Cp or not !
72
! iturb ! ia ! <-> ! turbulence model !
73
! icp ! ia ! <-> ! flag for uniform Cp or not !
81
74
! iverif ! i ! <-- ! flag for elementary tests !
82
75
!__________________!____!_____!________________________________________________!
86
79
! mode: <-- input, --> output, <-> modifies data, --- work array
87
80
!===============================================================================
82
!===============================================================================
84
!===============================================================================
86
! No module should appear here
89
!===============================================================================
91
!===============================================================================
93
!===============================================================================
96
! No common should appear here
99
!===============================================================================
103
integer nphmax, nphas, iihmpu, nfecra
104
integer iturb(nphmax), icp(nphmax)
95
integer iihmpu, nfecra
111
101
!===============================================================================
113
103
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
413
402
! mode: <-- input, --> output, <-> modifies data, --- work array
414
403
!===============================================================================
405
!===============================================================================
407
!===============================================================================
410
! No module should appear here
413
!===============================================================================
418
!===============================================================================
420
!===============================================================================
423
! No common should appear here
426
!===============================================================================
430
419
integer nscmax, nscaus, iihmpu, nfecra
632
622
! mode: <-- input, --> output, <-> modifies data, --- work array
633
623
!===============================================================================
625
!===============================================================================
627
!===============================================================================
630
! No module should appear here
633
!===============================================================================
637
!===============================================================================
639
!===============================================================================
642
! No common should appear here
645
!===============================================================================
649
integer nphmax, nesmax
650
640
integer iespre, iesder, iescor, iestot
651
integer nphas , iihmpu, nfecra
652
integer idtvar, ipucou, iphydr
653
integer iescal(nesmax,nphmax)
641
integer iihmpu, nfecra
642
integer idtvar, ipucou, iphydr, ialgce
643
integer iescal(nesmax)
644
integer iverif, icwfps
646
double precision cwfthr
656
648
! Local variables
658
integer iphas, ialgce
660
650
!===============================================================================
662
652
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
968
970
! On the other hand, if specific physics are NOT activated:
970
! If a USER scalar represents the temperature or enthalpy (of phase iphas):
971
! we define the number of this scalar in iscalt(iphas) and
972
! we set iscsth(iscalt(iphas)) = 1 if it is the temperature
973
! or iscsth(iscalt(iphas)) = 2 if it is the enthalpy.
972
! If a USER scalar represents the temperature or enthalpy:
973
! we define the number of this scalar in iscalt and
974
! we set iscsth(iscalt) = 1 if it is the temperature
975
! or iscsth(iscalt) = 2 if it is the enthalpy.
975
! If no scalar represents the temperature or enthalpy (of phase iphas)
976
! we set iscalt(iphas) = -1
977
! and we do not define iscsth(iscalt(iphas)).
977
! If no scalar represents the temperature or enthalpy
979
! and we do not define iscsth(iscalt).
980
982
! For the radiative module when used without specific physics, if we
981
983
! have chosen to solve in temperature (that is if
982
! iscsth(iscalt(iphas)) = 1), the fluid temperature is considered to
984
! iscsth(iscalt) = 1), the fluid temperature is considered to
983
985
! be in degrees KELVIN (be careful for boundary conditions an expression
984
986
! of physical properties depending on temperature).
985
987
! Nonetheless, even though it is not recommended, if we wish for the
986
988
! fluid solver to work with a temperature in degrees Celsius, we must set
987
! iscsth(iscalt(iphas)) = -1.
989
! iscsth(iscalt) = -1.
988
990
! This choice is a source of user errors. Indeed, the boundary conditions
989
991
! for the fluid temperature will then be in degrees Celsius, while the
990
992
! boundary conditions for radiation in usray2 must still be in Kelvin.
1136
1137
! For difficult cases, a stabilization may be obtained by not
1137
1138
! reconstructing the convective and diffusive flux for variables
1138
1139
! of the turbulence model, that is
1139
! in k-epsilon: if (itytur(iphas).eq.2) then
1140
! ircflu(ik(iphas)) = 0 and ircflu(iep(iphas)) = 0
1141
! in Rij-epsilon: if (itytur(iphas).eq.3) then
1142
! ircflu(ir11(iphas)) = 0, ircflu(ir22(iphas)) = 0,
1143
! ircflu(ir33(iphas)) = 0,
1144
! ircflu(ir12(iphas)) = 0, ircflu(ir23(iphas)) = 0,
1145
! ircflu(ir23(iphas)) = 0,
1146
! and ircflu(iep(iphas)) = 0
1140
! in k-epsilon: if (itytur.eq.2) then
1141
! ircflu(ik) = 0 and ircflu(iep) = 0
1142
! in Rij-epsilon: if (itytur.eq.3) then
1143
! ircflu(ir11) = 0, ircflu(ir22) = 0,
1145
! ircflu(ir12) = 0, ircflu(ir23) = 0,
1147
! and ircflu(iep) = 0
1147
1148
! (note that variable itytur is equal to iturb/10)
1149
1150
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
1665
1655
if (iutile.eq.1) then
1669
1657
do ii = 1, nvar
1673
iwarni(ipr(iphas)) = 2
1674
iwarni(iu(iphas)) = 2
1675
iwarni(iv(iphas)) = 2
1676
iwarni(iw(iphas)) = 2
1680
1668
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
1682
! --- post-processing output
1684
! ichrvl: post-processing of the fluid domain (yes 1/no 0)
1685
! ichrbo: post-processing of the domain boundary (yes 1/no 0)
1686
! ichrsy: post-processing of zones coupled with SYRTHES (yes 1/ no 0)
1687
! ichrmd: indicates if the meshes output are:
1689
! 1: deformable with constant connectivity,
1690
! 2: modifyable (may be completely redefined during the
1691
! calculation using the usmpst subroutine).
1692
! 10: as indmod = 0, with a displacement field
1693
! 11: as indmod = 1, with a displacement field
1694
! 11: as indmod = 2, with a displacement field
1696
! fmtchr: output format, amid
1697
! 'EnSight Gold', 'MED', or 'CGNS'
1698
! optchr: options associated with the output format, separated by
1699
! commas, from the following list:
1700
! 'text' (text format, for EnSight)
1701
! 'binary' (binary format, default choice)
1702
! 'big_endian' (forces binary EnSight output to
1703
! 'big-endian' mode)
1704
! 'discard_polygons' (ignore polygon-type faces)
1705
! 'discard_polyhedra' (ignore polyhedron-type cells)
1706
! 'divide_polygons' (subdivides polygon-type faces)
1707
! 'divide_polyhedra' (subdivides polyhedron-type cells)
1708
! 'split_tensors' (writes tensors as separate scalars)
1710
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
1718
fmtchr = 'EnSight Gold'
1721
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
1724
! --- chronological output step
1725
! (-1: only one valua at calculation end)
1726
! (strictly positive valeu: output periodicity)
1728
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
1732
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
1735
1670
! --- history output step
1737
1672
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
1741
1677
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
1830
1765
nomvar(ipp) = 'Rel VelocityZ'
1833
if (itytur(iphas).eq.2) then
1768
if (itytur.eq.2) then
1835
1770
! turbulent kinetic energy
1836
ipp = ipprtp(ik (iphas))
1837
1772
nomvar(ipp) = 'Turb Kinetic Energy'
1838
1773
ichrvr(ipp) = 1
1839
1774
ilisvr(ipp) = 1
1840
1775
ihisvr(ipp,1) = -1
1842
1777
! turbulent dissipation
1843
ipp = ipprtp(iep (iphas))
1844
1779
nomvar(ipp) = 'Turb Dissipation'
1845
1780
ichrvr(ipp) = 1
1846
1781
ilisvr(ipp) = 1
1847
1782
ihisvr(ipp,1) = -1
1849
elseif (itytur(iphas).eq.3) then
1784
elseif (itytur.eq.3) then
1851
1786
! Reynolds stresses
1852
ipp = ipprtp(ir11 (iphas))
1853
1788
nomvar(ipp) = 'R11'
1854
1789
ichrvr(ipp) = 1
1855
1790
ilisvr(ipp) = 1
1856
1791
ihisvr(ipp,1) = -1
1858
1793
! Reynolds stresses
1859
ipp = ipprtp(ir22 (iphas))
1860
1795
nomvar(ipp) = 'R22'
1861
1796
ichrvr(ipp) = 1
1862
1797
ilisvr(ipp) = 1
1863
1798
ihisvr(ipp,1) = -1
1865
1800
! Reynolds stresses
1866
ipp = ipprtp(ir33 (iphas))
1867
1802
nomvar(ipp) = 'R33'
1868
1803
ichrvr(ipp) = 1
1869
1804
ilisvr(ipp) = 1
1870
1805
ihisvr(ipp,1) = -1
1872
1807
! Reynolds stresses
1873
ipp = ipprtp(ir12 (iphas))
1874
1809
nomvar(ipp) = 'R12'
1875
1810
ichrvr(ipp) = 1
1876
1811
ilisvr(ipp) = 1
1877
1812
ihisvr(ipp,1) = -1
1879
1814
! Reynolds stresses
1880
ipp = ipprtp(ir13 (iphas))
1881
1816
nomvar(ipp) = 'R13'
1882
1817
ichrvr(ipp) = 1
1883
1818
ilisvr(ipp) = 1
1884
1819
ihisvr(ipp,1) = -1
1886
1821
! Reynolds stresses
1887
ipp = ipprtp(ir23 (iphas))
1888
1823
nomvar(ipp) = 'R23'
1889
1824
ichrvr(ipp) = 1
1890
1825
ilisvr(ipp) = 1
1891
1826
ihisvr(ipp,1) = -1
1893
1828
! turbulent dissipation
1894
ipp = ipprtp(iep (iphas))
1895
1830
nomvar(ipp) = 'Turb Dissipation'
1896
1831
ichrvr(ipp) = 1
1897
1832
ilisvr(ipp) = 1
1898
1833
ihisvr(ipp,1) = -1
1900
elseif (iturb(iphas).eq.50) then
1835
elseif (iturb.eq.50) then
1902
1837
! turbulent kinetic energy
1903
ipp = ipprtp(ik (iphas))
1904
1839
nomvar(ipp) = 'Turb Kinetic Energy'
1905
1840
ichrvr(ipp) = 1
1906
1841
ilisvr(ipp) = 1
1907
1842
ihisvr(ipp,1) = -1
1909
1844
! turbulent dissipation
1910
ipp = ipprtp(iep (iphas))
1911
1846
nomvar(ipp) = 'Turb Dissipation'
1912
1847
ichrvr(ipp) = 1
1913
1848
ilisvr(ipp) = 1
1914
1849
ihisvr(ipp,1) = -1
1917
ipp = ipprtp(iphi (iphas))
1918
1853
nomvar(ipp) = 'Phi'
1919
1854
ichrvr(ipp) = 1
1920
1855
ilisvr(ipp) = 1
1921
1856
ihisvr(ipp,1) = -1
1924
ipp = ipprtp(ifb (iphas))
1925
1860
nomvar(ipp) = 'f_bar'
1926
1861
ichrvr(ipp) = 1
1927
1862
ilisvr(ipp) = 1
1928
1863
ihisvr(ipp,1) = -1
1930
elseif (iturb(iphas).eq.60) then
1932
! turbulent kinetic energy
1933
ipp = ipprtp(ik (iphas))
1865
elseif (iturb.eq.51) then
1867
! turbulent kinetic energy
1869
nomvar(ipp) = 'Turb Kinetic Energy'
1874
! turbulent dissipation
1876
nomvar(ipp) = 'Turb Dissipation'
1890
nomvar(ipp) = 'Alpha'
1895
elseif (iturb.eq.60) then
1897
! turbulent kinetic energy
1934
1899
nomvar(ipp) = 'Turb Kinetic Energy'
1935
1900
ichrvr(ipp) = 1
1936
1901
ilisvr(ipp) = 1
1937
1902
ihisvr(ipp,1) = -1
1940
ipp = ipprtp(iomg (iphas))
1941
1906
nomvar(ipp) = 'Omega'
1942
1907
ichrvr(ipp) = 1
1943
1908
ilisvr(ipp) = 1
1944
1909
ihisvr(ipp,1) = -1
1911
elseif (iturb.eq.70) then
1913
! Spalart-Allmaras variable (viscosity-like)
1914
ipp = ipprtp(inusa )
1915
nomvar(ipp) = 'NuTilda'
1948
1922
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
2099
!===============================================================================
2105
( ncel , ncelet , nfac , nfabor , nnod , &
2107
nideve , nituse , nrdeve , nrtuse )
2109
!===============================================================================
2113
! User subroutine to define the sizes of macro-arrays ia and ra,
2114
! of user arrays ituser and rtuser,
2115
! of developper arrays idevel and rdevel.
2117
!-------------------------------------------------------------------------------
2119
!__________________.____._____.________________________________________________.
2120
! name !type!mode ! role !
2121
!__________________!____!_____!________________________________________________!
2122
! ncel ! i ! <-- ! number of cells !
2123
! ncelet ! i ! <-- ! number of extended (real + ghost) cells !
2124
! nfac ! i ! <-- ! number of interior faces !
2125
! nfabor ! i ! <-- ! number of boundary faces !
2126
! nnod ! i ! <-- ! number of vertices !
2127
! longia ! i ! --> ! size of array ia !
2128
! longra ! i ! --> ! size of array ra !
2129
! nideve ! i ! --> ! size of array idevel !
2130
! nituse ! i ! --> ! size of array ituser !
2131
! nrdeve ! i ! --> ! size of array rdevel !
2132
! nrtuse ! i ! --> ! size of array rtuser !
2133
!__________________!____!_____!________________________________________________!
2135
! Type: i (integer), r (real), s (string), a (array), l (logical),
2136
! and composite types (ex: ra real array)
2137
! mode: <-- input, --> output, <-> modifies data, --- work array
2138
!===============================================================================
2142
!===============================================================================
2144
!===============================================================================
2146
!===============================================================================
2150
integer ncel , ncelet, nfac , nfabor, nnod
2151
integer longia, longra
2152
integer nideve, nituse, nrdeve, nrtuse
2154
!===============================================================================
2156
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_START
2157
!===============================================================================
2158
! 0. This test allows the user to ensure that the version of this subroutine
2159
! used is that from his case definition, and not that from the library.
2160
! If a file from the GUI is used, this subroutine may not be mandatory,
2161
! thus the default (library reference) version returns immediately.
2165
!===============================================================================
2166
! TEST_TO_REMOVE_FOR_USE_OF_SUBROUTINE_END
2168
!===============================================================================
2169
! 1. Size of macro arrays ia and ra:
2171
! The user may need to modify the size of integer and real work
2172
! arrays here: longia and longra respectively.
2174
! The number of integers 'longia' and the number of reals 'longra' depend
2175
! on calculation options, on the element type and mesh characteristics
2176
! (2d, 3d, hybrid, non-conforming, ...) and on the number of variables.
2177
! In k-epsilon, if we note 'ncel' the local number of cells in the mesh,
2178
! we ay usually use the following coarse overestimation:
2179
! longia = 45*ncel and longra = 220*ncel. In Rij-epsilon, an additional
2180
! 20% may be applied.
2181
! These values are relatively high so as to account for 2D meshes which
2182
! have many boundary faces. A more precise but complex formula would be
2183
! necessary. For large 3D cases, a more precise estimation is given by:
2184
! longia = 25*ncel and longra = 120*ncel.
2186
! If longia and longra are left at 0, then these values are estimated
2187
! and set automatically.
2189
!===============================================================================
2191
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
2193
! Size of main integer work array 'ia'
2197
! Size of main real work array 'ra'
2201
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END
2203
!===============================================================================
2204
! 2. Size of macro arrays ituser and rtuser:
2205
!===============================================================================
2207
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_START
2209
! Size user-reserved integer array 'ituser'
2213
! Size user-reserved real array 'rtuser'
2217
! EXAMPLE_CODE_TO_BE_ADAPTED_BY_THE_USER_END