Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_RansSourceTerms.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 source terms, if applicable, turbulence transport equations
26 ! depending on model selected (only for RaNS and DES) and added to
27 ! turb RHS
28 !
29 ! Description: this routine calls source term routine specific to chosen model
30 !
31 ! Input: regions = data of all regions
32 !
33 ! Output: region%levels%turb%rhs updated by source term routine being called
34 !
35 ! Notes: this routine updates RHS of turbulence transport equations, not
36 ! of main fluid equations (EULER or NS), hence the name
37 ! TURB_RansSourceTerms instead of TURB_SourceTerms.
38 !
39 !******************************************************************************
40 !
41 ! $Id: TURB_RansSourceTerms.F90,v 1.6 2008/12/06 08:44:42 mtcampbe Exp $
42 !
43 ! Copyright: (c) 2003 by the University of Illinois
44 !
45 !******************************************************************************
46 
47 SUBROUTINE turb_ranssourceterms( region ) ! PUBLIC
48 
49  USE moddatatypes
50  USE modglobal, ONLY : t_global
51  USE moddatastruct, ONLY : t_region
53 #ifdef RFLU
55 #endif
56  USE moderror
57  USE modparameters
59  IMPLICIT NONE
60 
61 ! ... parameters
62  TYPE(t_region) :: region
63 
64 ! ... local variables
65  TYPE(t_global), POINTER :: global
66 
67 #ifdef RFLU
68  INTEGER :: prevcvstate
69 #endif
70 
71 !******************************************************************************
72 
73  global => region%global
74  CALL registerfunction( global,'TURB_RansSourceTerms',&
75  'TURB_RansSourceTerms.F90' )
76 
77  IF (region%turbInput%modelClass /= model_rans) goto 999
78 
79 #ifdef RFLU
80 ! Specific Rocflu ------------------------------------------------------------
81 ! check the state of cv first and convert to conservative if not yet
82 
83  IF (region%mixt%cvState /= cv_mixt_state_cons) THEN
84  prevcvstate = region%mixt%cvState
85  CALL turb_flucv2cons(region,cv_mixt_state_cons)
86  ENDIF
87 #endif
88 
89 ! add source terms of any selected turbulence transport to turb%rhs
90 
91  IF ((region%mixtInput%turbModel == turb_model_sa) .OR. &
92  (region%mixtInput%turbModel == turb_model_dessa) .OR. &
93  (region%mixtInput%turbModel == turb_model_hdessa)) THEN
94  CALL turb_ranssasourceterms( region )
95  ENDIF
96 
97 #ifdef RFLU
98 ! convert cv back to the previous state before entering this routine
99 
100  IF (region%mixt%cvState /= prevcvstate) &
101  CALL turb_flucv2prim( region,prevcvstate )
102 #endif
103 
104 ! finalize --------------------------------------------------------------------
105 
106 999 CONTINUE
107 
108  CALL deregisterfunction( global )
109 
110 END SUBROUTINE turb_ranssourceterms
111 
112 !******************************************************************************
113 !
114 ! RCS Revision history:
115 !
116 ! $Log: TURB_RansSourceTerms.F90,v $
117 ! Revision 1.6 2008/12/06 08:44:42 mtcampbe
118 ! Updated license.
119 !
120 ! Revision 1.5 2008/11/19 22:17:54 mtcampbe
121 ! Added Illinois Open Source License/Copyright
122 !
123 ! Revision 1.4 2005/03/09 06:35:55 wasistho
124 ! incorporated HDESSA
125 !
126 ! Revision 1.3 2004/03/29 21:10:01 wasistho
127 ! add flu routines
128 !
129 ! Revision 1.2 2004/03/27 02:16:42 wasistho
130 ! compiled with Rocflu
131 !
132 ! Revision 1.1 2004/03/05 04:37:00 wasistho
133 ! changed nomenclature
134 !
135 ! Revision 1.1 2003/10/07 02:17:03 wasistho
136 ! initial installation of RaNS-SA and DES
137 !
138 !
139 !******************************************************************************
140 
141 
142 
143 
144 
145 
146 
subroutine turb_flucv2cons(pRegion, cvStateFuture)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine turb_ranssasourceterms(region)
subroutine turb_flucv2prim(pRegion, cvStateFuture)
subroutine turb_ranssourceterms(region)
subroutine deregisterfunction(global)
Definition: ModError.F90:469