Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_InvFlux_I.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 using centered scheme.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region data
31 !
32 ! Output: None.
33 !
34 ! Notes: None.
35 !
36 ! ******************************************************************************
37 !
38 ! $Id: RFLU_InvFlux_I.F90,v 1.3 2008/12/06 08:44:30 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2004 by the University of Illinois
41 !
42 ! ******************************************************************************
43 
44 SUBROUTINE rflu_invflux_i(pRegion)
45 
46  USE moddatatypes
47  USE modglobal, ONLY: t_global
48  USE modgrid, ONLY: t_grid
49  USE moddatastruct, ONLY: t_region
50  USE moderror
51  USE modparameters
52 
55 
56  IMPLICIT NONE
57 
58 ! ******************************************************************************
59 ! Definitions and declarations
60 ! ******************************************************************************
61 
62 ! ==============================================================================
63 ! Arguments
64 ! ==============================================================================
65 
66  TYPE(t_region), POINTER :: pregion
67 
68 ! ==============================================================================
69 ! Locals
70 ! ==============================================================================
71 
72  CHARACTER(CHRLEN) :: rcsidentstring
73  INTEGER :: cvmixtxvel,cvmixtyvel,cvmixtzvel,c1,c2,ifg,ipatch
74  REAL(RFREAL) :: term
75  REAL(RFREAL) :: flx(3)
76  REAL(RFREAL), DIMENSION(:), POINTER :: pvf
77  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv,prhs
78  TYPE(t_global), POINTER :: global
79  TYPE(t_grid), POINTER :: pgrid
80 
81 ! ******************************************************************************
82 ! Start
83 ! ******************************************************************************
84 
85  rcsidentstring = '$RCSfile: RFLU_InvFlux_I.F90,v $ $Revision: 1.3 $'
86 
87  global => pregion%global
88 
89  CALL registerfunction(global,'RFLU_InvFlux_I',&
90  'RFLU_InvFlux_I.F90')
91 
92 ! ******************************************************************************
93 ! Set dimensions and pointers
94 ! ******************************************************************************
95 
96  pgrid => pregion%grid
97 
98  pcv => pregion%mixt%cv
99  prhs => pregion%mixt%rhs
100  pvf => pregion%mixt%vfMixt
101 
102  cvmixtxvel = rflu_getcvloc(global,fluid_model_incomp,cv_mixt_xvel)
103  cvmixtyvel = rflu_getcvloc(global,fluid_model_incomp,cv_mixt_yvel)
104  cvmixtzvel = rflu_getcvloc(global,fluid_model_incomp,cv_mixt_zvel)
105 
106 ! ******************************************************************************
107 ! Compute fluxes through interior faces
108 ! ******************************************************************************
109 
110  DO ifg = 1,pgrid%nFaces
111  c1 = pgrid%f2c(1,ifg)
112  c2 = pgrid%f2c(2,ifg)
113 
114  term = 0.5_rfreal*pvf(ifg)*pgrid%fn(xyzmag,ifg)
115 
116  flx(1) = pcv(cvmixtxvel,c2)*term
117  flx(2) = pcv(cvmixtyvel,c2)*term
118  flx(3) = pcv(cvmixtzvel,c2)*term
119 
120  prhs(cvmixtxvel,c1) = prhs(cvmixtxvel,c1) - flx(1)
121  prhs(cvmixtyvel,c1) = prhs(cvmixtyvel,c1) - flx(2)
122  prhs(cvmixtzvel,c1) = prhs(cvmixtzvel,c1) - flx(3)
123 
124  flx(1) = -pcv(cvmixtxvel,c1)*term
125  flx(2) = -pcv(cvmixtyvel,c1)*term
126  flx(3) = -pcv(cvmixtzvel,c1)*term
127 
128  prhs(cvmixtxvel,c2) = prhs(cvmixtxvel,c2) - flx(1)
129  prhs(cvmixtyvel,c2) = prhs(cvmixtyvel,c2) - flx(2)
130  prhs(cvmixtzvel,c2) = prhs(cvmixtzvel,c2) - flx(3)
131  END DO ! ifg
132 
133 ! ******************************************************************************
134 ! Compute fluxes through boundary faces
135 ! ******************************************************************************
136 
137 ! TO DO
138 ! DO iPatch = 1,region%grid%nPatches
139 ! CALL RFLU_CentralFirstPatch(region,region%patches(iPatch))
140 ! END DO ! iPatch
141 ! END TO DO
142 
143 ! ******************************************************************************
144 ! End
145 ! ******************************************************************************
146 
147  CALL deregisterfunction(global)
148 
149 END SUBROUTINE rflu_invflux_i
150 
151 ! ******************************************************************************
152 !
153 ! RCS Revision history:
154 !
155 ! $Log: RFLU_InvFlux_I.F90,v $
156 ! Revision 1.3 2008/12/06 08:44:30 mtcampbe
157 ! Updated license.
158 !
159 ! Revision 1.2 2008/11/19 22:17:42 mtcampbe
160 ! Added Illinois Open Source License/Copyright
161 !
162 ! Revision 1.1 2004/12/19 15:41:11 haselbac
163 ! Initial revision
164 !
165 ! ******************************************************************************
166 
167 
168 
169 
170 
171 
172 
INTEGER function rflu_getcvloc(global, fluidModel, var)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine rflu_centralfirstpatch(pRegion, pPatch)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflu_invflux_i(pRegion)