Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFLU_ModBoundXvUtils.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 for boundary data.
26 !
27 ! Description: None.
28 !
29 ! Notes: None.
30 !
31 ! ******************************************************************************
32 !
33 ! $Id: RFLU_ModBoundXvUtils.F90,v 1.6 2008/12/06 08:44:20 mtcampbe Exp $
34 !
35 ! Copyright: (c) 2006 by the University of Illinois
36 !
37 ! ******************************************************************************
38 
40 
41  USE modparameters
42  USE moddatatypes
43  USE modglobal, ONLY: t_global
44  USE modgrid, ONLY: t_grid
45  USE modbndpatch, ONLY: t_patch
46  USE moddatastruct, ONLY: t_region
47  USE modmixture, ONLY: t_mixt_input
48  USE moderror
49  USE modmpi
50 
51  USE rflu_modnscbc, ONLY: rflu_nscbc_initsw, &
60 
61  USE modinterfaces, ONLY: mixtperf_c_grt, &
66  mixtperf_r_m, &
68 
69  IMPLICIT NONE
70 
71 ! ******************************************************************************
72 ! Declarations and definitions
73 ! ******************************************************************************
74 
75 ! ==============================================================================
76 ! Private data
77 ! ==============================================================================
78 
79  CHARACTER(CHRLEN), PRIVATE :: &
80  RCSIdentString = '$RCSfile: RFLU_ModBoundXvUtils.F90,v $ $Revision: 1.6 $'
81 
82 ! ==============================================================================
83 ! Public functions
84 ! ==============================================================================
85 
86  PUBLIC :: rflu_bxv_computevarscv, &
104 
105 ! ==============================================================================
106 ! Private functions
107 ! ==============================================================================
108 
109  PRIVATE :: rflu_bxv_compenergypatch, &
112 
113 ! ******************************************************************************
114 ! Routines
115 ! ******************************************************************************
116 
117  CONTAINS
118 
119 
120 
121 
122 
123 
124 
125 ! ******************************************************************************
126 !
127 ! Purpose: Compute conserved variables on patches.
128 !
129 ! Description: None.
130 !
131 ! Input:
132 ! pRegion Pointer to region
133 !
134 ! Output: None.
135 !
136 ! Notes: None.
137 !
138 ! ******************************************************************************
139 
140 SUBROUTINE rflu_bxv_computevarscv(pRegion)
141 
142  IMPLICIT NONE
143 
144 ! ******************************************************************************
145 ! Definitions and declarations
146 ! ******************************************************************************
147 
148 ! ==============================================================================
149 ! Arguments
150 ! ==============================================================================
151 
152  TYPE(t_region), POINTER :: pregion
153 
154 ! ==============================================================================
155 ! Locals
156 ! ==============================================================================
157 
158  INTEGER :: ipatch
159  TYPE(t_patch), POINTER :: ppatch
160  TYPE(t_global), POINTER :: global
161 
162 ! ******************************************************************************
163 ! Start
164 ! ******************************************************************************
165 
166  global => pregion%global
167 
168  CALL registerfunction(global,'RFLU_BXV_ComputeVarsCv',&
169  'RFLU_ModBoundXvUtils.F90')
170 
171 ! ******************************************************************************
172 ! Loop over patches and set dependent variables
173 ! ******************************************************************************
174 
175  DO ipatch = 1,pregion%grid%nPatches
176  ppatch => pregion%patches(ipatch)
177 
178  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
179  SELECT CASE( ppatch%bcType )
180  CASE (bc_slipwall)
181  CASE (bc_noslipwall_hflux)
182  CASE (bc_noslipwall_temp)
183  CASE (bc_inflow_totang)
184  CASE (bc_inflow_veltemp)
185  IF ( ppatch%mixt%switches(bcswi_inflow_type) == bcopt_subsonic ) THEN
186  IF ( ppatch%reflect == bc_reflecting ) THEN
187  CALL rflu_bxv_compmomenergypatch(pregion,ppatch)
188  END IF ! pPatch%reflect
189  END IF ! pPatch%mixt%switches
190  CASE (bc_outflow)
191  IF ( ppatch%mixt%switches(bcswi_outflow_type) == bcopt_subsonic ) THEN
192  IF ( ppatch%reflect == bc_reflecting ) THEN
193  CALL rflu_bxv_compenergypatch(pregion,ppatch)
194  END IF ! pPatch%reflect
195  END IF ! pPatch%mixt%switches
196  CASE (bc_farfield)
197  CASE (bc_injection)
198  CASE default
199  CALL errorstop(global,err_reached_default,__line__)
200  END SELECT ! pPatch%bcType
201  END IF ! pPatch%bcKind
202  END DO ! iPatch
203 
204 ! ******************************************************************************
205 ! End
206 ! ******************************************************************************
207 
208  CALL deregisterfunction(global)
209 
210 END SUBROUTINE rflu_bxv_computevarscv
211 
212 
213 
214 
215 
216 
217 
218 
219 ! ******************************************************************************
220 !
221 ! Purpose: Compute energy on patches.
222 !
223 ! Description: None.
224 !
225 ! Input:
226 ! pRegion Pointer to region
227 ! pPatch Pointer to patch
228 !
229 ! Output: None.
230 !
231 ! Notes: None.
232 !
233 ! ******************************************************************************
234 
235 SUBROUTINE rflu_bxv_compenergypatch(pRegion,pPatch)
236 
237  IMPLICIT NONE
238 
239 ! ******************************************************************************
240 ! Definitions and declarations
241 ! ******************************************************************************
242 
243 ! ==============================================================================
244 ! Arguments
245 ! ==============================================================================
246 
247  TYPE(t_patch), POINTER :: ppatch
248  TYPE(t_region), POINTER :: pregion
249 
250 ! ==============================================================================
251 ! Locals
252 ! ==============================================================================
253 
254  INTEGER :: ifl,icg,indcp,indmol
255  REAL(RFREAL) :: eo,r,u,v,w,p,ru,rv,rw,mw,cp,gc,g
256  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv,pdv,pgv
257  TYPE(t_global), POINTER :: global
258 
259 ! ******************************************************************************
260 ! Start
261 ! ******************************************************************************
262 
263  global => pregion%global
264 
265  CALL registerfunction(global,'RFLU_BXV_CompEnergyPatch',&
266  'RFLU_ModBoundXvUtils.F90')
267 
268 ! ******************************************************************************
269 ! Set variables and pointers
270 ! ******************************************************************************
271 
272  pcv => ppatch%mixt%cv
273  pdv => ppatch%mixt%dv
274  pgv => pregion%mixt%gv ! NOTE gv taken from cells for now
275 
276  indcp = pregion%mixtInput%indCp
277  indmol = pregion%mixtInput%indMol
278 
279 ! ******************************************************************************
280 ! Compute total energy for patch data
281 ! ******************************************************************************
282 
283  DO ifl = 1,ppatch%nBFaces
284  icg = ppatch%bf2c(ifl)
285 
286  r = pcv(cv_mixt_dens,ifl)
287  ru = pcv(cv_mixt_xmom,ifl)
288  rv = pcv(cv_mixt_ymom,ifl)
289  rw = pcv(cv_mixt_zmom,ifl)
290  p = pdv(dv_mixt_pres,ifl)
291 
292  u = ru/r
293  v = rv/r
294  w = rw/r
295 
296  mw = pgv(gv_mixt_mol,indmol*icg)
297  cp = pgv(gv_mixt_cp ,indcp *icg)
298  gc = mixtperf_r_m(mw)
299  g = mixtperf_g_cpr(cp,gc)
300 
301  eo = mixtperf_eo_dgpuvw(r,g,p,u,v,w)
302 
303  pcv(cv_mixt_ener,ifl) = r*eo
304  END DO ! ifl
305 
306 ! ******************************************************************************
307 ! End
308 ! ******************************************************************************
309 
310  CALL deregisterfunction(global)
311 
312 END SUBROUTINE rflu_bxv_compenergypatch
313 
314 
315 
316 
317 
318 
319 
320 
321 
322 ! ******************************************************************************
323 !
324 ! Purpose: Compute momentum and energy on patches.
325 !
326 ! Description: None.
327 !
328 ! Input:
329 ! pRegion Pointer to region
330 ! pPatch Pointer to patch
331 !
332 ! Output: None.
333 !
334 ! Notes: None.
335 !
336 ! ******************************************************************************
337 
338 SUBROUTINE rflu_bxv_compmomenergypatch(pRegion,pPatch)
339 
340  IMPLICIT NONE
341 
342 ! ******************************************************************************
343 ! Definitions and declarations
344 ! ******************************************************************************
345 
346 ! ==============================================================================
347 ! Arguments
348 ! ==============================================================================
349 
350  TYPE(t_patch), POINTER :: ppatch
351  TYPE(t_region), POINTER :: pregion
352 
353 ! ==============================================================================
354 ! Locals
355 ! ==============================================================================
356 
357  INTEGER :: ifl,icg,indcp,indmol,distrib
358  REAL(RFREAL) :: eo,r,u,v,w,ru,rv,rw,mw,cp,gc,g,t
359  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv,pdv,pgv,vals
360  TYPE(t_global), POINTER :: global
361 
362 ! ******************************************************************************
363 ! Start
364 ! ******************************************************************************
365 
366  global => pregion%global
367 
368  CALL registerfunction(global,'RFLU_BXV_CompMomEnergyPatch',&
369  'RFLU_ModBoundXvUtils.F90')
370 
371 ! ******************************************************************************
372 ! Set variables and pointers
373 ! ******************************************************************************
374 
375  distrib = ppatch%mixt%distrib
376 
377  pcv => ppatch%mixt%cv
378  vals => ppatch%mixt%vals
379  pgv => pregion%mixt%gv ! NOTE gv taken from cells for now
380 
381  indcp = pregion%mixtInput%indCp
382  indmol = pregion%mixtInput%indMol
383 
384 ! ******************************************************************************
385 ! Compute Momentum variables for patch data
386 ! ******************************************************************************
387 
388  DO ifl = 1,ppatch%nBFaces
389  icg = ppatch%bf2c(ifl)
390 
391  r = pcv(cv_mixt_dens,ifl)
392 
393  u = vals(bcdat_inflow_u,distrib*ifl)
394  v = vals(bcdat_inflow_v,distrib*ifl)
395  w = vals(bcdat_inflow_w,distrib*ifl)
396 
397  t = vals(bcdat_inflow_t,distrib*ifl)
398 
399  mw = pgv(gv_mixt_mol,indmol*icg)
400  cp = pgv(gv_mixt_cp ,indcp *icg)
401  gc = mixtperf_r_m(mw)
402  g = mixtperf_g_cpr(cp,gc)
403 
404  eo = mixtperf_eo_grtuvw(g,gc,t,u,v,w)
405 
406  pcv(cv_mixt_xmom,ifl) = r*u
407  pcv(cv_mixt_ymom,ifl) = r*v
408  pcv(cv_mixt_zmom,ifl) = r*w
409  pcv(cv_mixt_ener,ifl) = r*eo
410  END DO ! ifl
411 
412 ! ******************************************************************************
413 ! End
414 ! ******************************************************************************
415 
416  CALL deregisterfunction(global)
417 
418 END SUBROUTINE rflu_bxv_compmomenergypatch
419 
420 
421 
422 
423 
424 
425 
426 
427 ! ******************************************************************************
428 !
429 ! Purpose: Allocate memory for conserved variables on boundary.
430 !
431 ! Description: None.
432 !
433 ! Input:
434 ! pRegion Region pointer
435 !
436 ! Output: None.
437 !
438 ! Notes: None.
439 !
440 ! ******************************************************************************
441 
442 SUBROUTINE rflu_bxv_createvarscv(pRegion)
443 
444  IMPLICIT NONE
445 
446 ! ******************************************************************************
447 ! Definitions and declarations
448 ! ******************************************************************************
449 
450 ! ==============================================================================
451 ! Arguments
452 ! ==============================================================================
453 
454  TYPE(t_region), POINTER :: pregion
455 
456 ! ==============================================================================
457 ! Locals
458 ! ==============================================================================
459 
460  INTEGER :: errorflag,ipatch
461  TYPE(t_patch), POINTER :: ppatch
462  TYPE(t_global), POINTER :: global
463 
464 ! ******************************************************************************
465 ! Start
466 ! ******************************************************************************
467 
468  global => pregion%global
469 
470  CALL registerfunction(global,'RFLU_BXV_CreateVarsCv',&
471  'RFLU_ModBoundXvUtils.F90')
472 
473 ! ******************************************************************************
474 ! Loop over patches and allocate memory
475 ! ******************************************************************************
476 
477  DO ipatch = 1,pregion%grid%nPatches
478  ppatch => pregion%patches(ipatch)
479 
480  IF (ppatch%bcKind == bc_kind_nscbc ) THEN
481  ALLOCATE(ppatch%mixt%cv(pregion%mixtInput%nCv,ppatch%nBFaces), &
482  stat=errorflag)
483  global%error = errorflag
484  IF (global%error /= err_none) THEN
485  CALL errorstop(global,err_allocate,__line__,'pPatch%mixt%cv')
486  END IF ! global%error
487  END IF ! pPatch%bcKind
488  END DO ! iPatch
489 
490 ! ******************************************************************************
491 ! End
492 ! ******************************************************************************
493 
494  CALL deregisterfunction(global)
495 
496 END SUBROUTINE rflu_bxv_createvarscv
497 
498 
499 
500 
501 
502 
503 
504 ! ******************************************************************************
505 !
506 ! Purpose: Allocate memory for dependent variables on boundary.
507 !
508 ! Description: None.
509 !
510 ! Input:
511 ! pRegion Region pointer
512 !
513 ! Output: None.
514 !
515 ! Notes: None.
516 !
517 ! ******************************************************************************
518 
519 SUBROUTINE rflu_bxv_createvarsdv(pRegion)
520 
521  IMPLICIT NONE
522 
523 ! ******************************************************************************
524 ! Definitions and declarations
525 ! ******************************************************************************
526 
527 ! ==============================================================================
528 ! Arguments
529 ! ==============================================================================
530 
531  TYPE(t_region), POINTER :: pregion
532 
533 ! ==============================================================================
534 ! Locals
535 ! ==============================================================================
536 
537  INTEGER :: errorflag, ipatch
538  TYPE(t_patch), POINTER :: ppatch
539  TYPE(t_global), POINTER :: global
540 
541 ! ******************************************************************************
542 ! Start
543 ! ******************************************************************************
544 
545  global => pregion%global
546 
547  CALL registerfunction(global,'RFLU_BXV_CreateVarsDv',&
548  'RFLU_ModBoundXvUtils.F90')
549 
550 ! ******************************************************************************
551 ! Loop over patches and allocate memory
552 ! ******************************************************************************
553 
554  DO ipatch = 1,pregion%grid%nPatches
555  ppatch => pregion%patches(ipatch)
556 
557  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
558  ALLOCATE(ppatch%mixt%dv(pregion%mixtInput%nDv,ppatch%nBFaces), &
559  stat=errorflag)
560  global%error = errorflag
561  IF (global%error /= err_none) THEN
562  CALL errorstop(global,err_allocate,__line__,'pPatch%mixt%dv')
563  END IF ! global%error
564  END IF ! pPatch%bcKind
565  END DO ! iPatch
566 
567 ! ******************************************************************************
568 ! End
569 ! ******************************************************************************
570 
571  CALL deregisterfunction(global)
572 
573 END SUBROUTINE rflu_bxv_createvarsdv
574 
575 
576 
577 
578 
579 
580 ! ******************************************************************************
581 !
582 ! Purpose: Allocate memory for time-stepping variables on boundary.
583 !
584 ! Description: None.
585 !
586 ! Input:
587 ! pRegion Region pointer
588 !
589 ! Output: None.
590 !
591 ! Notes: None.
592 !
593 ! ******************************************************************************
594 
595 SUBROUTINE rflu_bxv_createvarststep(pRegion)
596 
597  IMPLICIT NONE
598 
599 ! ******************************************************************************
600 ! Definitions and declarations
601 ! ******************************************************************************
602 
603 ! ==============================================================================
604 ! Arguments
605 ! ==============================================================================
606 
607  TYPE(t_region), POINTER :: pregion
608 
609 ! ==============================================================================
610 ! Locals
611 ! ==============================================================================
612 
613  INTEGER :: errorflag,ipatch
614  TYPE(t_patch), POINTER :: ppatch
615  TYPE(t_global), POINTER :: global
616 
617 ! ******************************************************************************
618 ! Start
619 ! ******************************************************************************
620 
621  global => pregion%global
622 
623  CALL registerfunction(global,'RFLU_BXV_CreateVarsTStep',&
624  'RFLU_ModBoundXvUtils.F90')
625 
626 ! ******************************************************************************
627 ! Loop over patches and Allocate memory
628 ! ******************************************************************************
629 
630  DO ipatch = 1,pregion%grid%nPatches
631  ppatch => pregion%patches(ipatch)
632 
633  IF (ppatch%bcKind == bc_kind_nscbc ) THEN
634  ALLOCATE(ppatch%mixt%cvOld(pregion%mixtInput%nCv,ppatch%nBFaces), &
635  stat=errorflag)
636  global%error = errorflag
637  IF (global%error /= err_none) THEN
638  CALL errorstop(global,err_allocate,__line__,'pPatch%mixt%cvOld')
639  END IF ! global%error
640 
641  ALLOCATE(ppatch%mixt%rhs(pregion%mixtInput%nCv,ppatch%nBFaces), &
642  stat=errorflag)
643  global%error = errorflag
644  IF (global%error /= err_none) THEN
645  CALL errorstop(global,err_allocate,__line__,'pPatch%mixt%rhs')
646  END IF ! global%error
647 
648  ALLOCATE(ppatch%mixt%rhsSum(pregion%mixtInput%nCv,ppatch%nBFaces), &
649  stat=errorflag)
650  global%error = errorflag
651  IF (global%error /= err_none) THEN
652  CALL errorstop(global,err_allocate,__line__,'pPatch%mixt%rhsSum')
653  END IF ! global%error
654  END IF ! pPatch%bcKind
655  END DO ! iPatch
656 
657 ! ******************************************************************************
658 ! End
659 ! ******************************************************************************
660 
661  CALL deregisterfunction(global)
662 
663 END SUBROUTINE rflu_bxv_createvarststep
664 
665 
666 
667 
668 
669 
670 ! ******************************************************************************
671 !
672 ! Purpose: Destroy conserved variables on patches.
673 !
674 ! Description: None.
675 !
676 ! Input:
677 ! pRegion Pointer to region
678 !
679 ! Output: None.
680 !
681 ! Notes: None.
682 !
683 ! ******************************************************************************
684 
685 SUBROUTINE rflu_bxv_destroyvarscv(pRegion)
686 
687  IMPLICIT NONE
688 
689 ! ******************************************************************************
690 ! Definitions and declarations
691 ! ******************************************************************************
692 
693 ! ==============================================================================
694 ! Arguments
695 ! ==============================================================================
696 
697  TYPE(t_region), POINTER :: pregion
698 
699 ! ==============================================================================
700 ! Locals
701 ! ==============================================================================
702 
703  INTEGER :: errorflag, ipatch
704  TYPE(t_patch), POINTER :: ppatch
705  TYPE(t_global), POINTER :: global
706 
707 ! ******************************************************************************
708 ! Start
709 ! ******************************************************************************
710 
711  global => pregion%global
712 
713  CALL registerfunction(global,'RFLU_BXV_DestroyVarsCv',&
714  'RFLU_ModBoundXvUtils.F90')
715 
716 ! ******************************************************************************
717 ! Loop over patches and deallocate memory
718 ! ******************************************************************************
719 
720  DO ipatch = 1,pregion%grid%nPatches
721  ppatch => pregion%patches(ipatch)
722 
723  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
724  DEALLOCATE(ppatch%mixt%cv,stat=errorflag)
725  global%error = errorflag
726  IF (global%error /= err_none) THEN
727  CALL errorstop(global,err_deallocate,__line__,'pPatch%mixt%cv')
728  END IF ! global%error
729  END IF ! pPatch%bcKind
730  END DO ! iPatch
731 
732  CALL rflu_bxv_nullifyvarscv(pregion)
733 
734 ! ******************************************************************************
735 ! End
736 ! ******************************************************************************
737 
738  CALL deregisterfunction(global)
739 
740 END SUBROUTINE rflu_bxv_destroyvarscv
741 
742 
743 
744 
745 
746 
747 ! ******************************************************************************
748 !
749 ! Purpose: Destroy dependent variables on patches.
750 !
751 ! Description: None.
752 !
753 ! Input:
754 ! pRegion Pointer to region
755 !
756 ! Output: None.
757 !
758 ! Notes: None.
759 !
760 ! ******************************************************************************
761 
762 SUBROUTINE rflu_bxv_destroyvarsdv(pRegion)
763 
764  IMPLICIT NONE
765 
766 ! ******************************************************************************
767 ! Definitions and declarations
768 ! ******************************************************************************
769 
770 ! ==============================================================================
771 ! Arguments
772 ! ==============================================================================
773 
774  TYPE(t_region), POINTER :: pregion
775 
776 ! ==============================================================================
777 ! Locals
778 ! ==============================================================================
779 
780  INTEGER :: errorflag,ipatch
781  TYPE(t_patch), POINTER :: ppatch
782  TYPE(t_global), POINTER :: global
783 
784 ! ******************************************************************************
785 ! Start
786 ! ******************************************************************************
787 
788  global => pregion%global
789 
790  CALL registerfunction(global,'RFLU_BXV_DestroyVarsDv',&
791  'RFLU_ModBoundXvUtils.F90')
792 
793 ! ******************************************************************************
794 ! Loop over patches and deallocate memory
795 ! ******************************************************************************
796 
797  DO ipatch = 1,pregion%grid%nPatches
798  ppatch => pregion%patches(ipatch)
799 
800  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
801  DEALLOCATE(ppatch%mixt%dv,stat=errorflag)
802  global%error = errorflag
803  IF (global%error /= err_none) THEN
804  CALL errorstop(global,err_deallocate,__line__,'pPatch%mixt%dv')
805  END IF ! global%error
806  END IF ! pPatch%bcKind
807  END DO ! iPatch
808 
809  CALL rflu_bxv_nullifyvarsdv(pregion)
810 
811 ! ******************************************************************************
812 ! End
813 ! ******************************************************************************
814 
815  CALL deregisterfunction(global)
816 
817 END SUBROUTINE rflu_bxv_destroyvarsdv
818 
819 
820 
821 
822 
823 ! ******************************************************************************
824 !
825 ! Purpose: Destroy variables on patches related to time-stepping.
826 !
827 ! Description: None.
828 !
829 ! Input:
830 ! pRegion Pointer to region
831 !
832 ! Output: None.
833 !
834 ! Notes: None.
835 !
836 ! ******************************************************************************
837 
838 SUBROUTINE rflu_bxv_destroyvarststep(pRegion)
839 
840  IMPLICIT NONE
841 
842 ! ******************************************************************************
843 ! Definitions and declarations
844 ! ******************************************************************************
845 
846 ! ==============================================================================
847 ! Arguments
848 ! ==============================================================================
849 
850  TYPE(t_region), POINTER :: pregion
851 
852 ! ==============================================================================
853 ! Locals
854 ! ==============================================================================
855 
856  INTEGER :: errorflag, ipatch
857  TYPE(t_patch), POINTER :: ppatch
858  TYPE(t_global), POINTER :: global
859 
860 ! ******************************************************************************
861 ! Start
862 ! ******************************************************************************
863 
864  global => pregion%global
865 
866  CALL registerfunction(global,'RFLU_BXV_DestroyVarsTStep',&
867  'RFLU_ModBoundXvUtils.F90')
868 
869 ! ******************************************************************************
870 ! Loop over patches and deallocate memory
871 ! ******************************************************************************
872 
873  DO ipatch = 1,pregion%grid%nPatches
874  ppatch => pregion%patches(ipatch)
875 
876  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
877  DEALLOCATE(ppatch%mixt%rhs,stat=errorflag)
878  global%error = errorflag
879  IF (global%error /= err_none) THEN
880  CALL errorstop(global,err_deallocate,__line__,'pPatch%mixt%rhs')
881  END IF ! global%error
882 
883  DEALLOCATE(ppatch%mixt%rhsSum,stat=errorflag)
884  global%error = errorflag
885  IF (global%error /= err_none) THEN
886  CALL errorstop(global,err_deallocate,__line__,'pPatch%mixt%rhs')
887  END IF ! global%error
888  END IF ! pPatch%bcKind
889  END DO ! iPatch
890 
891  CALL rflu_bxv_nullifyvarststep(pregion)
892 
893 ! ******************************************************************************
894 ! End
895 ! ******************************************************************************
896 
897  CALL deregisterfunction(global)
898 
899 END SUBROUTINE rflu_bxv_destroyvarststep
900 
901 
902 
903 
904 
905 
906 
907 
908 ! ******************************************************************************
909 !
910 ! Purpose: Initialize patch variables.
911 !
912 ! Description: None.
913 !
914 ! Input:
915 ! pRegion Pointer to region
916 !
917 ! Output: None.
918 !
919 ! Notes: None.
920 !
921 ! ******************************************************************************
922 
923 SUBROUTINE rflu_bxv_initvars(pRegion)
924 
925  IMPLICIT NONE
926 
927 ! ******************************************************************************
928 ! Definitions and declarations
929 ! ******************************************************************************
930 
931 ! ==============================================================================
932 ! Arguments
933 ! ==============================================================================
934 
935  TYPE(t_region), POINTER :: pregion
936 
937 ! ==============================================================================
938 ! Locals
939 ! ==============================================================================
940 
941  INTEGER :: errorflag, ipatch
942  TYPE(t_patch), POINTER :: ppatch
943  TYPE(t_global), POINTER :: global
944 
945 ! ******************************************************************************
946 ! Start
947 ! ******************************************************************************
948 
949  global => pregion%global
950 
951  CALL registerfunction(global,'RFLU_BXV_InitVars',&
952  'RFLU_ModBoundXvUtils.F90')
953 
954 ! ******************************************************************************
955 ! Loop over patches and initialize patch variable arrays
956 ! ******************************************************************************
957 
958  DO ipatch = 1,pregion%grid%nPatches
959  ppatch => pregion%patches(ipatch)
960 
961  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
962  SELECT CASE( ppatch%bcType )
963  CASE (bc_slipwall)
964  CALL rflu_nscbc_initsw(pregion,ppatch)
965  CASE (bc_noslipwall_hflux)
966  CALL rflu_nscbc_initnswheat(pregion,ppatch)
967  CASE (bc_noslipwall_temp)
968  CALL rflu_nscbc_initnswtemp(pregion,ppatch)
969  CASE (bc_inflow_totang)
970  CALL rflu_nscbc_initiftotang(pregion,ppatch)
971  CASE (bc_inflow_veltemp)
972  CALL rflu_nscbc_initifveltemp(pregion,ppatch)
973  CASE (bc_outflow)
974  CALL rflu_nscbc_initof(pregion,ppatch)
975  CASE (bc_farfield)
976  CALL rflu_nscbc_initff(pregion,ppatch)
977  CASE (bc_injection)
978  CALL rflu_nscbc_initij(pregion,ppatch)
979  CASE default
980  CALL errorstop(global,err_reached_default,__line__)
981  END SELECT ! pPatch%bcType
982  END IF ! pPatch%bcKind
983  END DO ! iPatch
984 
985 ! ******************************************************************************
986 ! Set dependent variables for each patch
987 ! ******************************************************************************
988 
989  CALL rflu_bxv_setdependentvars(pregion)
990 
991 ! ******************************************************************************
992 ! End
993 ! ******************************************************************************
994 
995  CALL deregisterfunction(global)
996 
997 END SUBROUTINE rflu_bxv_initvars
998 
999 
1000 
1001 
1002 
1003 
1004 ! ******************************************************************************
1005 !
1006 ! Purpose: Nullify conserved variables on patches.
1007 !
1008 ! Description: None.
1009 !
1010 ! Input:
1011 ! pRegion Pointer to region
1012 !
1013 ! Output: None.
1014 !
1015 ! Notes: None.
1016 !
1017 ! ******************************************************************************
1018 
1019 SUBROUTINE rflu_bxv_nullifyvarscv(pRegion)
1020 
1021  IMPLICIT NONE
1022 
1023 ! ******************************************************************************
1024 ! Definitions and declarations
1025 ! ******************************************************************************
1026 
1027 ! ==============================================================================
1028 ! Arguments
1029 ! ==============================================================================
1030 
1031  TYPE(t_region), POINTER :: pregion
1032 
1033 ! ==============================================================================
1034 ! Locals
1035 ! ==============================================================================
1036 
1037  INTEGER :: errorflag, ipatch
1038  TYPE(t_patch), POINTER :: ppatch
1039  TYPE(t_global), POINTER :: global
1040 
1041 ! ******************************************************************************
1042 ! Start
1043 ! ******************************************************************************
1044 
1045  global => pregion%global
1046 
1047  CALL registerfunction(global,'RFLU_BXV_NullifyVarsCv',&
1048  'RFLU_ModBoundXvUtils.F90')
1049 
1050 ! ******************************************************************************
1051 ! Loop over patches and nullify memory
1052 ! ******************************************************************************
1053 
1054  DO ipatch = 1,pregion%grid%nPatches
1055  ppatch => pregion%patches(ipatch)
1056 
1057  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
1058  nullify(ppatch%mixt%cv)
1059  END IF ! pPatch%bcKind
1060  END DO ! iPatch
1061 
1062 ! ******************************************************************************
1063 ! End
1064 ! ******************************************************************************
1065 
1066  CALL deregisterfunction(global)
1067 
1068 END SUBROUTINE rflu_bxv_nullifyvarscv
1069 
1070 
1071 
1072 
1073 
1074 
1075 
1076 ! ******************************************************************************
1077 !
1078 ! Purpose: Nullify dependent variables on patches.
1079 !
1080 ! Description: None.
1081 !
1082 ! Input:
1083 ! pRegion Pointer to region
1084 !
1085 ! Output: None.
1086 !
1087 ! Notes: None.
1088 !
1089 ! ******************************************************************************
1090 
1091 SUBROUTINE rflu_bxv_nullifyvarsdv(pRegion)
1092 
1093  IMPLICIT NONE
1094 
1095 ! ******************************************************************************
1096 ! Definitions and declarations
1097 ! ******************************************************************************
1098 
1099 ! ==============================================================================
1100 ! Arguments
1101 ! ==============================================================================
1102 
1103  TYPE(t_region), POINTER :: pregion
1104 
1105 ! ==============================================================================
1106 ! Locals
1107 ! ==============================================================================
1108 
1109  INTEGER :: errorflag, ipatch
1110  TYPE(t_patch), POINTER :: ppatch
1111  TYPE(t_global), POINTER :: global
1112 
1113 ! ******************************************************************************
1114 ! Start
1115 ! ******************************************************************************
1116 
1117  global => pregion%global
1118 
1119  CALL registerfunction(global,'RFLU_BXV_NullifyVarsDv',&
1120  'RFLU_ModBoundXvUtils.F90')
1121 
1122 ! ******************************************************************************
1123 ! Loop over patches and nullify memory
1124 ! ******************************************************************************
1125 
1126  DO ipatch = 1,pregion%grid%nPatches
1127  ppatch => pregion%patches(ipatch)
1128 
1129  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
1130  nullify(ppatch%mixt%dv)
1131  END IF ! pPatch%bcKind
1132  END DO ! iPatch
1133 
1134 ! ******************************************************************************
1135 ! End
1136 ! ******************************************************************************
1137 
1138  CALL deregisterfunction(global)
1139 
1140 END SUBROUTINE rflu_bxv_nullifyvarsdv
1141 
1142 
1143 
1144 
1145 
1146 
1147 
1148 ! ******************************************************************************
1149 !
1150 ! Purpose: Nullify time-stepping variables on patches.
1151 !
1152 ! Description: None.
1153 !
1154 ! Input:
1155 ! pRegion Pointer to region
1156 !
1157 ! Output: None.
1158 !
1159 ! Notes: None.
1160 !
1161 ! ******************************************************************************
1162 
1163 SUBROUTINE rflu_bxv_nullifyvarststep(pRegion)
1164 
1165  IMPLICIT NONE
1166 
1167 ! ******************************************************************************
1168 ! Definitions and declarations
1169 ! ******************************************************************************
1170 
1171 ! ==============================================================================
1172 ! Arguments
1173 ! ==============================================================================
1174 
1175  TYPE(t_region), POINTER :: pregion
1176 
1177 ! ==============================================================================
1178 ! Locals
1179 ! ==============================================================================
1180 
1181  INTEGER :: errorflag, ipatch
1182  TYPE(t_patch), POINTER :: ppatch
1183  TYPE(t_global), POINTER :: global
1184 
1185 ! ******************************************************************************
1186 ! Start
1187 ! ******************************************************************************
1188 
1189  global => pregion%global
1190 
1191  CALL registerfunction(global,'RFLU_BXV_NullifyVarsTStep',&
1192  'RFLU_ModBoundXvUtils.F90')
1193 
1194 ! ******************************************************************************
1195 ! Loop over patches and nullify memory
1196 ! ******************************************************************************
1197 
1198  DO ipatch = 1,pregion%grid%nPatches
1199  ppatch => pregion%patches(ipatch)
1200 
1201  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
1202  nullify(ppatch%mixt%cvOld)
1203  nullify(ppatch%mixt%rhs)
1204  nullify(ppatch%mixt%rhsSum)
1205  END IF ! pPatch%bcKind
1206  END DO ! iPatch
1207 
1208 ! ******************************************************************************
1209 ! End
1210 ! ******************************************************************************
1211 
1212  CALL deregisterfunction(global)
1213 
1214 END SUBROUTINE rflu_bxv_nullifyvarststep
1215 
1216 
1217 
1218 
1219 
1220 
1221 
1222 
1223 ! ******************************************************************************
1224 !
1225 ! Purpose: Read patch variables in ASCII format.
1226 !
1227 ! Description: None.
1228 !
1229 ! Input:
1230 ! pRegion Pointer to region
1231 !
1232 ! Output: None.
1233 !
1234 ! Notes: None.
1235 !
1236 ! ******************************************************************************
1237 
1238 SUBROUTINE rflu_bxv_readvarsascii(pRegion)
1239 
1242 
1243  IMPLICIT NONE
1244 
1245 ! ******************************************************************************
1246 ! Declarations and definitions
1247 ! ******************************************************************************
1248 
1249 ! ==============================================================================
1250 ! Arguments
1251 ! ==============================================================================
1252 
1253  TYPE(t_region), POINTER :: pregion
1254 
1255 ! ==============================================================================
1256 ! Local variables
1257 ! ==============================================================================
1258 
1259  CHARACTER(CHRLEN) :: errorstring,ifilename,sectionstring
1260  INTEGER :: dummyinteger,errorflag,idata,ifile,ifl,ipatch,ipatchglobal, &
1261  loopcounter,nbfaces,ndata
1262  TYPE(t_global), POINTER :: global
1263  TYPE(t_grid), POINTER :: pgrid
1264  TYPE(t_patch), POINTER :: ppatch
1265 
1266 ! ******************************************************************************
1267 ! Start
1268 ! ******************************************************************************
1269 
1270  global => pregion%global
1271 
1272  CALL registerfunction(global,'RFLU_BXV_ReadVarsASCII',&
1273  'RFLU_ModBoundXvUtils.F90')
1274 
1275  IF ( global%myProcid == masterproc .AND. &
1276  global%verbLevel > verbose_none ) THEN
1277  WRITE(stdout,'(A,1X,A)') solver_name,'Reading ASCII boundary-condition' // &
1278  ' variable file...'
1279  END IF ! global%verbLevel
1280 
1281 ! ******************************************************************************
1282 ! Set pointers
1283 ! ******************************************************************************
1284 
1285  pgrid => pregion%grid
1286 
1287 ! ******************************************************************************
1288 ! Open file
1289 ! ******************************************************************************
1290 
1291  ifile = if_distr
1292 
1293  IF ( global%flowType == flow_unsteady ) THEN
1294  CALL buildfilenameunsteady(global,filedest_indir,'.bcva', &
1295  pregion%iRegionGlobal,global%currentTime, &
1296  ifilename)
1297  ELSE
1298  CALL buildfilenamesteady(global,filedest_indir,'.bcva', &
1299  pregion%iRegionGlobal,global%currentIter, &
1300  ifilename)
1301  END IF ! global%flowType
1302 
1303  OPEN(ifile,file=ifilename,form='FORMATTED',status='OLD',iostat=errorflag)
1304  global%error = errorflag
1305  IF ( global%error /= err_none ) THEN
1306  CALL errorstop(global,err_file_open,__line__,'File: '//trim(ifilename))
1307  END IF ! global%error
1308 
1309 ! ******************************************************************************
1310 ! Read header
1311 ! ******************************************************************************
1312 
1313  READ(ifile,'(A)') sectionstring
1314  IF ( trim(sectionstring) /= '# ROCFLU boundary-condition variable file' ) THEN
1315  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1316  END IF ! TRIM
1317 
1318 ! ******************************************************************************
1319 ! Read data
1320 ! ******************************************************************************
1321 
1322  loopcounter = 0
1323 
1324  DO ! set up infinite loop
1325  loopcounter = loopcounter + 1
1326 
1327  READ(ifile,'(A)') sectionstring
1328 
1329  SELECT CASE ( trim(sectionstring) )
1330 
1331 ! ==============================================================================
1332 ! Patch data
1333 ! ==============================================================================
1334 
1335  CASE ( '# Patch data' )
1336  IF ( global%myProcid == masterproc .AND. &
1337  global%verbLevel > verbose_low ) THEN
1338  WRITE(stdout,'(A,3X,A)') solver_name,'Patch variable...'
1339  END IF ! global%verbLevel
1340 
1341  READ(ifile,*) ipatch,ipatchglobal,nbfaces,ndata
1342 
1343 ! ------------------------------------------------------------------------------
1344 ! Check that input correct
1345 ! ------------------------------------------------------------------------------
1346 
1347  IF ( ipatch > pgrid%nPatches ) THEN
1348  WRITE(errorstring,'(A,1X,I3)') 'Patch index invalid:',ipatch
1349  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1350  trim(errorstring))
1351  END IF ! iPatch
1352 
1353  ppatch => pregion%patches(ipatch)
1354 
1355 ! ------------------------------------------------------------------------------
1356 ! Check if this patch kind is NSCBC
1357 ! ------------------------------------------------------------------------------
1358 
1359  IF ( ppatch%bcKind /= bc_kind_nscbc ) THEN
1360  WRITE(errorstring,'(A,1X,I3)') 'Error in writing NSCBC variables for patch :', &
1361  ipatchglobal
1362  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1363  trim(errorstring))
1364  END IF ! pPatch%bcKind
1365 
1366  IF ( nbfaces /= ppatch%nBFaces ) THEN
1367  WRITE(errorstring,'(A,1X,I6)') 'Number of faces invalid:',nbfaces
1368  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1369  trim(errorstring))
1370  END IF ! nBFaces
1371 
1372  IF ( ipatchglobal /= ppatch%iPatchGlobal ) THEN
1373  WRITE(errorstring,'(A,1X,I3)') 'Global patch index invalid:', &
1374  ipatchglobal
1375  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1376  trim(errorstring))
1377  END IF ! iPatchGlobal
1378 
1379  IF ( ndata /= pregion%mixtInput%nCv ) THEN
1380  WRITE(errorstring,'(A,1X,I3)') &
1381  'Number of pieces of data invalid:',ndata
1382  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1383  trim(errorstring))
1384  END IF ! iPatchGlobal
1385 
1386 ! ------------------------------------------------------------------------------
1387 ! Read data
1388 ! ------------------------------------------------------------------------------
1389 
1390  ppatch%mixt%cvState = cv_mixt_state_cons
1391 
1392  DO ifl = 1,ppatch%nBFaces
1393  DO idata = 1,pregion%mixtInput%nCv
1394  READ(ifile,'(1X,I6,1X,I2,1X,E23.16)') dummyinteger,dummyinteger, &
1395  ppatch%mixt%cv(idata,ifl)
1396  END DO ! iData
1397  END DO ! ifl
1398 
1399 ! ==============================================================================
1400 ! End marker
1401 ! ==============================================================================
1402 
1403  CASE ( '# End' )
1404  IF ( global%myProcid == masterproc .AND. &
1405  global%verbLevel > verbose_low ) THEN
1406  WRITE(stdout,'(A,3X,A)') solver_name,'End marker...'
1407  END IF ! global%verbLevel
1408 
1409  EXIT
1410 
1411 ! ==============================================================================
1412 ! Invalid section string
1413 ! ==============================================================================
1414 
1415  CASE default
1416  IF ( global%verbLevel > verbose_low ) THEN
1417  WRITE(stdout,'(A,3X,A)') solver_name,sectionstring
1418  END IF ! verbosityLevel
1419 
1420  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1421  END SELECT ! TRIM
1422 
1423 ! ==============================================================================
1424 ! Guard against infinite loop - might be unnecessary because of read errors?
1425 ! ==============================================================================
1426 
1427  IF ( loopcounter >= limit_infinite_loop ) THEN
1428  CALL errorstop(global,err_infinite_loop,__line__)
1429  END IF ! loopCounter
1430  END DO ! <empty>
1431 
1432 ! ******************************************************************************
1433 ! Close file
1434 ! ******************************************************************************
1435 
1436  CLOSE(ifile,iostat=errorflag)
1437  global%error = errorflag
1438  IF ( global%error /= err_none ) THEN
1439  CALL errorstop(global,err_file_close,__line__,'File: '//trim(ifilename))
1440  END IF ! global%error
1441 
1442 ! ******************************************************************************
1443 ! End
1444 ! ******************************************************************************
1445 
1446  IF ( global%myProcid == masterproc .AND. &
1447  global%verbLevel > verbose_none ) THEN
1448  WRITE(stdout,'(A,1X,A)') solver_name,'Reading ASCII boundary-condition' // &
1449  ' variable file done.'
1450  END IF ! global%verbLevel
1451 
1452  CALL deregisterfunction(global)
1453 
1454 END SUBROUTINE rflu_bxv_readvarsascii
1455 
1456 
1457 
1458 
1459 
1460 
1461 ! ******************************************************************************
1462 !
1463 ! Purpose: Read patch variables in binary format.
1464 !
1465 ! Description: None.
1466 !
1467 ! Input:
1468 ! pRegion Pointer to region
1469 !
1470 ! Output: None.
1471 !
1472 ! Notes: None.
1473 !
1474 ! ******************************************************************************
1475 
1476 SUBROUTINE rflu_bxv_readvarsbinary(pRegion)
1477 
1480 
1481  IMPLICIT NONE
1482 
1483 ! ******************************************************************************
1484 ! Declarations and definitions
1485 ! ******************************************************************************
1486 
1487 ! ==============================================================================
1488 ! Arguments
1489 ! ==============================================================================
1490 
1491  TYPE(t_region), POINTER :: pregion
1492 
1493 ! ==============================================================================
1494 ! Local variables
1495 ! ==============================================================================
1496 
1497  CHARACTER(CHRLEN) :: errorstring,ifilename,sectionstring
1498  INTEGER :: dummyinteger,errorflag,idata,ifile,ifl,ipatch,ipatchglobal, &
1499  loopcounter,nbfaces,ndata
1500  TYPE(t_global), POINTER :: global
1501  TYPE(t_grid), POINTER :: pgrid
1502  TYPE(t_patch), POINTER :: ppatch
1503 
1504 ! ******************************************************************************
1505 ! Start
1506 ! ******************************************************************************
1507 
1508  global => pregion%global
1509 
1510  CALL registerfunction(global,'RFLU_BXV_ReadVarsBinary',&
1511  'RFLU_ModBoundXvUtils.F90')
1512 
1513  IF ( global%myProcid == masterproc .AND. &
1514  global%verbLevel > verbose_none ) THEN
1515  WRITE(stdout,'(A,1X,A)') solver_name,'Reading binary boundary-condition' // &
1516  ' variable file...'
1517  END IF ! global%verbLevel
1518 
1519 ! ******************************************************************************
1520 ! Set pointers
1521 ! ******************************************************************************
1522 
1523  pgrid => pregion%grid
1524 
1525 ! ******************************************************************************
1526 ! Open file
1527 ! ******************************************************************************
1528 
1529  ifile = if_distr
1530 
1531  IF ( global%flowType == flow_unsteady ) THEN
1532  CALL buildfilenameunsteady(global,filedest_indir,'.bcv', &
1533  pregion%iRegionGlobal,global%currentTime, &
1534  ifilename)
1535  ELSE
1536  CALL buildfilenamesteady(global,filedest_indir,'.bcv', &
1537  pregion%iRegionGlobal,global%currentIter, &
1538  ifilename)
1539  ENDIF ! global%flowType
1540 
1541  OPEN(ifile,file=ifilename,form='UNFORMATTED',status='OLD',iostat=errorflag)
1542  global%error = errorflag
1543  IF ( global%error /= err_none ) THEN
1544  CALL errorstop(global,err_file_open,__line__,'File: '//trim(ifilename))
1545  END IF ! global%error
1546 
1547 ! ******************************************************************************
1548 ! Read header
1549 ! ******************************************************************************
1550 
1551  READ(ifile) sectionstring
1552  IF ( trim(sectionstring) /= '# ROCFLU boundary-condition variable file' ) THEN
1553  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1554  END IF ! TRIM
1555 
1556 ! ******************************************************************************
1557 ! Read data
1558 ! ******************************************************************************
1559 
1560  loopcounter = 0
1561 
1562  DO ! set up infinite loop
1563  loopcounter = loopcounter + 1
1564 
1565  READ(ifile) sectionstring
1566 
1567  SELECT CASE ( trim(sectionstring) )
1568 
1569 ! ==============================================================================
1570 ! Patch data
1571 ! ==============================================================================
1572 
1573  CASE ( '# Patch data' )
1574  IF ( global%myProcid == masterproc .AND. &
1575  global%verbLevel > verbose_low ) THEN
1576  WRITE(stdout,'(A,3X,A)') solver_name,'Patch variable...'
1577  END IF ! global%verbLevel
1578 
1579  READ(ifile) ipatch,ipatchglobal,nbfaces,ndata
1580 
1581 ! ------------------------------------------------------------------------------
1582 ! Check that input correct
1583 ! ------------------------------------------------------------------------------
1584 
1585  IF ( ipatch > pgrid%nPatches ) THEN
1586  WRITE(errorstring,'(A,1X,I3)') 'Patch index invalid:',ipatch
1587  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1588  trim(errorstring))
1589  END IF ! iPatch
1590 
1591  ppatch => pregion%patches(ipatch)
1592 
1593 ! ------------------------------------------------------------------------------
1594 ! Check if this patch kind is NSCBC
1595 ! ------------------------------------------------------------------------------
1596 
1597  IF ( ppatch%bcKind /= bc_kind_nscbc ) THEN
1598  WRITE(errorstring,'(A,1X,I3)') 'Error in writing NSCBC variables for patch :', &
1599  ipatchglobal
1600  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1601  trim(errorstring))
1602  END IF ! pPatch%bcKind
1603 
1604  IF ( nbfaces /= ppatch%nBFaces ) THEN
1605  WRITE(errorstring,'(A,1X,I6)') 'Number of faces invalid:',nbfaces
1606  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1607  trim(errorstring))
1608  END IF ! nBFaces
1609 
1610  IF ( ipatchglobal /= ppatch%iPatchGlobal ) THEN
1611  WRITE(errorstring,'(A,1X,I3)') 'Global patch index invalid:', &
1612  ipatchglobal
1613  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1614  trim(errorstring))
1615  END IF ! iPatchGlobal
1616 
1617  IF ( ndata /= pregion%mixtInput%nCv ) THEN
1618  WRITE(errorstring,'(A,1X,I3)') &
1619  'Number of pieces of data invalid:',ndata
1620  CALL errorstop(global,err_bcdata_value_invalid,__line__, &
1621  trim(errorstring))
1622  END IF ! iPatchGlobal
1623 
1624 ! ------------------------------------------------------------------------------
1625 ! Read data
1626 ! ------------------------------------------------------------------------------
1627 
1628  ppatch%mixt%cvState = cv_mixt_state_cons
1629 
1630  DO ifl = 1,ppatch%nBFaces
1631  DO idata = 1,pregion%mixtInput%nCv
1632  READ(ifile) dummyinteger,dummyinteger,ppatch%mixt%cv(idata,ifl)
1633  END DO ! iData
1634  END DO ! ifl
1635 
1636 ! ==============================================================================
1637 ! End marker
1638 ! ==============================================================================
1639 
1640  CASE ( '# End' )
1641  IF ( global%myProcid == masterproc .AND. &
1642  global%verbLevel > verbose_low ) THEN
1643  WRITE(stdout,'(A,3X,A)') solver_name,'End marker...'
1644  END IF ! global%verbLevel
1645 
1646  EXIT
1647 
1648 ! ==============================================================================
1649 ! Invalid section string
1650 ! ==============================================================================
1651 
1652  CASE default
1653  IF ( global%verbLevel > verbose_low ) THEN
1654  WRITE(stdout,'(A,3X,A)') solver_name,sectionstring
1655  END IF ! verbosityLevel
1656 
1657  CALL errorstop(global,err_invalid_marker,__line__,sectionstring)
1658  END SELECT ! TRIM
1659 
1660 ! ==============================================================================
1661 ! Guard against infinite loop - might be unnecessary because of read errors?
1662 ! ==============================================================================
1663 
1664  IF ( loopcounter >= limit_infinite_loop ) THEN
1665  CALL errorstop(global,err_infinite_loop,__line__)
1666  END IF ! loopCounter
1667  END DO ! <empty>
1668 
1669 ! ******************************************************************************
1670 ! Close file
1671 ! ******************************************************************************
1672 
1673  CLOSE(ifile,iostat=errorflag)
1674  global%error = errorflag
1675  IF ( global%error /= err_none ) THEN
1676  CALL errorstop(global,err_file_close,__line__,'File: '//trim(ifilename))
1677  END IF ! global%error
1678 
1679 ! ******************************************************************************
1680 ! End
1681 ! ******************************************************************************
1682 
1683  IF ( global%myProcid == masterproc .AND. &
1684  global%verbLevel > verbose_none ) THEN
1685  WRITE(stdout,'(A,1X,A)') solver_name,'Reading binary boundary-condition' // &
1686  ' variable file done.'
1687  END IF ! global%verbLevel
1688 
1689  CALL deregisterfunction(global)
1690 
1691 END SUBROUTINE rflu_bxv_readvarsbinary
1692 
1693 
1694 
1695 
1696 
1697 
1698 
1699 
1700 ! ******************************************************************************
1701 !
1702 ! Purpose: Wrapper for reading of boundary condition variables
1703 !
1704 ! Description: None.
1705 !
1706 ! Input:
1707 ! pRegion Pointer to region
1708 !
1709 ! Output: None.
1710 !
1711 ! Notes: None.
1712 !
1713 ! ******************************************************************************
1714 
1715 SUBROUTINE rflu_bxv_readvarswrapper(pRegion)
1716 
1717  IMPLICIT NONE
1718 
1719 ! ******************************************************************************
1720 ! Declarations and definitions
1721 ! ******************************************************************************
1722 
1723 ! ==============================================================================
1724 ! Arguments
1725 ! ==============================================================================
1726 
1727  TYPE(t_region), POINTER :: pregion
1728 
1729 ! ==============================================================================
1730 ! Local variables
1731 ! ==============================================================================
1732 
1733  TYPE(t_global), POINTER :: global
1734 
1735 ! ******************************************************************************
1736 ! Start
1737 ! ******************************************************************************
1738 
1739  global => pregion%global
1740 
1741  CALL registerfunction(global,'RFLU_BXV_ReadVarsWrapper',&
1742  'RFLU_ModBoundXvUtils.F90')
1743 
1744 ! ******************************************************************************
1745 ! Read bcv files
1746 ! ******************************************************************************
1747 
1748  IF ( rflu_nscbc_decidehavenscbc(pregion) .EQV. .true. ) THEN
1749  IF ( global%solutFormat == format_ascii ) THEN
1750  CALL rflu_bxv_readvarsascii(pregion)
1751  ELSE IF ( global%solutFormat == format_binary ) THEN
1752  CALL rflu_bxv_readvarsbinary(pregion)
1753  ELSE
1754  CALL errorstop(global,err_reached_default,__line__)
1755  END IF ! global%solutFormat
1756  END IF ! RFLU_NSCBC_DecideHaveNSCBC(pRegion)
1757 
1758 ! ******************************************************************************
1759 ! End
1760 ! ******************************************************************************
1761 
1762  CALL deregisterfunction(global)
1763 
1764 END SUBROUTINE rflu_bxv_readvarswrapper
1765 
1766 
1767 
1768 
1769 
1770 
1771 
1772 ! ******************************************************************************
1773 !
1774 ! Purpose: Set dependent variables on patches.
1775 !
1776 ! Description: None.
1777 !
1778 ! Input:
1779 ! pRegion Pointer to region
1780 !
1781 ! Output: None.
1782 !
1783 ! Notes: None.
1784 !
1785 ! ******************************************************************************
1786 
1787 SUBROUTINE rflu_bxv_setdependentvars(pRegion)
1788 
1789  IMPLICIT NONE
1790 
1791 ! ******************************************************************************
1792 ! Definitions and declarations
1793 ! ******************************************************************************
1794 
1795 ! ==============================================================================
1796 ! Arguments
1797 ! ==============================================================================
1798 
1799  TYPE(t_region), POINTER :: pregion
1800 
1801 ! ==============================================================================
1802 ! Locals
1803 ! ==============================================================================
1804 
1805  INTEGER :: ipatch
1806  TYPE(t_patch), POINTER :: ppatch
1807  TYPE(t_global), POINTER :: global
1808 
1809 ! ******************************************************************************
1810 ! Start
1811 ! ******************************************************************************
1812 
1813  global => pregion%global
1814 
1815  CALL registerfunction(global,'RFLU_BXV_SetDependentVars',&
1816  'RFLU_ModBoundXvUtils.F90')
1817 
1818 ! ******************************************************************************
1819 ! Loop over patches and set dependent variables if NSCBC active.
1820 ! ******************************************************************************
1821 
1822  DO ipatch = 1,pregion%grid%nPatches
1823  ppatch => pregion%patches(ipatch)
1824 
1825  IF (ppatch%bcKind == bc_kind_nscbc ) THEN
1826  CALL rflu_bxv_setdependentvarspatch(pregion,ppatch)
1827  END IF ! pPatch%bcKind
1828  END DO ! iPatch
1829 
1830 ! ******************************************************************************
1831 ! End
1832 ! ******************************************************************************
1833 
1834  CALL deregisterfunction(global)
1835 
1836 END SUBROUTINE rflu_bxv_setdependentvars
1837 
1838 
1839 
1840 
1841 
1842 
1843 ! ******************************************************************************
1844 !
1845 ! Purpose: Set dependent variables on patch.
1846 !
1847 ! Description: None.
1848 !
1849 ! Input:
1850 ! pRegion Pointer to region
1851 ! pPatch Pointer to patch
1852 !
1853 ! Output: None.
1854 !
1855 ! Notes: None.
1856 !
1857 ! ******************************************************************************
1858 
1859 SUBROUTINE rflu_bxv_setdependentvarspatch(pRegion,pPatch)
1860 
1861  IMPLICIT NONE
1862 
1863 ! ******************************************************************************
1864 ! Definitions and declarations
1865 ! ******************************************************************************
1866 
1867 ! ==============================================================================
1868 ! Arguments
1869 ! ==============================================================================
1870 
1871  TYPE(t_patch), POINTER :: ppatch
1872  TYPE(t_region), POINTER :: pregion
1873 
1874 ! ==============================================================================
1875 ! Locals
1876 ! ==============================================================================
1877 
1878  INTEGER :: ifl,icg,indcp,indmol
1879  REAL(RFREAL) :: cpgas,eo,ggas,ir,mm,r,u,v,w,p,rgas,vm2
1880  REAL(RFREAL), DIMENSION(:,:), POINTER :: pcv,pdv,pgv
1881  TYPE(t_global), POINTER :: global
1882 
1883 ! ******************************************************************************
1884 ! Start
1885 ! ******************************************************************************
1886 
1887  global => pregion%global
1888 
1889  CALL registerfunction(global,'RFLU_BXV_SetDependentVarsPatch',&
1890  'RFLU_ModBoundXvUtils.F90')
1891 
1892 ! ******************************************************************************
1893 ! Set variables and pointers
1894 ! ******************************************************************************
1895 
1896  pcv => ppatch%mixt%cv
1897  pdv => ppatch%mixt%dv
1898  pgv => pregion%mixt%gv ! NOTE gv taken from cells for now
1899 
1900  indcp = pregion%mixtInput%indCp
1901  indmol = pregion%mixtInput%indMol
1902 
1903 ! ******************************************************************************
1904 ! Compute dependent variables
1905 ! ******************************************************************************
1906 
1907  SELECT CASE ( pregion%mixtInput%fluidModel )
1908 
1909 ! ==============================================================================
1910 ! Incompressible fluid model
1911 ! ==============================================================================
1912 
1913  CASE ( fluid_model_incomp )
1914 
1915 ! ==============================================================================
1916 ! Compressible fluid model. NOTE check state of solution vector.
1917 ! ==============================================================================
1918 
1919  CASE ( fluid_model_comp )
1920  SELECT CASE ( pregion%mixtInput%gasModel )
1921 
1922 ! ------------------------------------------------------------------------------
1923 ! Thermally and calorically perfect gas (single species)
1924 ! ------------------------------------------------------------------------------
1925 
1926  CASE ( gas_model_tcperf )
1927  IF ( ppatch%mixt%cvState /= cv_mixt_state_cons ) THEN
1928  CALL errorstop(global,err_cv_state_invalid,__line__)
1929  END IF ! pPatch%mixt%cvState
1930 
1931  DO ifl = 1,ppatch%nBFaces
1932  icg = ppatch%bf2c(ifl)
1933 
1934  mm = pgv(gv_mixt_mol,icg*indmol)
1935  cpgas = pgv(gv_mixt_cp,icg*indcp)
1936  rgas = mixtperf_r_m(mm)
1937  ggas = mixtperf_g_cpr(cpgas,rgas)
1938 
1939  r = pcv(cv_mixt_dens,ifl)
1940  ir = 1.0_rfreal/r
1941 
1942  u = ir*pcv(cv_mixt_xmom,ifl)
1943  v = ir*pcv(cv_mixt_ymom,ifl)
1944  w = ir*pcv(cv_mixt_zmom,ifl)
1945  eo = ir*pcv(cv_mixt_ener,ifl)
1946 
1947  vm2 = u*u + v*v + w*w
1948 
1949  p = mixtperf_p_deogvm2(r,eo,ggas,vm2)
1950 
1951  pdv(dv_mixt_pres,ifl) = p
1952  pdv(dv_mixt_temp,ifl) = mixtperf_t_dpr(r,pdv(dv_mixt_pres,ifl),rgas)
1953  pdv(dv_mixt_soun,ifl) = mixtperf_c_grt(ggas,rgas, &
1954  pdv(dv_mixt_temp,ifl))
1955  END DO ! ifl
1956 
1957 ! ------------------------------------------------------------------------------
1958 ! Default
1959 ! ------------------------------------------------------------------------------
1960 
1961  CASE default
1962  CALL errorstop(global,err_reached_default,__line__)
1963  END SELECT ! pRegion%mixtInput%gasModel
1964 
1965 ! ==============================================================================
1966 ! Default
1967 ! ==============================================================================
1968 
1969  CASE default
1970  CALL errorstop(global,err_reached_default,__line__)
1971  END SELECT ! pRegion%mixtInput%fluidModel
1972 
1973 ! ******************************************************************************
1974 ! End
1975 ! ******************************************************************************
1976 
1977  CALL deregisterfunction(global)
1978 
1979 END SUBROUTINE rflu_bxv_setdependentvarspatch
1980 
1981 
1982 
1983 
1984 
1985 
1986 
1987 ! ******************************************************************************
1988 !
1989 ! Purpose: Write solution on patches in ASCII format.
1990 !
1991 ! Description: None.
1992 !
1993 ! Input:
1994 ! pRegion Pointer to region
1995 ! pPatch Pointer to patch
1996 !
1997 ! Output: None.
1998 !
1999 ! Notes: None.
2000 !
2001 ! ******************************************************************************
2002 
2003 SUBROUTINE rflu_bxv_writevarsascii(pRegion)
2004 
2007 
2008  IMPLICIT NONE
2009 
2010 ! ******************************************************************************
2011 ! Declarations and definitions
2012 ! ******************************************************************************
2013 
2014 ! ==============================================================================
2015 ! Arguments
2016 ! ==============================================================================
2017 
2018  TYPE(t_region), POINTER :: pregion
2019 
2020 ! ==============================================================================
2021 ! Local variables
2022 ! ==============================================================================
2023 
2024  CHARACTER(CHRLEN) :: ifilename,sectionstring
2025  INTEGER :: dummyinteger,errorflag,idata,ifile,ifl,ipatch
2026  TYPE(t_grid), POINTER :: pgrid
2027  TYPE(t_patch), POINTER :: ppatch
2028  TYPE(t_global), POINTER :: global
2029 
2030 ! ******************************************************************************
2031 ! Start
2032 ! ******************************************************************************
2033 
2034  global => pregion%global
2035 
2036  CALL registerfunction(global,'RFLU_BXV_WriteVarsASCII',&
2037  'RFLU_ModBoundXvUtils.F90')
2038 
2039  IF ( global%myProcid == masterproc .AND. &
2040  global%verbLevel > verbose_none ) THEN
2041  WRITE(stdout,'(A,1X,A)') solver_name,'Writing ASCII boundary-condition' // &
2042  ' variable file...'
2043  END IF ! global%verbLevel
2044 
2045 ! ******************************************************************************
2046 ! Set pointers
2047 ! ******************************************************************************
2048 
2049  pgrid => pregion%grid
2050 
2051 ! ******************************************************************************
2052 ! Open file
2053 ! ******************************************************************************
2054 
2055  ifile = if_distr
2056 
2057  IF ( global%flowType == flow_unsteady ) THEN
2058  CALL buildfilenameunsteady(global,filedest_indir,'.bcva', &
2059  pregion%iRegionGlobal,global%currentTime, &
2060  ifilename)
2061  ELSE
2062  CALL buildfilenamesteady(global,filedest_indir,'.bcva', &
2063  pregion%iRegionGlobal,global%currentIter, &
2064  ifilename)
2065  ENDIF ! global%flowType
2066 
2067  OPEN(ifile,file=ifilename,form='FORMATTED',status='UNKNOWN', &
2068  iostat=errorflag)
2069  global%error = errorflag
2070  IF ( global%error /= err_none ) THEN
2071  CALL errorstop(global,err_file_open,__line__,'File: '//trim(ifilename))
2072  END IF ! global%error
2073 
2074 ! ******************************************************************************
2075 ! Write header
2076 ! ******************************************************************************
2077 
2078  sectionstring = '# ROCFLU boundary-condition variable file'
2079  WRITE(ifile,'(A)') sectionstring
2080 
2081 ! ******************************************************************************
2082 ! Loop over patches
2083 ! ******************************************************************************
2084 
2085  DO ipatch = 1,pgrid%nPatches
2086  ppatch => pregion%patches(ipatch)
2087 
2088 ! ==============================================================================
2089 ! If bcKind = NSCBC, write data
2090 ! ==============================================================================
2091 
2092  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
2093  WRITE(ifile,'(A)') '# Patch data'
2094  WRITE(ifile,'(2(1X,I3),1X,I6,1X,I2)') ipatch,ppatch%iPatchGlobal, &
2095  ppatch%nBFaces, &
2096  pregion%mixtInput%nCv
2097 
2098  DO ifl = 1,ppatch%nBFaces
2099  DO idata = 1,pregion%mixtInput%nCv
2100  WRITE(ifile,'(1X,I6,1X,I2,1X,E23.16)') ifl,idata, &
2101  ppatch%mixt%cv(idata,ifl)
2102  END DO ! iData
2103  END DO ! ifl
2104  END IF ! pPatch%bcKind
2105  END DO ! iPatch
2106 
2107 ! ******************************************************************************
2108 ! Write footer
2109 ! ******************************************************************************
2110 
2111  sectionstring = '# End'
2112  WRITE(ifile,'(A)') sectionstring
2113 
2114 ! ******************************************************************************
2115 ! Close file
2116 ! ******************************************************************************
2117 
2118  CLOSE(ifile,iostat=errorflag)
2119  global%error = errorflag
2120  IF ( global%error /= err_none ) THEN
2121  CALL errorstop(global,err_file_close,__line__,'File: '//trim(ifilename))
2122  END IF ! global%error
2123 
2124 ! ******************************************************************************
2125 ! End
2126 ! ******************************************************************************
2127 
2128  IF ( global%myProcid == masterproc .AND. &
2129  global%verbLevel > verbose_none ) THEN
2130  WRITE(stdout,'(A,1X,A)') solver_name,'Writing ASCII boundary-condition' // &
2131  ' variable file done.'
2132  END IF ! global%verbLevel
2133 
2134  CALL deregisterfunction(global)
2135 
2136 END SUBROUTINE rflu_bxv_writevarsascii
2137 
2138 
2139 
2140 
2141 
2142 
2143 
2144 ! ******************************************************************************
2145 !
2146 ! Purpose: Write solution on patches in binary format.
2147 !
2148 ! Description: None.
2149 !
2150 ! Input:
2151 ! pRegion Pointer to region
2152 !
2153 ! Output: None.
2154 !
2155 ! Notes: None.
2156 !
2157 ! ******************************************************************************
2158 
2159 SUBROUTINE rflu_bxv_writevarsbinary(pRegion)
2160 
2163 
2164  IMPLICIT NONE
2165 
2166 ! ******************************************************************************
2167 ! Declarations and definitions
2168 ! ******************************************************************************
2169 
2170 ! ==============================================================================
2171 ! Arguments
2172 ! ==============================================================================
2173 
2174  TYPE(t_region), POINTER :: pregion
2175 
2176 ! ==============================================================================
2177 ! Local variables
2178 ! ==============================================================================
2179 
2180  CHARACTER(CHRLEN) :: ifilename,sectionstring
2181  INTEGER :: dummyinteger,errorflag,idata,ifile,ifl,ipatch
2182  TYPE(t_grid), POINTER :: pgrid
2183  TYPE(t_patch), POINTER :: ppatch
2184  TYPE(t_global), POINTER :: global
2185 
2186 ! ******************************************************************************
2187 ! Start
2188 ! ******************************************************************************
2189 
2190  global => pregion%global
2191 
2192  CALL registerfunction(global,'RFLU_BXV_WriteVarsBinary',&
2193  'RFLU_ModBoundXvUtils.F90')
2194 
2195  IF ( global%myProcid == masterproc .AND. &
2196  global%verbLevel > verbose_none ) THEN
2197  WRITE(stdout,'(A,1X,A)') solver_name,'Writing binary boundary-condition' // &
2198  ' variable file...'
2199  END IF ! global%verbLevel
2200 
2201 ! ******************************************************************************
2202 ! Set pointers
2203 ! ******************************************************************************
2204 
2205  pgrid => pregion%grid
2206 
2207 ! ******************************************************************************
2208 ! Open file
2209 ! ******************************************************************************
2210 
2211  ifile = if_distr
2212 
2213  IF ( global%flowType == flow_unsteady ) THEN
2214  CALL buildfilenameunsteady(global,filedest_indir,'.bcv', &
2215  pregion%iRegionGlobal,global%currentTime, &
2216  ifilename)
2217  ELSE
2218  CALL buildfilenamesteady(global,filedest_indir,'.bcv', &
2219  pregion%iRegionGlobal,global%currentIter, &
2220  ifilename)
2221  ENDIF ! global%flowType
2222 
2223  OPEN(ifile,file=ifilename,form='UNFORMATTED',status='UNKNOWN', &
2224  iostat=errorflag)
2225  global%error = errorflag
2226  IF ( global%error /= err_none ) THEN
2227  CALL errorstop(global,err_file_open,__line__,'File: '//trim(ifilename))
2228  END IF ! global%error
2229 
2230 ! ******************************************************************************
2231 ! Write header
2232 ! ******************************************************************************
2233 
2234  sectionstring = '# ROCFLU boundary-condition variable file'
2235  WRITE(ifile) sectionstring
2236 
2237 ! ******************************************************************************
2238 ! Loop over patches
2239 ! ******************************************************************************
2240 
2241  DO ipatch = 1,pgrid%nPatches
2242  ppatch => pregion%patches(ipatch)
2243 
2244 ! ==============================================================================
2245 ! If bcKind = NSCBC, write data
2246 ! ==============================================================================
2247 
2248  IF ( ppatch%bcKind == bc_kind_nscbc ) THEN
2249  sectionstring = '# Patch data'
2250  WRITE(ifile) sectionstring
2251  WRITE(ifile) ipatch,ppatch%iPatchGlobal,ppatch%nBFaces, &
2252  pregion%mixtInput%nCv
2253 
2254  DO ifl = 1,ppatch%nBFaces
2255  DO idata = 1,pregion%mixtInput%nCv
2256  WRITE(ifile) ifl,idata,ppatch%mixt%cv(idata,ifl)
2257  END DO ! iData
2258  END DO ! ifl
2259  END IF ! pPatch%bcKind
2260  END DO ! iPatch
2261 
2262 ! ******************************************************************************
2263 ! Write footer
2264 ! ******************************************************************************
2265 
2266  sectionstring = '# End'
2267  WRITE(ifile) sectionstring
2268 
2269 ! ******************************************************************************
2270 ! Close file
2271 ! ******************************************************************************
2272 
2273  CLOSE(ifile,iostat=errorflag)
2274  global%error = errorflag
2275  IF ( global%error /= err_none ) THEN
2276  CALL errorstop(global,err_file_close,__line__,'File: '//trim(ifilename))
2277  END IF ! global%error
2278 
2279 ! ******************************************************************************
2280 ! End
2281 ! ******************************************************************************
2282 
2283  IF ( global%myProcid == masterproc .AND. &
2284  global%verbLevel > verbose_none ) THEN
2285  WRITE(stdout,'(A,1X,A)') solver_name,'Writing binary boundary-condition' // &
2286  ' variable file done.'
2287  END IF ! global%verbLevel
2288 
2289  CALL deregisterfunction(global)
2290 
2291 END SUBROUTINE rflu_bxv_writevarsbinary
2292 
2293 
2294 
2295 
2296 
2297 
2298 
2299 ! ******************************************************************************
2300 !
2301 ! Purpose: Wrapper for writing of boundary condition variables
2302 !
2303 ! Description: None.
2304 !
2305 ! Input:
2306 ! pRegion Pointer to region
2307 !
2308 ! Output: None.
2309 !
2310 ! Notes: None.
2311 !
2312 ! ******************************************************************************
2313 
2314 SUBROUTINE rflu_bxv_writevarswrapper(pRegion)
2315 
2316  IMPLICIT NONE
2317 
2318 ! ******************************************************************************
2319 ! Declarations and definitions
2320 ! ******************************************************************************
2321 
2322 ! ==============================================================================
2323 ! Arguments
2324 ! ==============================================================================
2325 
2326  TYPE(t_region), POINTER :: pregion
2327 
2328 ! ==============================================================================
2329 ! Local variables
2330 ! ==============================================================================
2331 
2332  TYPE(t_global), POINTER :: global
2333 
2334 ! ******************************************************************************
2335 ! Start
2336 ! ******************************************************************************
2337 
2338  global => pregion%global
2339 
2340  CALL registerfunction(global,'RFLU_BXV_WriteVarsWrapper',&
2341  'RFLU_ModBoundXvUtils.F90')
2342 
2343 ! ******************************************************************************
2344 ! Read bcv files
2345 ! ******************************************************************************
2346 
2347  IF ( rflu_nscbc_decidehavenscbc(pregion) .EQV. .true. ) THEN
2348  IF ( global%solutFormat == format_ascii ) THEN
2349  CALL rflu_bxv_writevarsascii(pregion)
2350  ELSE IF ( global%solutFormat == format_binary ) THEN
2351  CALL rflu_bxv_writevarsbinary(pregion)
2352  ELSE
2353  CALL errorstop(global,err_reached_default,__line__)
2354  END IF ! global%solutFormat
2355  END IF ! RFLU_NSCBC_DecideHaveNSCBC(pRegion)
2356 
2357 ! ******************************************************************************
2358 ! End
2359 ! ******************************************************************************
2360 
2361  CALL deregisterfunction(global)
2362 
2363 END SUBROUTINE rflu_bxv_writevarswrapper
2364 
2365 
2366 
2367 
2368 
2369 
2370 END MODULE rflu_modboundxvutils
2371 
2372 ! ******************************************************************************
2373 !
2374 ! RCS Revision history:
2375 !
2376 ! $Log: RFLU_ModBoundXvUtils.F90,v $
2377 ! Revision 1.6 2008/12/06 08:44:20 mtcampbe
2378 ! Updated license.
2379 !
2380 ! Revision 1.5 2008/11/19 22:17:31 mtcampbe
2381 ! Added Illinois Open Source License/Copyright
2382 !
2383 ! Revision 1.4 2006/10/20 21:17:43 mparmar
2384 ! Modified read/write of binary boundary variable files
2385 !
2386 ! Revision 1.3 2006/08/21 16:11:19 haselbac
2387 ! Clean-up: comments, order of routines, missing headers, indentation, etc
2388 !
2389 ! Revision 1.2 2006/08/19 19:44:08 haselbac
2390 ! Significant clean-up and cosmetic changes
2391 !
2392 ! Revision 1.1 2006/08/19 15:37:40 mparmar
2393 ! Initial revision
2394 !
2395 ! ******************************************************************************
2396 
2397 
2398 
2399 
2400 
2401 
2402 
2403 
2404 
2405 
2406 
2407 
2408 
2409 
2410 
2411 
2412 
2413 
2414 
2415 
2416 
2417 
2418 
2419 
2420 
2421 
2422 
subroutine, public rflu_bxv_createvarststep(pRegion)
subroutine, public rflu_bxv_destroyvarststep(pRegion)
unsigned char r() const
Definition: Color.h:68
real(rfreal) function mixtperf_p_deogvm2(D, Eo, G, Vm2)
Definition: MixtPerf_P.F90:39
real(rfreal) function mixtperf_r_m(M)
Definition: MixtPerf_R.F90:54
subroutine, public rflu_nscbc_initsw(pRegion, pPatch)
subroutine, public rflu_nscbc_initiftotang(pRegion, pPatch)
subroutine, public rflu_bxv_readvarsbinary(pRegion)
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
int status() const
Obtain the status of the attribute.
Definition: Attribute.h:240
subroutine, public rflu_bxv_destroyvarsdv(pRegion)
subroutine, private rflu_bxv_setdependentvarspatch(pRegion, pPatch)
subroutine, public rflu_nscbc_initff(pRegion, pPatch)
subroutine, public rflu_bxv_nullifyvarststep(pRegion)
subroutine, public rflu_nscbc_initifveltemp(pRegion, pPatch)
*********************************************************************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
subroutine, public rflu_nscbc_initnswtemp(pRegion, pPatch)
subroutine, public rflu_bxv_nullifyvarscv(pRegion)
LOGICAL function, public rflu_nscbc_decidehavenscbc(pRegion)
subroutine, private rflu_bxv_compmomenergypatch(pRegion, pPatch)
subroutine, public rflu_bxv_destroyvarscv(pRegion)
subroutine, public rflu_bxv_createvarsdv(pRegion)
subroutine, public rflu_bxv_writevarsbinary(pRegion)
subroutine, public rflu_bxv_readvarswrapper(pRegion)
subroutine, public rflu_bxv_initvars(pRegion)
**********************************************************************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 form
real(rfreal) function mixtperf_t_dpr(D, P, R)
Definition: MixtPerf_T.F90:85
subroutine, public rflu_bxv_setdependentvars(pRegion)
subroutine, private rflu_bxv_compenergypatch(pRegion, pPatch)
real(rfreal) function mixtperf_c_grt(G, R, T)
Definition: MixtPerf_C.F90:86
subroutine, public rflu_nscbc_initof(pRegion, pPatch)
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, public rflu_bxv_computevarscv(pRegion)
subroutine, public rflu_nscbc_initij(pRegion, pPatch)
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine, public rflu_bxv_writevarsascii(pRegion)
real(rfreal) function mixtperf_g_cpr(Cp, R)
Definition: MixtPerf_G.F90:39
subroutine, public rflu_bxv_readvarsascii(pRegion)
subroutine, public rflu_bxv_nullifyvarsdv(pRegion)
subroutine, public rflu_bxv_writevarswrapper(pRegion)
real(rfreal) function mixtperf_eo_grtuvw(G, R, T, U, V, W)
Definition: MixtPerf_E.F90:70
subroutine, public rflu_nscbc_initnswheat(pRegion, pPatch)
unsigned char g() const
Definition: Color.h:69
subroutine buildfilenamesteady(global, dest, ext, id, it, fileName)
subroutine buildfilenameunsteady(global, dest, ext, id, tm, fileName)
subroutine, public rflu_bxv_createvarscv(pRegion)