Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UpdateTbcWhitenoise.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: update values for Whitenoise TBC
26 !
27 ! Description: none.
28 !
29 ! Input: pointer to TBC
30 !
31 ! Output: modifies TBC data
32 !
33 ! Notes:
34 !
35 ! * Example input section:
36 !
37 !-----
38 ! # TBC_WHITENOISE
39 ! NOSLIP TWALL ! BC and variable to which TBC applies
40 ! BLOCK 0 0 ! applies to block ... (0 0 = to all)
41 ! PATCH 0 0 ! applies to patch ... (0 0 = to all patches from blocks)
42 ! ONTIME 5.e-5 ! time to start using this TBC
43 ! OFFTIME 1.e-2 ! time to stop using this TBC
44 ! AMP 0.2 ! maximum amplitude of added stochastic component
45 ! SUBSTEP 1 ! 0 = new value each step (default), 1 = each sub-step
46 ! #
47 !-----
48 !
49 ! * The value used in the boundary condition is the one input times the factor
50 ! 1 + AMP*xi (where xi is a uniformly generated random number on [-1,1]),
51 ! provided OFFTIME <= t <= ONTIME. The factor is different for every cell.
52 !
53 ! * The values produced are discontinuous in time (for value continuous in time,
54 ! use the STOCHASTIC TBC instead). They are independent in space.
55 !
56 !******************************************************************************
57 !
58 ! $Id: UpdateTbcWhitenoise.F90,v 1.3 2008/12/06 08:44:10 mtcampbe Exp $
59 !
60 ! Copyright: (c) 2001 by the University of Illinois
61 !
62 !******************************************************************************
63 
64 SUBROUTINE updatetbcwhitenoise( region,tbc )
65 
66  USE moddatatypes
67  USE modbndpatch, ONLY : t_tbcvalues
68  USE moddatastruct, ONLY : t_region
69  USE modglobal, ONLY : t_global
70  USE modparameters
71  USE modrandom, ONLY : randuniform
72  USE moderror
73  IMPLICIT NONE
74 
75 ! ... parameters
76  TYPE(t_region), INTENT(INOUT) :: region
77  TYPE(t_tbcvalues), INTENT(INOUT) :: tbc
78 
79 ! ... local variables
80  TYPE(t_global), POINTER :: global
81 
82 !******************************************************************************
83 
84  global => region%global
85 
86  CALL registerfunction( global,'UpdateTbcWhitenoise',&
87  'UpdateTbcWhitenoise.F90' )
88 
89  CALL randuniform(tbc%bvals(tbcsto_val,:),region%randData)
90 
91  tbc%bvals(tbcsto_val,:) = tbc%params(tbcdat_amp) * &
92  (2.0_rfreal*tbc%bvals(tbcsto_val,:) - 1.0_rfreal)
93 
94 ! finalize --------------------------------------------------------------------
95 
96  CALL deregisterfunction( global )
97 
98 END SUBROUTINE updatetbcwhitenoise
99 
100 !******************************************************************************
101 !
102 ! RCS Revision history:
103 !
104 ! $Log: UpdateTbcWhitenoise.F90,v $
105 ! Revision 1.3 2008/12/06 08:44:10 mtcampbe
106 ! Updated license.
107 !
108 ! Revision 1.2 2008/11/19 22:17:24 mtcampbe
109 ! Added Illinois Open Source License/Copyright
110 !
111 ! Revision 1.1 2004/12/01 16:52:14 haselbac
112 ! Initial revision after changing case
113 !
114 ! Revision 1.9 2003/11/21 22:33:10 fnajjar
115 ! Updated Random Number Generator
116 !
117 ! Revision 1.8 2003/06/10 22:54:23 jferry
118 ! Added documentation for input section
119 !
120 ! Revision 1.7 2003/05/15 02:57:02 jblazek
121 ! Inlined index function.
122 !
123 ! Revision 1.6 2003/02/17 20:53:11 jferry
124 ! corrected misplaced assignment of global
125 !
126 ! Revision 1.5 2003/02/17 19:31:12 jferry
127 ! Implemented portable random number generator ModRandom
128 !
129 ! Revision 1.4 2002/09/27 00:57:09 jblazek
130 ! Changed makefiles - no makelinks needed.
131 !
132 ! Revision 1.3 2002/09/25 18:29:57 jferry
133 ! simplified TBC parameter lists
134 !
135 ! Revision 1.2 2002/09/20 22:22:35 jblazek
136 ! Finalized integration into GenX.
137 !
138 ! Revision 1.1 2002/09/17 13:43:00 jferry
139 ! Added Time-dependent boundary conditions
140 !
141 !******************************************************************************
142 
143 
144 
145 
146 
147 
148 
subroutine registerfunction(global, funName, fileName)
Definition: ModError.F90:449
subroutine randuniform(a, rdata)
Definition: ModRandom.F90:135
subroutine deregisterfunction(global)
Definition: ModError.F90:469
subroutine updatetbcwhitenoise(region, tbc)