Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_RansConvectiveFluxes.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: compute convective fluxes for RaNS class turbulence model, depending
26 ! on model selected, and add them to dissipation in order to obtain
27 ! the residual.
28 !
29 ! Description: none.
30 !
31 ! Input: region = data of current region.
32 !
33 ! Output: region%levels%turb%rhs = turb convective fluxes + turb dissipation.
34 !
35 ! Notes: none.
36 !
37 !******************************************************************************
38 !
39 ! $Id: TURB_RansConvectiveFluxes.F90,v 1.6 2008/12/06 08:44:42 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2003 by the University of Illinois
42 !
43 !******************************************************************************
44 
45 SUBROUTINE turb_ransconvectivefluxes( region ) ! PUBLIC
46 
47  USE moddatatypes
48  USE moddatastruct, ONLY : t_region
49  USE moderror
50  USE modparameters
52 #ifdef RFLO
57 
58 #include "Indexing.h"
59 #endif
60  IMPLICIT NONE
61 
62 ! ... parameters
63  TYPE(t_region) :: region
64 
65 ! ... loop variables
66  INTEGER :: ic, idx
67 
68 ! ... local variables
69  INTEGER :: ibc, iec, discrtype, discrorder, turbmodel, idxbeg, idxend
70  REAL(RFREAL), POINTER :: tdiss(:,:), trhs(:,:)
71 
72 #ifdef RFLO
73  INTEGER :: idcbeg, idcend, jdcbeg, jdcend, kdcbeg, kdcend
74  INTEGER :: ilev, icoff, ijcoff
75 #endif
76 
77 !******************************************************************************
78 
79  CALL registerfunction( region%global,'TURB_RansConvectiveFluxes',&
80  'TURB_RansConvectiveFluxes.F90' )
81 
82  IF (region%turbInput%modelClass /= model_rans) goto 999
83 
84 ! get dimensions and pointers -------------------------------------------------
85 
86 #ifdef RFLO
87  ilev = region%currLevel
88 
89  CALL rflo_getdimensdummy( region,ilev,idcbeg,idcend,jdcbeg,jdcend, &
90  kdcbeg,kdcend )
91  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
92  ibc = indijk(idcbeg,jdcbeg,kdcbeg,icoff,ijcoff)
93  iec = indijk(idcend,jdcend,kdcend,icoff,ijcoff)
94 
95  tdiss => region%levels(ilev)%turb%diss
96  trhs => region%levels(ilev)%turb%rhs
97 #endif
98 #ifdef RFLU
99  ibc = 1
100  iec = region%grid%nCellsTot
101 
102  tdiss => region%turb%diss
103  trhs => region%turb%rhs
104 #endif
105 
106  turbmodel = region%mixtInput%turbModel
107  discrtype = region%turbInput%spaceDiscr
108  discrorder = region%turbInput%spaceOrder
109 
110 ! select start and end index of 1st dimension depending on RaNS model selected
111 
112  IF ((turbmodel == turb_model_sa) .OR. &
113  (turbmodel == turb_model_dessa) .OR. &
114  (turbmodel == turb_model_hdessa)) THEN
115  idxbeg = cv_sa_nutil
116  idxend = cv_sa_nutil
117  ENDIF
118 
119 ! initialize residual (set = dissipation) -------------------------------------
120 
121  DO ic=ibc,iec
122  DO idx=idxbeg,idxend
123  trhs(idx,ic) = -tdiss(idx,ic)
124  ENDDO
125  ENDDO
126 
127 ! 2nd-order central scheme ----------------------------------------------------
128 
129 #ifdef RFLO
130  IF ( discrtype ==rans_discr_cen) THEN
131  IF (turbmodel == turb_model_sa .OR. turbmodel == turb_model_dessa .OR. &
132  turbmodel == turb_model_hdessa) THEN
133  IF (discrorder==rans_discr_ord1 .OR. discrorder==rans_discr_ord2) THEN
134  CALL turb_floranssacentflux( region )
135  ENDIF
136  ENDIF
137  ENDIF
138 #endif
139 
140  IF (discrtype == rans_discr_upw) THEN
141  IF (turbmodel == turb_model_sa .OR. turbmodel == turb_model_dessa .OR. &
142  turbmodel == turb_model_hdessa) THEN
143  IF (discrorder==rans_discr_ord1) THEN
144 #ifdef RFLO
145  CALL turb_floranssaroe1stflux( region )
146 #endif
147 #ifdef RFLU
148 ! CALL TURB_FluRansSARoe1stFlux( region )
149 #endif
150  ELSEIF (discrorder==rans_discr_ord2) THEN
151 #ifdef RFLO
152  CALL turb_floranssaroe2ndflux( region )
153 #endif
154 #ifdef RFLU
155 ! CALL TURB_FluRansSARoe2ndFlux( region )
156 #endif
157  ENDIF
158  ENDIF
159  ENDIF
160 
161 ! finalize --------------------------------------------------------------------
162 
163 999 CONTINUE
164 
165  CALL deregisterfunction( region%global )
166 
167 END SUBROUTINE turb_ransconvectivefluxes
168 
169 !******************************************************************************
170 !
171 ! RCS Revision history:
172 !
173 ! $Log: TURB_RansConvectiveFluxes.F90,v $
174 ! Revision 1.6 2008/12/06 08:44:42 mtcampbe
175 ! Updated license.
176 !
177 ! Revision 1.5 2008/11/19 22:17:54 mtcampbe
178 ! Added Illinois Open Source License/Copyright
179 !
180 ! Revision 1.4 2005/03/09 06:35:24 wasistho
181 ! incorporated HDESSA
182 !
183 ! Revision 1.3 2004/03/20 00:29:17 wasistho
184 ! set turb_rflo_ransNumericalDiss to turb_ransNumerical..
185 !
186 ! Revision 1.2 2004/03/12 02:55:35 wasistho
187 ! changed rocturb routine names
188 !
189 ! Revision 1.1 2004/03/05 04:37:00 wasistho
190 ! changed nomenclature
191 !
192 ! Revision 1.2 2003/10/27 04:51:50 wasistho
193 ! added RaNS upwind schemes
194 !
195 ! Revision 1.1 2003/10/07 02:17:03 wasistho
196 ! initial installation of RaNS-SA and DES
197 !
198 !
199 !******************************************************************************
200 
201 
202 
203 
204 
205 
206 
**********************************************************************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_ransconvectivefluxes(region)
subroutine turb_floranssaroe1stflux(region)
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 turb_floranssaroe2ndflux(region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_floranssacentflux(region)