Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_fluLesC2F.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: Get face values of cv for unstructured grid.
26 !
27 ! Description: It is obtained by two point averaging the adjacent cell values
28 ! using the averaging coefficients avgCo.
29 !
30 ! Input: region = data of current region
31 !
32 ! Output: fVar = face values of cv.
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: TURB_fluLesC2F.F90,v 1.5 2008/12/06 08:44:44 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE turb_flulesc2f( region )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48  USE modglobal, ONLY : t_global
49  USE modbndpatch, ONLY : t_patch
50  USE moderror
51  USE modparameters
53  IMPLICIT NONE
54 
55 ! ... parameters
56  TYPE(t_region) :: region
57 
58 ! ... loop variables
59  INTEGER :: if, ifl, ipatch
60 
61 ! ... local variables
62  CHARACTER(CHRLEN) :: rcsidentstring
63  TYPE(t_global), POINTER :: global
64  TYPE(t_patch), POINTER :: patch
65 
66  INTEGER :: ijkc0, ijkc1, ifg, bctype
67  REAL(RFREAL), POINTER :: cv(:,:), avgco(:,:), fvar(:,:), bfvar(:,:)
68  INTEGER, POINTER :: f2c(:,:), bf2c(:)
69 
70 !******************************************************************************
71 
72  rcsidentstring = '$RCSfile: TURB_fluLesC2F.F90,v $ $Revision: 1.5 $'
73 
74  global => region%global
75  CALL registerfunction( global,'TURB_FluLesC2F',&
76  'TURB_fluLesC2F.F90' )
77 
78 ! get indices and pointers ---------------------------------------------------
79 
80  cv => region%mixt%cv
81  f2c => region%grid%f2c
82  avgco => region%turb%avgCoI
83  fvar => region%turb%fVar
84  bfvar => region%turb%bfVar
85  avgco(:,:) = 0.5_rfreal ! for now, waiting for proper average coefficients
86 
87 ! perform 2-point averaging of rho,rhou1,rhou2 and rhou3 from centers to faces
88 
89  DO if = 1,region%grid%nFaces
90  ijkc0 = f2c(1,if)
91  ijkc1 = f2c(2,if)
92 
93  fvar(cv_turb_dens,if)=avgco(2,if)*cv(cv_mixt_dens,ijkc0)+ &
94  avgco(1,if)*cv(cv_mixt_dens,ijkc1)
95  fvar(cv_turb_xmom,if)=avgco(2,if)*cv(cv_mixt_xmom,ijkc0)+ &
96  avgco(1,if)*cv(cv_mixt_xmom,ijkc1)
97  fvar(cv_turb_ymom,if)=avgco(2,if)*cv(cv_mixt_ymom,ijkc0)+ &
98  avgco(1,if)*cv(cv_mixt_ymom,ijkc1)
99  fvar(cv_turb_zmom,if)=avgco(2,if)*cv(cv_mixt_zmom,ijkc0)+ &
100  avgco(1,if)*cv(cv_mixt_zmom,ijkc1)
101  ENDDO ! if
102 
103  ifg = 0
104  DO ipatch = 1,region%grid%nPatches
105  patch => region%patches(ipatch)
106  bf2c => patch%bf2c
107  bctype = patch%bcType
108 
109  IF (bctype>=bc_noslipwall .AND. bctype>=bc_noslipwall+bc_range) THEN
110 
111  DO ifl = 1,patch%nBFaces
112  ijkc0 = bf2c(ifl)
113  ifg = ifg + 1
114 
115  bfvar(cv_turb_dens,ifg) = cv(cv_mixt_dens,ijkc0)
116  bfvar(cv_turb_xmom,ifg) = 0._rfreal
117  bfvar(cv_turb_ymom,ifg) = 0._rfreal
118  bfvar(cv_turb_zmom,ifg) = 0._rfreal
119  ENDDO ! ifl
120  ELSE
121  DO ifl = 1,patch%nBFaces
122  ijkc0 = bf2c(ifl)
123  ifg = ifg + 1
124 
125  bfvar(cv_turb_dens,ifg) = cv(cv_mixt_dens,ijkc0)
126  bfvar(cv_turb_xmom,ifg) = cv(cv_mixt_xmom,ijkc0)
127  bfvar(cv_turb_ymom,ifg) = cv(cv_mixt_ymom,ijkc0)
128  bfvar(cv_turb_zmom,ifg) = cv(cv_mixt_zmom,ijkc0)
129  ENDDO ! ifl
130  ENDIF
131 
132  ENDDO ! iPatch
133 
134 ! finalize --------------------------------------------------------------------
135 
136  CALL deregisterfunction( global )
137 
138 END SUBROUTINE turb_flulesc2f
139 
140 !******************************************************************************
141 !
142 ! RCS Revision history:
143 !
144 ! $Log: TURB_fluLesC2F.F90,v $
145 ! Revision 1.5 2008/12/06 08:44:44 mtcampbe
146 ! Updated license.
147 !
148 ! Revision 1.4 2008/11/19 22:17:56 mtcampbe
149 ! Added Illinois Open Source License/Copyright
150 !
151 ! Revision 1.3 2004/05/28 02:00:01 wasistho
152 ! update unstructured grid LES
153 !
154 ! Revision 1.2 2004/03/27 02:16:42 wasistho
155 ! compiled with Rocflu
156 !
157 ! Revision 1.1 2004/03/19 02:54:58 wasistho
158 ! prepared for RFLU
159 !
160 !
161 !******************************************************************************
162 
163 
164 
165 
166 
167 
168 
if(dy > dx)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine turb_flulesc2f(region)
Definition: patch.h:74
subroutine deregisterfunction(global)
Definition: ModError.F90:469