Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_RansEmsInit.F90
Go to the documentation of this file.
1 ! *********************************************************************
2 ! * Rocstar Simulation Suite *
3 ! * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4 ! * *
5 ! * Illinois Rocstar LLC *
6 ! * Champaign, IL *
7 ! * www.illinoisrocstar.com *
8 ! * sales@illinoisrocstar.com *
9 ! * *
10 ! * License: See LICENSE file in top level of distribution package or *
11 ! * http://opensource.org/licenses/NCSA *
12 ! *********************************************************************
13 ! *********************************************************************
14 ! * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15 ! * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16 ! * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17 ! * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18 ! * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19 ! * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20 ! * Arising FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21 ! * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22 ! *********************************************************************
23 !******************************************************************************
24 !
25 ! Purpose: set initial solution field to turbulence transport equations,
26 ! if any (selected model is of RaNS class), for first EMS stage,
27 ! and initiate dissipation at stages > 1.
28 !
29 ! Description: none.
30 !
31 ! Input: region = data of current region,
32 ! iStage = current EMS stage.
33 !
34 ! Output: region%levels%turb = initial values
35 !
36 ! Notes: none.
37 !
38 !******************************************************************************
39 !
40 ! $Id: TURB_RansEmsInit.F90,v 1.6 2008/12/06 08:44:42 mtcampbe Exp $
41 !
42 ! Copyright: (c) 2003 by the University of Illinois
43 !
44 !******************************************************************************
45 
46 SUBROUTINE turb_ransemsinit( region, istage )
47 
48  USE moddatatypes
49  USE moddatastruct, ONLY : t_region
50  USE modglobal, ONLY : t_global
51  USE moderror
52  USE modmpi
53  USE modparameters
55 #ifdef RFLO
57 
58 #include "Indexing.h"
59 #endif
60 
61  IMPLICIT NONE
62 
63 ! ... parameters
64  TYPE(t_region) :: region
65 
66  INTEGER, INTENT(IN) :: istage
67 
68 ! ... loop variables
69  INTEGER :: ic, idx
70 
71 ! ... local variables
72  TYPE(t_global), POINTER :: global
73 
74  INTEGER :: ibc, iec, idxbeg, idxend, ldiss(5)
75  REAL(RFREAL) :: blend1, betrk(5)
76  REAL(RFREAL), POINTER :: tcv(:,:), tcvold(:,:), tdiss(:,:)
77 
78 #ifdef RFLO
79  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
80  INTEGER :: ilev, icoff, ijcoff
81 #endif
82 
83 !******************************************************************************
84 
85  global => region%global
86 
87  CALL registerfunction( global,'TURB_RansEmsInit',&
88  'TURB_RansEmsInit.F90' )
89 
90 ! get parameters, dimensions and pointers -------------------------------------
91 
92  ldiss(:) = region%mixtInput%ldiss(:)
93  betrk(:) = region%mixtInput%betrk(:)
94 
95 #ifdef RFLO
96  ilev = region%currLevel
97 
98  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend, &
99  jdcbeg,jdcend,kdcbeg,kdcend )
100  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
101  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icoff,ijcoff)
102  iec = indijk(idcend,jdcend,kdcend,icoff,ijcoff)
103 
104  tcv => region%levels(ilev)%turb%cv
105  tcvold => region%levels(ilev)%turb%cvOld
106  tdiss => region%levels(ilev)%turb%diss
107 #endif
108 
109 #ifdef RFLU
110  ibc = 1
111  iec = region%grid%nCellsTot
112 
113  tcv => region%turb%cv
114  tcvold => region%turb%cvOld
115  tdiss => region%turb%diss
116 #endif
117 
118 ! select start and end index of 1st dimension depending on RaNS model selected
119 
120  IF ((region%mixtInput%turbModel == turb_model_sa) .OR. &
121  (region%mixtInput%turbModel == turb_model_dessa) .OR. &
122  (region%mixtInput%turbModel == turb_model_hdessa)) THEN
123  idxbeg = cv_sa_nutil
124  idxend = cv_sa_nutil
125  ENDIF
126 
127 ! store previous solution and initialize dissipation --------------------------
128 
129  IF (istage == 1) THEN
130  DO ic=ibc,iec
131  DO idx=idxbeg, idxend
132  tcvold(idx,ic) = tcv(idx,ic)
133  tdiss(idx,ic) = 0._rfreal
134  ENDDO
135  ENDDO
136  ENDIF
137  IF (istage>1 .AND. ldiss(istage)/=0) THEN
138  blend1 = 1._rfreal - betrk(istage)
139  DO ic=ibc,iec
140  DO idx=idxbeg, idxend
141  tdiss(idx,ic) = blend1*tdiss(idx,ic)
142  ENDDO
143  ENDDO
144  ENDIF ! iStage
145 
146 ! finalize --------------------------------------------------------------------
147 
148  CALL deregisterfunction( global )
149 
150 END SUBROUTINE turb_ransemsinit
151 
152 !******************************************************************************
153 !
154 ! RCS Revision history:
155 !
156 ! $Log: TURB_RansEmsInit.F90,v $
157 ! Revision 1.6 2008/12/06 08:44:42 mtcampbe
158 ! Updated license.
159 !
160 ! Revision 1.5 2008/11/19 22:17:54 mtcampbe
161 ! Added Illinois Open Source License/Copyright
162 !
163 ! Revision 1.4 2005/03/09 06:35:40 wasistho
164 ! incorporated HDESSA
165 !
166 ! Revision 1.3 2004/07/03 02:04:39 wasistho
167 ! delete ! PUBLIC
168 !
169 ! Revision 1.2 2004/03/20 00:29:17 wasistho
170 ! set turb_rflo_ransNumericalDiss to turb_ransNumerical..
171 !
172 ! Revision 1.1 2004/03/05 04:37:00 wasistho
173 ! changed nomenclature
174 !
175 ! Revision 1.3 2004/02/26 21:24:33 wasistho
176 ! make it private to rocturb, delete GOTO..
177 !
178 ! Revision 1.2 2003/10/20 00:36:34 wasistho
179 ! fixed subroutine name in register function
180 !
181 ! Revision 1.1 2003/10/16 20:20:03 wasistho
182 ! installed RaNS in steady state flow (Exp.Mult.Stg)
183 !
184 !
185 !******************************************************************************
186 
187 
188 
189 
190 
191 
192 
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcend
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE ic
subroutine turb_ransemsinit(region, istage)
subroutine rflo_getdimensdummy(region, iLev, idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE kdcbeg
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE idcbeg
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcend
**********************************************************************Rocstar Simulation Suite Illinois Rocstar LLC All rights reserved ****Illinois Rocstar LLC IL **www illinoisrocstar com **sales illinoisrocstar com WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **Arising OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE **********************************************************************INTERFACE SUBROUTINE jdcbeg
subroutine deregisterfunction(global)
Definition: ModError.F90:469