Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModConstraintUtils.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: Collection of routines to help with imposition of constraints.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModConstraintUtils.F90,v 1.7 2008/12/06 08:44:20 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2005 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE moddatatypes
42  USE modglobal, ONLY: t_global
43  USE modparameters
44  USE moderror
45  USE moddatastruct, ONLY: t_region
46  USE modbndpatch, ONLY: t_patch
47  USE modgrid, ONLY: t_grid
48  USE modmpi
49  USE modtools
50 
51  IMPLICIT NONE
52 
53  PRIVATE
54  PUBLIC :: rflu_getconstrtype, &
56 
57 ! ******************************************************************************
58 ! Declarations and definitions
59 ! ******************************************************************************
60 
61  CHARACTER(CHRLEN) :: &
62  RCSIdentString = '$RCSfile: RFLU_ModConstraintUtils.F90,v $ $Revision: 1.7 $'
63 
64 ! ******************************************************************************
65 ! Routines
66 ! ******************************************************************************
67 
68  CONTAINS
69 
70 
71 
72 
73 
74 ! ******************************************************************************
75 !
76 ! Purpose: Get constraint type and value for given variable and patch.
77 !
78 ! Description: None.
79 !
80 ! Input:
81 ! pRegion Pointer to region data
82 ! pPatch Pointer to patch data
83 ! var Variable index
84 ! ifl Face index
85 !
86 ! Output: None.
87 !
88 ! Notes: None.
89 !
90 ! ******************************************************************************
91 
92 INTEGER FUNCTION rflu_getconstrtype(pRegion,pPatch,var,ifl)
93 
95 
96  IMPLICIT NONE
97 
98 ! ******************************************************************************
99 ! Definitions and declarations
100 ! ******************************************************************************
101 
102 ! ==============================================================================
103 ! Arguments
104 ! ==============================================================================
105 
106  INTEGER, INTENT(IN) :: ifl,var
107  TYPE(t_patch), POINTER :: ppatch
108  TYPE(t_region), POINTER :: pregion
109 
110 ! ==============================================================================
111 ! Locals
112 ! ==============================================================================
113 
114  INTEGER :: dist,indcp,indmol,gasmodel
115  REAL(RFREAL) :: eqtol,minj,nx,ny,nz,rl
116  TYPE(t_global), POINTER :: global
117 
118 ! ******************************************************************************
119 ! Start
120 ! ******************************************************************************
121 
122  global => pregion%global
123 
124  CALL registerfunction(global,'RFLU_GetConstrType',&
125  'RFLU_ModConstraintUtils.F90')
126 
127  eqtol = 1.0e-6_rfreal
128 
129 ! ******************************************************************************
130 ! Set dimensions and pointers
131 ! ******************************************************************************
132 
133  SELECT CASE ( var )
134 
135 ! ==============================================================================
136 ! Mixture
137 ! ==============================================================================
138 
139 ! ------------------------------------------------------------------------------
140 ! Density
141 ! ------------------------------------------------------------------------------
142 
143  CASE ( v_mixt_dens )
144  SELECT CASE ( ppatch%bcType )
145  CASE ( bc_injection )
146  dist = ppatch%mixt%distrib
147 
148  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
149 
150  IF ( minj > 0.0_rfreal ) THEN
151  rflu_getconstrtype = constr_type_dirichlet
152  ELSE
153  rflu_getconstrtype = constr_type_none
154  END IF ! minj
155  CASE default ! defensive coding
156  rflu_getconstrtype = constr_type_none
157  END SELECT ! pPatch%bcType
158 
159 ! ------------------------------------------------------------------------------
160 ! x-velocity
161 ! ------------------------------------------------------------------------------
162 
163  CASE ( v_mixt_xvel )
164  SELECT CASE ( ppatch%bcType )
165  CASE ( bc_slipwall )
166  nx = ppatch%fn(xcoord,ifl)
167 
168  IF ( floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. ) THEN
169  rflu_getconstrtype = constr_type_dirichlet
170  ELSE
171  rflu_getconstrtype = constr_type_none
172  END IF ! FloatEqual
173  CASE ( bc_noslipwall_hflux )
174  rflu_getconstrtype = constr_type_dirichlet
175  CASE ( bc_noslipwall_temp )
176  rflu_getconstrtype = constr_type_dirichlet
177  CASE ( bc_injection )
178  nx = ppatch%fn(xcoord,ifl)
179 
180  IF ( floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. ) THEN
181  rflu_getconstrtype = constr_type_dirichlet
182  ELSE
183  rflu_getconstrtype = constr_type_none
184  END IF ! FloatEqual
185  CASE default ! defensive coding
186  rflu_getconstrtype = constr_type_none
187  END SELECT ! pPatch%bcType
188 
189 ! ------------------------------------------------------------------------------
190 ! y-velocity
191 ! ------------------------------------------------------------------------------
192 
193  CASE ( v_mixt_yvel )
194  SELECT CASE ( ppatch%bcType )
195  CASE ( bc_slipwall )
196  ny = ppatch%fn(ycoord,ifl)
197 
198  IF ( floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. ) THEN
199  rflu_getconstrtype = constr_type_dirichlet
200  ELSE
201  rflu_getconstrtype = constr_type_none
202  END IF ! FloatEqual
203  CASE ( bc_noslipwall_hflux )
204  rflu_getconstrtype = constr_type_dirichlet
205  CASE ( bc_noslipwall_temp )
206  rflu_getconstrtype = constr_type_dirichlet
207  CASE ( bc_injection )
208  ny = ppatch%fn(ycoord,ifl)
209 
210  IF ( floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. ) THEN
211  rflu_getconstrtype = constr_type_dirichlet
212  ELSE
213  rflu_getconstrtype = constr_type_none
214  END IF ! FloatEqual
215  CASE default ! defensive coding
216  rflu_getconstrtype = constr_type_none
217  END SELECT ! pPatch%bcType
218 
219 ! ------------------------------------------------------------------------------
220 ! z-velocity
221 ! ------------------------------------------------------------------------------
222 
223  CASE ( v_mixt_zvel )
224  SELECT CASE ( ppatch%bcType )
225  CASE ( bc_slipwall )
226  nz = ppatch%fn(zcoord,ifl)
227 
228  IF ( floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. ) THEN
229  rflu_getconstrtype = constr_type_dirichlet
230  ELSE
231  rflu_getconstrtype = constr_type_none
232  END IF ! FloatEqual
233  CASE ( bc_noslipwall_hflux )
234  rflu_getconstrtype = constr_type_dirichlet
235  CASE ( bc_noslipwall_temp )
236  rflu_getconstrtype = constr_type_dirichlet
237  CASE ( bc_injection )
238  nz = ppatch%fn(zcoord,ifl)
239 
240  IF ( floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. ) THEN
241  rflu_getconstrtype = constr_type_dirichlet
242  ELSE
243  rflu_getconstrtype = constr_type_none
244  END IF ! FloatEqual
245  CASE default ! defensive coding
246  rflu_getconstrtype = constr_type_none
247  END SELECT ! pPatch%bcType
248 
249 ! ------------------------------------------------------------------------------
250 ! Temperature
251 ! ------------------------------------------------------------------------------
252 
253  CASE ( v_mixt_temp )
254  SELECT CASE ( ppatch%bcType )
255  CASE ( bc_noslipwall_hflux )
256  rflu_getconstrtype = constr_type_vonneumann
257  CASE ( bc_noslipwall_temp )
258  rflu_getconstrtype = constr_type_dirichlet
259  CASE ( bc_injection )
260  dist = ppatch%mixt%distrib
261 
262  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
263 
264  IF ( minj > 0.0_rfreal ) THEN
265  rflu_getconstrtype = constr_type_dirichlet
266  ELSE
267 #ifndef GENX
268  rflu_getconstrtype = constr_type_none
269 #else
270  IF ( pregion%mixtInput%flowModel == flow_euler ) THEN
271  rflu_getconstrtype = constr_type_none
272  ELSE
273  rflu_getconstrtype = constr_type_dirichlet
274  END IF ! pRegion%mixtInput%flowModel
275 #endif
276  END IF ! minj
277  CASE default ! defensive coding
278  rflu_getconstrtype = constr_type_none
279  END SELECT ! pPatch%bcType
280 
281 #ifdef SPEC
282 ! ==============================================================================
283 ! Species
284 ! ==============================================================================
285 
286  CASE ( v_spec_var1:v_spec_var9 )
287  SELECT CASE ( ppatch%bcType )
288  CASE ( bc_inflow_totang )
289  rflu_getconstrtype = constr_type_dirichlet
290  CASE ( bc_inflow_veltemp )
291  rflu_getconstrtype = constr_type_dirichlet
292  CASE ( bc_injection )
293  rflu_getconstrtype = constr_type_dirichlet
294  CASE default
295  rflu_getconstrtype = constr_type_none
296  END SELECT ! pPatch%bcType
297 #endif
298 
299 ! ==============================================================================
300 ! Default - always unconstrained
301 ! ==============================================================================
302 
303  CASE default
304  rflu_getconstrtype = constr_type_none
305  END SELECT ! var
306 
307 ! ******************************************************************************
308 ! End
309 ! ******************************************************************************
310 
311  CALL deregisterfunction(global)
312 
313 END FUNCTION rflu_getconstrtype
314 
315 
316 
317 
318 
319 
320 
321 
322 
323 
324 
325 ! ******************************************************************************
326 !
327 ! Purpose: Get constraint value for given variable and patch.
328 !
329 ! Description: None.
330 !
331 ! Input:
332 ! pRegion Pointer to region data
333 ! pPatch Pointer to patch data
334 ! var Variable index
335 ! ifl Face index
336 !
337 ! Output:
338 ! constrType Constraint type
339 ! constrVal Constraint value
340 !
341 ! Notes: None.
342 !
343 ! ******************************************************************************
344 
345 FUNCTION rflu_getconstrvalue(pRegion,pPatch,var,ifl)
346 
349 
350  IMPLICIT NONE
351 
352 ! ******************************************************************************
353 ! Definitions and declarations
354 ! ******************************************************************************
355 
356  REAL(RFREAL) :: rflu_getconstrvalue
357 
358 ! ==============================================================================
359 ! Arguments
360 ! ==============================================================================
361 
362  INTEGER, INTENT(IN) :: ifl,var
363  TYPE(t_patch), POINTER :: ppatch
364  TYPE(t_region), POINTER :: pregion
365 
366 ! ==============================================================================
367 ! Locals
368 ! ==============================================================================
369 
370  INTEGER :: dist,icg,indcp,indgs,indmol,gasmodel
371 #ifdef SPEC
372  INTEGER :: ispec
373 #endif
374  REAL(RFREAL) :: cp,eqtol,fs,fsu,hflux,hl,minj,mm,nx,ny,nz,pl,rl,tinj,ul,vl,wl
375 #ifdef GENX
376  REAL(RFREAL) :: tb
377 #endif
378  TYPE(t_global), POINTER :: global
379 
380 ! ******************************************************************************
381 ! Start
382 ! ******************************************************************************
383 
384  global => pregion%global
385 
386  CALL registerfunction(global,'RFLU_GetConstrValue',&
387  'RFLU_ModConstraintUtils.F90')
388 
389  eqtol = 1.0e-6_rfreal
390 
391  indcp = pregion%mixtInput%indCp
392  indmol = pregion%mixtInput%indMol
393  gasmodel = pregion%mixtInput%gasModel
394 
395  indgs = pregion%grid%indGs
396 
397 ! ******************************************************************************
398 ! Set dimensions and pointers
399 ! ******************************************************************************
400 
401  SELECT CASE ( var )
402 
403 ! ==============================================================================
404 ! Mixture
405 ! ==============================================================================
406 
407 ! ------------------------------------------------------------------------------
408 ! Density
409 ! ------------------------------------------------------------------------------
410 
411  CASE ( v_mixt_dens )
412  SELECT CASE ( ppatch%bcType )
413  CASE ( bc_injection )
414  nx = ppatch%fn(xcoord,ifl)
415  ny = ppatch%fn(ycoord,ifl)
416  nz = ppatch%fn(zcoord,ifl)
417 
418  dist = ppatch%mixt%distrib
419 
420  IF ( gasmodel == gas_model_tcperf ) THEN
421  icg = ppatch%bf2c(ifl)
422 
423  fs = ppatch%gs(indgs*ifl)
424  fsu = rflu_descalegridspeed(pregion,fs)
425 
426  cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
427  mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
428 
429  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
430 
431  IF ( minj > 0.0_rfreal ) THEN
432  tinj = ppatch%mixt%vals(bcdat_inject_temp,dist*ifl)
433 
434  pl = pregion%mixt%dv(dv_mixt_pres,icg)
435 
436  CALL rflu_setrindstateinjectperf(cp,mm,nx,ny,nz,minj,tinj, &
437  pl,fsu,rl,ul,vl,wl,hl)
438 
440  ELSE ! defensive coding
441  CALL errorstop(global,err_reached_default,__line__)
442  END IF ! minj
443  ELSE
444  CALL errorstop(global,err_reached_default,__line__)
445  END IF ! gasModel
446  CASE default ! defensive coding
447  CALL errorstop(global,err_reached_default,__line__)
448  END SELECT ! pPatch%bcType
449 
450 ! ------------------------------------------------------------------------------
451 ! x-velocity
452 ! ------------------------------------------------------------------------------
453 
454  CASE ( v_mixt_xvel )
455  SELECT CASE ( ppatch%bcType )
456  CASE ( bc_slipwall )
457  nx = ppatch%fn(xcoord,ifl)
458 
459  IF ( floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. ) THEN
460  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
461  ELSE ! defensive coding
462  CALL errorstop(global,err_reached_default,__line__)
463  END IF ! FloatEqual
464  CASE ( bc_noslipwall_hflux )
465  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
466  CASE ( bc_noslipwall_temp )
467  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
468  CASE ( bc_injection )
469  nx = ppatch%fn(xcoord,ifl)
470  ny = ppatch%fn(ycoord,ifl)
471  nz = ppatch%fn(zcoord,ifl)
472 
473  IF ( floatequal(abs(nx),1.0_rfreal,eqtol) .EQV. .true. ) THEN
474  dist = ppatch%mixt%distrib
475 
476  IF ( gasmodel == gas_model_tcperf ) THEN
477  icg = ppatch%bf2c(ifl)
478 
479  fs = ppatch%gs(indgs*ifl)
480  fsu = rflu_descalegridspeed(pregion,fs)
481 
482  cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
483  mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
484 
485  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
486 
487  IF ( minj > 0.0_rfreal ) THEN
488  tinj = ppatch%mixt%vals(bcdat_inject_temp,dist*ifl)
489 
490  pl = pregion%mixt%dv(dv_mixt_pres,icg)
491 
492  CALL rflu_setrindstateinjectperf(cp,mm,nx,ny,nz,minj,tinj, &
493  pl,fsu,rl,ul,vl,wl,hl)
494 
496  ELSE
497  rflu_getconstrvalue = fsu*nx
498  END IF ! minj
499  ELSE
500  CALL errorstop(global,err_reached_default,__line__)
501  END IF ! gasModel
502  ELSE ! defensive coding
503  CALL errorstop(global,err_reached_default,__line__)
504  END IF ! FloatEqual
505  CASE default ! defensive coding
506  CALL errorstop(global,err_reached_default,__line__)
507  END SELECT ! pPatch%bcType
508 
509 ! ------------------------------------------------------------------------------
510 ! y-velocity
511 ! ------------------------------------------------------------------------------
512 
513  CASE ( v_mixt_yvel )
514  SELECT CASE ( ppatch%bcType )
515  CASE ( bc_slipwall )
516  ny = ppatch%fn(ycoord,ifl)
517 
518  IF ( floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. ) THEN
519  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
520  ELSE ! defensive coding
521  CALL errorstop(global,err_reached_default,__line__)
522  END IF ! FloatEqual
523  CASE ( bc_noslipwall_hflux )
524  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
525  CASE ( bc_noslipwall_temp )
526  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
527  CASE ( bc_injection )
528  nx = ppatch%fn(xcoord,ifl)
529  ny = ppatch%fn(ycoord,ifl)
530  nz = ppatch%fn(zcoord,ifl)
531 
532  IF ( floatequal(abs(ny),1.0_rfreal,eqtol) .EQV. .true. ) THEN
533  dist = ppatch%mixt%distrib
534 
535  IF ( gasmodel == gas_model_tcperf ) THEN
536  icg = ppatch%bf2c(ifl)
537 
538  fs = ppatch%gs(indgs*ifl)
539  fsu = rflu_descalegridspeed(pregion,fs)
540 
541  cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
542  mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
543 
544  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
545 
546  IF ( minj > 0.0_rfreal ) THEN
547  tinj = ppatch%mixt%vals(bcdat_inject_temp,dist*ifl)
548 
549  pl = pregion%mixt%dv(dv_mixt_pres,icg)
550 
551  CALL rflu_setrindstateinjectperf(cp,mm,nx,ny,nz,minj,tinj, &
552  pl,fsu,rl,ul,vl,wl,hl)
553 
555  ELSE
556  rflu_getconstrvalue = fsu*ny
557  END IF ! minj
558  ELSE
559  CALL errorstop(global,err_reached_default,__line__)
560  END IF ! gasModel
561  ELSE ! defensive coding
562  CALL errorstop(global,err_reached_default,__line__)
563  END IF ! FloatEqual
564  CASE default ! defensive coding
565  CALL errorstop(global,err_reached_default,__line__)
566  END SELECT ! pPatch%bcType
567 
568 ! ------------------------------------------------------------------------------
569 ! z-velocity
570 ! ------------------------------------------------------------------------------
571 
572  CASE ( v_mixt_zvel )
573  SELECT CASE ( ppatch%bcType )
574  CASE ( bc_slipwall )
575  nz = ppatch%fn(zcoord,ifl)
576 
577  IF ( floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. ) THEN
578  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
579  ELSE ! defensive coding
580  CALL errorstop(global,err_reached_default,__line__)
581  END IF ! FloatEqual
582  CASE ( bc_noslipwall_hflux )
583  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
584  CASE ( bc_noslipwall_temp )
585  rflu_getconstrvalue = 0.0_rfreal ! TEMPORARY - should be rel vel
586  CASE ( bc_injection )
587  nx = ppatch%fn(xcoord,ifl)
588  ny = ppatch%fn(ycoord,ifl)
589  nz = ppatch%fn(zcoord,ifl)
590 
591  IF ( floatequal(abs(nz),1.0_rfreal,eqtol) .EQV. .true. ) THEN
592  dist = ppatch%mixt%distrib
593 
594  IF ( gasmodel == gas_model_tcperf ) THEN
595  icg = ppatch%bf2c(ifl)
596 
597  fs = ppatch%gs(indgs*ifl)
598  fsu = rflu_descalegridspeed(pregion,fs)
599 
600  cp = pregion%mixt%gv(gv_mixt_cp ,indcp *icg)
601  mm = pregion%mixt%gv(gv_mixt_mol,indmol*icg)
602 
603  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
604 
605  IF ( minj > 0.0_rfreal ) THEN
606  tinj = ppatch%mixt%vals(bcdat_inject_temp,dist*ifl)
607 
608  pl = pregion%mixt%dv(dv_mixt_pres,icg)
609 
610  CALL rflu_setrindstateinjectperf(cp,mm,nx,ny,nz,minj,tinj, &
611  pl,fsu,rl,ul,vl,wl,hl)
612 
614  ELSE
615  rflu_getconstrvalue = fsu*nz
616  END IF ! minj
617  ELSE
618  CALL errorstop(global,err_reached_default,__line__)
619  END IF ! gasModel
620  ELSE ! defensive coding
621  CALL errorstop(global,err_reached_default,__line__)
622  END IF ! FloatEqual
623  CASE default ! defensive coding
624  CALL errorstop(global,err_reached_default,__line__)
625  END SELECT ! pPatch%bcType
626 
627 ! ------------------------------------------------------------------------------
628 ! Temperature
629 ! ------------------------------------------------------------------------------
630 
631  CASE ( v_mixt_temp )
632  SELECT CASE ( ppatch%bcType )
633  CASE ( bc_noslipwall_hflux )
634  SELECT CASE ( ppatch%mixt%distrib )
635  CASE ( bcdat_constant )
636  icg = ppatch%bf2c(ifl)
637  hflux = ppatch%mixt%vals(bcdat_noslip_q,0)
638 
639  rflu_getconstrvalue = -hflux/pregion%mixt%tv(tv_mixt_tcol,icg)
640  CASE ( bcdat_distrib )
641  icg = ppatch%bf2c(ifl)
642  hflux = ppatch%mixt%vals(bcdat_noslip_q,ifl)
643 
644  rflu_getconstrvalue = -hflux/pregion%mixt%tv(tv_mixt_tcol,icg)
645  CASE default ! defensive coding
646  CALL errorstop(global,err_reached_default,__line__)
647  END SELECT ! pPatch%mixt%distrib
648  CASE ( bc_noslipwall_temp )
649  SELECT CASE ( ppatch%mixt%distrib )
650  CASE ( bcdat_constant )
651  rflu_getconstrvalue = ppatch%mixt%vals(bcdat_noslip_t,0)
652  CASE ( bcdat_distrib )
653  rflu_getconstrvalue = ppatch%mixt%vals(bcdat_noslip_t,ifl)
654  CASE default ! defensive coding
655  CALL errorstop(global,err_reached_default,__line__)
656  END SELECT ! pPatch%mixt%distrib
657  CASE ( bc_injection )
658  dist = ppatch%mixt%distrib
659 
660  minj = ppatch%mixt%vals(bcdat_inject_mfrate,dist*ifl)
661 
662 #ifndef GENX
663  IF ( minj > 0.0_rfreal ) THEN
664  tinj = ppatch%mixt%vals(bcdat_inject_temp,dist*ifl)
665 
666  rflu_getconstrvalue = tinj
667  ELSE ! defensive coding
668  CALL errorstop(global,err_reached_default,__line__)
669  END IF ! minj
670 #else
671  IF ( pregion%mixtInput%flowModel == flow_euler ) THEN
672  CALL errorstop(global,err_reached_default,__line__)
673  ELSE
674  tb = ppatch%mixt%vals(bcdat_inject_temp,dist*ifl)
675 
676  rflu_getconstrvalue = tinj
677  END IF ! pRegion%mixtInput%flowModel
678 #endif
679  CASE default ! defensive coding
680  CALL errorstop(global,err_reached_default,__line__)
681  END SELECT ! pPatch%bcType
682 
683 #ifdef SPEC
684 ! ==============================================================================
685 ! Species
686 ! ==============================================================================
687 
688  CASE ( v_spec_var1:v_spec_var9 )
689  ispec = var - v_spec_var1 + 1
690 
691  SELECT CASE ( ppatch%bcType )
692  CASE ( bc_inflow_totang )
693  SELECT CASE ( ppatch%spec%distrib )
694  CASE ( bcdat_constant )
695  rflu_getconstrvalue = ppatch%spec%vals(ispec,0)
696  CASE ( bcdat_distrib )
697  rflu_getconstrvalue = ppatch%spec%vals(ispec,ifl)
698  CASE default ! defensive coding
699  CALL errorstop(global,err_reached_default,__line__)
700  END SELECT ! pPatch%spec%distrib
701  CASE ( bc_inflow_veltemp )
702  SELECT CASE ( ppatch%spec%distrib )
703  CASE ( bcdat_constant )
704  rflu_getconstrvalue = ppatch%spec%vals(ispec,0)
705  CASE ( bcdat_distrib )
706  rflu_getconstrvalue = ppatch%spec%vals(ispec,ifl)
707  CASE default ! defensive coding
708  CALL errorstop(global,err_reached_default,__line__)
709  END SELECT ! pPatch%spec%distrib
710  CASE ( bc_injection )
711  SELECT CASE ( ppatch%spec%distrib )
712  CASE ( bcdat_constant )
713  rflu_getconstrvalue = ppatch%spec%vals(ispec,0)
714  CASE ( bcdat_distrib )
715  rflu_getconstrvalue = ppatch%spec%vals(ispec,ifl)
716  CASE default ! defensive coding
717  CALL errorstop(global,err_reached_default,__line__)
718  END SELECT ! pPatch%spec%distrib
719  CASE default ! defensive coding
720  CALL errorstop(global,err_reached_default,__line__)
721  END SELECT ! pPatch%bcType
722 #endif
723 
724 ! ==============================================================================
725 ! Default
726 ! ==============================================================================
727 
728  CASE default ! defensive coding
729  CALL errorstop(global,err_reached_default,__line__)
730  END SELECT ! var
731 
732 ! ******************************************************************************
733 ! End
734 ! ******************************************************************************
735 
736  CALL deregisterfunction(global)
737 
738 END FUNCTION rflu_getconstrvalue
739 
740 
741 
742 
743 
744 
745 
746 
747 ! ******************************************************************************
748 ! End
749 ! ******************************************************************************
750 
751 END MODULE rflu_modconstraintutils
752 
753 
754 ! ******************************************************************************
755 !
756 ! RCS Revision history:
757 !
758 ! $Log: RFLU_ModConstraintUtils.F90,v $
759 ! Revision 1.7 2008/12/06 08:44:20 mtcampbe
760 ! Updated license.
761 !
762 ! Revision 1.6 2008/11/19 22:17:32 mtcampbe
763 ! Added Illinois Open Source License/Copyright
764 !
765 ! Revision 1.5 2006/08/19 15:39:01 mparmar
766 ! Renamed patch variables
767 !
768 ! Revision 1.4 2006/04/07 15:19:18 haselbac
769 ! Removed tabs
770 !
771 ! Revision 1.3 2005/10/31 21:09:36 haselbac
772 ! Changed specModel and SPEC_MODEL_NONE
773 !
774 ! Revision 1.2 2005/10/14 14:05:38 haselbac
775 ! Added setting of boundary temperature for GENX simulations
776 !
777 ! Revision 1.1 2005/10/05 14:33:44 haselbac
778 ! Initial revision
779 !
780 ! ******************************************************************************
781 
782 
783 
784 
785 
786 
787 
788 
789 
790 
791 
792 
793 
794 
subroutine, public rflu_setrindstateinjectperf(cpGas, mmGas, nx, ny, nz, mInj, tInj, pl, fs, rl, ul, vl, wl, Hl)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
INTEGER function, public rflu_getconstrtype(pRegion, pPatch, var, ifl)
real(rfreal) function, public rflu_descalegridspeed(pRegion, fs)
real(rfreal) function, public rflu_getconstrvalue(pRegion, pPatch, var, ifl)
subroutine errorstop(global, errorCode, errorLine, addMessage)
Definition: ModError.F90:483
long double dist(long double *coord1, long double *coord2, int size)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
LOGICAL function floatequal(a, b, tolIn)
Definition: ModTools.F90:99