Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TURB_fluFaceVolume.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: Define face volume.
26 !
27 ! Description: The face volume is obtained by averaging the two adjacent cell
28 ! volumes
29 !
30 ! Input: region = data of current region
31 !
32 ! Notes: Face volume is used in several routines, a.o LesMij & LesCalcEddyVis.
33 !
34 !******************************************************************************
35 !
36 ! $Id: TURB_fluFaceVolume.F90,v 1.6 2008/12/06 08:44:44 mtcampbe Exp $
37 !
38 ! Copyright: (c) 2001 by the University of Illinois
39 !
40 !******************************************************************************
41 
42 SUBROUTINE turb_flufacevolume( region )
43 
44  USE moddatatypes
45  USE moddatastruct, ONLY : t_region
46  USE modglobal, ONLY : t_global
47  USE modbndpatch, ONLY : t_patch
48  USE moderror
49  USE modparameters
50  IMPLICIT NONE
51 
52 ! ... parameters
53  TYPE(t_region) :: region
54 
55 ! ... loop variables
56  INTEGER :: in, ipatch, ifl
57 
58 ! ... local variables
59  CHARACTER(CHRLEN) :: rcsidentstring
60  TYPE(t_global), POINTER :: global
61  TYPE(t_patch), POINTER :: patch
62 
63  INTEGER :: ijkc0, ijkc1, ifg, ifgbeg
64  INTEGER, POINTER :: f2c(:,:)
65  REAL(RFREAL), POINTER :: fvol(:), bfvol(:), vol(:)
66 
67 !******************************************************************************
68 
69  rcsidentstring = '$RCSfile: TURB_fluFaceVolume.F90,v $ $Revision: 1.6 $'
70 
71  global => region%global
72  CALL registerfunction( global,'TURB_FluFaceVolume',&
73  'TURB_fluFaceVolume.F90' )
74 
75 ! get indices and pointers ---------------------------------------------------
76 
77  f2c => region%grid%f2c
78  vol => region%grid%vol
79  fvol => region%turb%fvolI
80  bfvol => region%turb%bfVolI
81 
82 ! perform 2-point averaging of volume from centers to faces
83 
84  DO in = 1,region%grid%nFaces
85  ijkc0 = f2c(1,in)
86  ijkc1 = f2c(2,in)
87 
88  fvol(in) = 0.5_rfreal*(vol(ijkc1)+vol(ijkc0))
89  ENDDO ! iC
90 
91  DO ipatch = 1,region%grid%nPatches
92  patch => region%patches(ipatch)
93 ! TEMPORARY : removing usage of bf2bg from everywhere
94 ! ifgBeg = patch%bf2bg(BF2BG_BEG)
95 
96  DO ifl = 1,patch%nBFaces
97  ijkc0 = patch%bf2c(ifl)
98  ifg = ifl + ifgbeg-1
99  bfvol(ifg) = vol(ijkc0)
100  ENDDO ! ifl
101  ENDDO ! iPatch
102 
103 ! finalize --------------------------------------------------------------------
104 
105  CALL deregisterfunction( global )
106 
107 END SUBROUTINE turb_flufacevolume
108 
109 !******************************************************************************
110 !
111 ! RCS Revision history:
112 !
113 ! $Log: TURB_fluFaceVolume.F90,v $
114 ! Revision 1.6 2008/12/06 08:44:44 mtcampbe
115 ! Updated license.
116 !
117 ! Revision 1.5 2008/11/19 22:17:56 mtcampbe
118 ! Added Illinois Open Source License/Copyright
119 !
120 ! Revision 1.4 2006/08/19 15:41:02 mparmar
121 ! Removed bf2bg
122 !
123 ! Revision 1.3 2005/12/29 19:48:58 wasistho
124 ! added boundary/patch treatment
125 !
126 ! Revision 1.2 2004/03/27 02:16:42 wasistho
127 ! compiled with Rocflu
128 !
129 ! Revision 1.1 2004/03/19 02:54:58 wasistho
130 ! prepared for RFLU
131 !
132 !
133 !******************************************************************************
134 
135 
136 
137 
138 
139 
140 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
Definition: patch.h:74
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine turb_flufacevolume(region)