Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_InitFlowHardCodeLim.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: Initialize part of flow field in a region using hard-coded values.
26 !
27 ! Description: None.
28 !
29 ! Input:
30 ! pRegion Pointer to region
31 !
32 ! Output: None.
33 !
34 ! Notes:
35 ! 1. This routine assumes a perfect gas.
36 !
37 ! ******************************************************************************
38 !
39 ! $Id: RFLU_InitFlowHardCodeLim.F90,v 1.4 2008/12/06 08:44:56 mtcampbe Exp $
40 !
41 ! Copyright: (c) 2005-2006 by the University of Illinois
42 !
43 ! ******************************************************************************
44 
45 SUBROUTINE rflu_initflowhardcodelim(pRegion)
46 
47  USE moddatatypes
48  USE moderror
49  USE moddatastruct, ONLY: t_region
50  USE modmixture, ONLY: t_mixt_input
51  USE modglobal, ONLY: t_global
52  USE modgrid, ONLY: t_grid
53  USE modparameters
54 
55  USE modinterfaces, ONLY: mixtperf_eo_dgpuvw, &
58 
59  IMPLICIT NONE
60 
61 ! ******************************************************************************
62 ! Declarations and definitions
63 ! ******************************************************************************
64 
65 ! ==============================================================================
66 ! Arguments
67 ! ==============================================================================
68 
69  TYPE(t_region), POINTER :: pregion
70 
71 ! ==============================================================================
72 ! Locals
73 ! ==============================================================================
74 
75  CHARACTER(CHRLEN) :: rcsidentstring
76  INTEGER :: icg,indcp,indmol
77  REAL(RFREAL) :: cp,d,mw,p,g,gc,u,v,w,x
78  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv,pgv
79  TYPE(t_global), POINTER :: global
80  TYPE(t_grid), POINTER :: pgrid
81  TYPE(t_mixt_input), POINTER :: pmixtinput
82 
83 ! ******************************************************************************
84 ! Start
85 ! ******************************************************************************
86 
87  rcsidentstring = '$RCSfile: RFLU_InitFlowHardCodeLim.F90,v $ $Revision: 1.4 $'
88 
89  global => pregion%global
90 
91  CALL registerfunction(global,'RFLU_InitFlowHardCodeLim', &
92  'RFLU_InitFlowHardCodeLim.F90')
93 
94  IF ( global%verbLevel > verbose_none ) THEN
95  WRITE(stdout,'(A,1X,A)') solver_name, &
96  'Initializing flow field from limited hard code...'
97 
98  IF ( global%verbLevel > verbose_low ) THEN
99  WRITE(stdout,'(A,3X,A,A)') solver_name,'Case: ',trim(global%casename)
100  END IF ! global%verbLevel
101  END IF ! global%verbLevel
102 
103 ! ******************************************************************************
104 ! Set pointers
105 ! ******************************************************************************
106 
107  pgrid => pregion%grid
108  pcv => pregion%mixt%cv
109  pgv => pregion%mixt%gv
110  pmixtinput => pregion%mixtInput
111 
112  indcp = pregion%mixtInput%indCp
113  indmol = pregion%mixtInput%indMol
114 
115 ! ******************************************************************************
116 ! Initialize flow field based on user input and fluid model
117 ! ******************************************************************************
118 
119  SELECT CASE ( pmixtinput%fluidModel )
120 
121 ! ==============================================================================
122 ! Incompressible fluid model
123 ! ==============================================================================
124 
125  CASE ( fluid_model_incomp )
126  pregion%mixt%cvState = cv_mixt_state_prim
127 
128 ! TEMPORARY, to be replaced by proper code
129  CALL errorstop(global,err_reached_default,__line__)
130 ! END TEMPORARY
131 
132 ! ==============================================================================
133 ! Compressible fluid model
134 ! ==============================================================================
135 
136  CASE ( fluid_model_comp )
137  pregion%mixt%cvState = cv_mixt_state_cons
138 
139  SELECT CASE ( global%casename )
140 
141 ! ------------------------------------------------------------------------------
142 ! Cylinder diffracting shock
143 ! ------------------------------------------------------------------------------
144 
145  CASE ( "cylds" )
146  DO icg = 1,pgrid%nCellsTot
147  x = pgrid%cofg(xcoord,icg)
148 
149  IF ( x < pmixtinput%prepRealVal1 ) THEN
150  d = pmixtinput%prepRealVal2
151  u = pmixtinput%prepRealVal3
152  v = 0.0_rfreal
153  w = 0.0_rfreal
154  p = pmixtinput%prepRealVal4
155 
156  mw = pgv(gv_mixt_mol,indmol*icg)
157  cp = pgv(gv_mixt_cp ,indcp *icg)
158 
159  gc = mixtperf_r_m(mw)
160  g = mixtperf_g_cpr(cp,gc)
161 
162  pcv(cv_mixt_dens,icg) = d
163  pcv(cv_mixt_xmom,icg) = d*u
164  pcv(cv_mixt_ymom,icg) = d*v
165  pcv(cv_mixt_zmom,icg) = d*w
166  pcv(cv_mixt_ener,icg) = d*mixtperf_eo_dgpuvw(d,g,p,u,v,w)
167  END IF ! x
168  END DO ! icg
169 
170 ! ------------------------------------------------------------------------------
171 ! Skews diffracting shock
172 ! ------------------------------------------------------------------------------
173 
174 ! ----- Shock Mach number of 3.0 -----------------------------------------------
175 
176  CASE ( "skews_ms2p0","skews_ms3p0","skews_ms4p0" )
177  DO icg = 1,pgrid%nCellsTot
178  x = pgrid%cofg(xcoord,icg)
179 
180  IF ( x < pmixtinput%prepRealVal1 ) THEN
181  d = pmixtinput%prepRealVal2
182  u = pmixtinput%prepRealVal3
183  v = 0.0_rfreal
184  w = 0.0_rfreal
185  p = pmixtinput%prepRealVal4
186 
187  mw = pgv(gv_mixt_mol,indmol*icg)
188  cp = pgv(gv_mixt_cp ,indcp *icg)
189 
190  gc = mixtperf_r_m(mw)
191  g = mixtperf_g_cpr(cp,gc)
192 
193  pcv(cv_mixt_dens,icg) = d
194  pcv(cv_mixt_xmom,icg) = d*u
195  pcv(cv_mixt_ymom,icg) = d*v
196  pcv(cv_mixt_zmom,icg) = d*w
197  pcv(cv_mixt_ener,icg) = d*mixtperf_eo_dgpuvw(d,g,p,u,v,w)
198  END IF ! x
199  END DO ! icg
200 
201 ! ------------------------------------------------------------------------------
202 ! Sphere diffracting shock
203 ! ------------------------------------------------------------------------------
204 
205  CASE ( "sphds" )
206  DO icg = 1,pgrid%nCellsTot
207  x = pgrid%cofg(xcoord,icg)
208 
209  IF ( x < pmixtinput%prepRealVal1 ) THEN
210  d = pmixtinput%prepRealVal2
211  u = pmixtinput%prepRealVal3
212  v = 0.0_rfreal
213  w = 0.0_rfreal
214  p = pmixtinput%prepRealVal4
215 
216  mw = pgv(gv_mixt_mol,indmol*icg)
217  cp = pgv(gv_mixt_cp ,indcp *icg)
218 
219  gc = mixtperf_r_m(mw)
220  g = mixtperf_g_cpr(cp,gc)
221 
222  pcv(cv_mixt_dens,icg) = d
223  pcv(cv_mixt_xmom,icg) = d*u
224  pcv(cv_mixt_ymom,icg) = d*v
225  pcv(cv_mixt_zmom,icg) = d*w
226  pcv(cv_mixt_ener,icg) = d*mixtperf_eo_dgpuvw(d,g,p,u,v,w)
227  END IF ! x
228  END DO ! icg
229 
230 ! ------------------------------------------------------------------------------
231 ! Default - must be due to input error
232 ! ------------------------------------------------------------------------------
233 
234  CASE default
235  CALL errorstop(global,err_reached_default,__line__)
236  END SELECT ! global%casename
237 
238 ! ==============================================================================
239 ! Default
240 ! ==============================================================================
241 
242  CASE default
243  CALL errorstop(global,err_reached_default,__line__)
244  END SELECT ! pMixtInput%fluidModel
245 
246 ! ******************************************************************************
247 ! End
248 ! ******************************************************************************
249 
250  IF ( global%verbLevel > verbose_none ) THEN
251  WRITE(stdout,'(A,1X,A)') solver_name, &
252  'Initializing flow field from limited hard code done.'
253  END IF ! global%verbLevel
254 
255  CALL deregisterfunction(global)
256 
257 END SUBROUTINE rflu_initflowhardcodelim
258 
259 ! ******************************************************************************
260 !
261 ! RCS Revision history:
262 !
263 ! $Log: RFLU_InitFlowHardCodeLim.F90,v $
264 ! Revision 1.4 2008/12/06 08:44:56 mtcampbe
265 ! Updated license.
266 !
267 ! Revision 1.3 2008/11/19 22:18:06 mtcampbe
268 ! Added Illinois Open Source License/Copyright
269 !
270 ! Revision 1.2 2006/03/26 20:22:23 haselbac
271 ! Removed error trap for GL model
272 !
273 ! Revision 1.1 2005/11/10 02:54:20 haselbac
274 ! Renamed to shorten name
275 !
276 ! Revision 1.6 2005/09/13 21:38:47 haselbac
277 ! Removed hardcoded gamma value
278 !
279 ! Revision 1.5 2005/07/05 19:49:04 mparmar
280 ! Added init for diffracting shock over sphere
281 !
282 ! Revision 1.4 2005/06/16 20:57:11 haselbac
283 ! Now use gGas for Skews cases instead of hardcoded 1.4
284 !
285 ! Revision 1.3 2005/06/16 20:55:54 haselbac
286 ! Added new Skews cases
287 !
288 ! Revision 1.2 2005/04/22 15:22:34 haselbac
289 ! Changed message printed to screen
290 !
291 ! Revision 1.1 2005/04/15 16:20:22 haselbac
292 ! Initial revision
293 !
294 ! ******************************************************************************
295 
296 
297 
298 
299 
300 
301 
subroutine rflu_initflowhardcodelim(pRegion)
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
const NT & d
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS 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 v
Definition: roccomf90.h:20
void int int REAL * x
Definition: read.cpp:74
real(rfreal) function mixtperf_eo_dgpuvw(D, G, P, U, V, W)
Definition: MixtPerf_E.F90:40
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
subroutine deregisterfunction(global)
Definition: ModError.F90:469
real(rfreal) function mixtperf_g_cpr(Cp, R)
Definition: MixtPerf_G.F90:39
unsigned char g() const
Definition: Color.h:69