Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PERI_CnlForceTerm.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: add mean pressure gradient term to rhs
26 !
27 ! Description: mean pressure gradient is added as source term of axial
28 ! momentum to force the flow and periodicity
29 !
30 ! Input: region = data of current region.
31 !
32 ! Output: region%levels%mixt%rhs = channel pressure gradient added to residual
33 !
34 ! Notes: none.
35 !
36 !******************************************************************************
37 !
38 ! $Id: PERI_CnlForceTerm.F90,v 1.5 2008/12/06 08:44:36 mtcampbe Exp $
39 !
40 ! Copyright: (c) 2001 by the University of Illinois
41 !
42 !******************************************************************************
43 
44 SUBROUTINE peri_cnlforceterm( region )
45 
46  USE moddatatypes
47  USE moddatastruct, ONLY : t_region
48 #ifdef RFLO
50 
51 #include "Indexing.h"
52 #endif
53  USE moderror
54  USE modparameters
56  IMPLICIT NONE
57 
58 ! ... parameters
59  TYPE(t_region) :: region
60 
61 ! ... loop variables
62  INTEGER :: i, j, k, ijkc0
63 
64 ! ... local variables
65  CHARACTER(CHRLEN) :: rcsidentstring
66 
67 #ifdef RFLO
68  INTEGER :: ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend
69  INTEGER :: ilev, icoff, ijcoff
70  REAL(RFREAL), POINTER :: dv(:,:)
71 #endif
72 #ifdef RFLU
73  REAL(RFREAL), POINTER :: cv(:,:)
74 #endif
75 
76  REAL(RFREAL), POINTER :: rhs(:,:), vol(:)
77  REAL(RFREAL) :: refmeanpgrad
78 
79 !******************************************************************************
80 
81  rcsidentstring = '$RCSfile: PERI_CnlForceTerm.F90,v $'
82 
83  CALL registerfunction( region%global,'PERI_CnlForceTerm',&
84  'PERI_CnlForceTerm.F90' )
85 
86 ! get dimensions, pointers and parameters -------------------------------------
87 
88 #ifdef RFLO
89  ilev = region%currLevel
90 
91  CALL rflo_getdimensphys( region,ilev,ipcbeg,ipcend, &
92  jpcbeg,jpcend,kpcbeg,kpcend )
93  CALL rflo_getcelloffset( region,ilev,icoff,ijcoff )
94 
95  dv => region%levels(ilev)%mixt%dv
96  rhs => region%levels(ilev)%mixt%rhs
97  vol => region%levels(ilev)%grid%vol
98 #endif
99 #ifdef RFLU
100  cv => region%mixt%cv
101  rhs => region%mixt%rhs
102  vol => region%grid%vol
103 #endif
104 
105  refmeanpgrad = region%periInput%meanPgrad
106 
107 #ifdef RFLO
108  DO k = kpcbeg, kpcend
109  DO j = jpcbeg, jpcend
110  DO i = ipcbeg, ipcend
111  ijkc0 = indijk(i ,j ,k ,icoff,ijcoff)
112 #endif
113 #ifdef RFLU
114  DO ijkc0 = 1, region%grid%nCells
115 #endif
116  rhs(cv_mixt_xmom,ijkc0) = rhs(cv_mixt_xmom,ijkc0) + vol(ijkc0)*refmeanpgrad
117 #ifdef RFLO
118  rhs(cv_mixt_ener,ijkc0) = rhs(cv_mixt_ener,ijkc0) + &
119  vol(ijkc0)*refmeanpgrad*dv(dv_mixt_uvel,ijkc0)
120  ENDDO ! i
121  ENDDO ! j
122  ENDDO ! k
123 #endif
124 #ifdef RFLU
125  rhs(cv_mixt_ener,ijkc0) = rhs(cv_mixt_ener,ijkc0) + vol(ijkc0)* &
126  refmeanpgrad*cv(cv_mixt_xmom,ijkc0)/ &
127  cv(cv_mixt_dens,ijkc0)
128  ENDDO ! ijkC0
129 #endif
130 
131 ! finalize --------------------------------------------------------------------
132 
133  CALL deregisterfunction( region%global )
134 
135 END SUBROUTINE peri_cnlforceterm
136 
137 !******************************************************************************
138 !
139 ! RCS Revision history:
140 !
141 ! $Log: PERI_CnlForceTerm.F90,v $
142 ! Revision 1.5 2008/12/06 08:44:36 mtcampbe
143 ! Updated license.
144 !
145 ! Revision 1.4 2008/11/19 22:17:49 mtcampbe
146 ! Added Illinois Open Source License/Copyright
147 !
148 ! Revision 1.3 2004/06/17 20:03:05 wasistho
149 ! compiled with RFLU
150 !
151 ! Revision 1.2 2004/06/11 21:49:40 wasistho
152 ! prepared for RFLU
153 !
154 ! Revision 1.1 2004/06/08 23:56:56 wasistho
155 ! changed nomenclature
156 !
157 ! Revision 1.3 2004/01/22 03:59:22 wasistho
158 ! add dpdx*u1 to rhs(energy-eq.)
159 !
160 ! Revision 1.2 2003/05/15 02:57:05 jblazek
161 ! Inlined index function.
162 !
163 ! Revision 1.1.1.1 2003/03/29 03:36:30 wasistho
164 ! install ROCPERI
165 !
166 !******************************************************************************
167 
168 
169 
170 
171 
172 
173 
j indices k indices k
Definition: Indexing.h:6
NT rhs
**********************************************************************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 kpcbeg
subroutine peri_cnlforceterm(region)
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 jpcbeg
**********************************************************************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 ipcend
**********************************************************************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 ipcbeg
blockLoc i
Definition: read.cpp:79
subroutine rflo_getcelloffset(region, iLev, iCellOffset, ijCellOffset)
j indices j
Definition: Indexing.h:6
**********************************************************************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 jpcend
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine rflo_getdimensphys(region, iLev, ipcbeg, ipcend, jpcbeg, jpcend, kpcbeg, kpcend)