File: RELATIVE:/../../../mfix.git/model/mms_mod.f

1     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
2     !                                                                      !
3     !  Module name: MMS_SRC                                                !
4     !  Purpose: Global storage containers for MMS variables.               !
5     !                                                                      !
6     !  Author: Aniruddha Choudhary                        Date: 17-Oct-11  !
7     !  email: anirudd@vt.edu                                               !
8     !                                                                      !
9     !  Reviewer: J.Musser                                 Date: 04-Dec-13  !
10     !                                                                      !
11     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
12           MODULE mms
13     
14     ! By default the MMS functions are unavailable.
15           LOGICAL :: USE_MMS = .FALSE.
16     
17     !! Method of Manufactured Solutions (MMS) and Tecplot variables :
18     
19     ! Gas volume fraction
20           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_Ep_g
21     
22     ! Gas pressure
23           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_P_g
24     
25     ! Gas velocity components
26           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_U_g
27           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_V_g
28           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_W_g
29     
30     ! Gas temperature
31           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_T_g
32     
33     ! Solid bulk density
34           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_ROP_s
35     
36     ! Solids velocity components
37           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_U_s
38           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_V_s
39           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_W_s
40     
41     ! Solids temperature
42           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_T_s
43     
44     ! Granular temperature
45           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_Theta_m
46     
47     ! Gas continuity MMS source term
48           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_ROP_g_Src
49     
50     ! Gas Momentum source terms
51           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_U_g_Src
52           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_V_g_Src
53           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_W_g_Src
54     
55     ! Gas energy equation MMS source term
56           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_T_g_Src
57     
58     ! Solid continuity MMS source term
59           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_ROP_s_Src
60     
61     ! Solid momentum MMS source terms
62           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_U_s_Src
63           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_V_s_Src
64           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_W_s_Src
65     
66     ! Solid energy equation MMS source term
67           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_T_s_Src
68     
69     ! Granular energy MMS source term
70           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  MMS_Theta_m_Src
71     
72     ! Temporary variable for pressure shifting while plotting and
73     ! discretization error norm calculation
74           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  P_G_Sh
75     
76     ! Index for pressure shifting
77           INTEGER :: IJK_Sh
78     
79     !  x, y, z locations of top-right corner of a cell
80           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  xtr
81           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  ytr
82           DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE ::  ztr
83     
84           contains
85     
86     
87     
88     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
89     !                                                                      !
90     !  Module name: ALLOCATE_MMS_VARS                                      !
91     !  Purpose: Allocate memory for allocatable variables defined inside   !
92     !  MMS module.                                                         !
93     !                                                                      !
94     !  Author: Aniruddha Choudhary                        Date: Feb 2015   !
95     !                                                                      !
96     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
97           SUBROUTINE ALLOCATE_MMS_VARS
98           use param, only   : DIMENSION_3
99     
100           IMPLICIT NONE
101     
102     ! Note: both fluid and solid phase variables can be of size DIMENSION_3
103     ! since MMS tests do not work for more than one solid phase.
104     
105             allocate(MMS_Ep_g(DIMENSION_3))
106             allocate(MMS_P_g(DIMENSION_3))
107             allocate(MMS_U_g(DIMENSION_3))
108             allocate(MMS_V_g(DIMENSION_3))
109             allocate(MMS_W_g(DIMENSION_3))
110             allocate(MMS_T_g(DIMENSION_3))
111     
112             allocate(MMS_ROP_s(DIMENSION_3))
113             allocate(MMS_U_s(DIMENSION_3))
114             allocate(MMS_V_s(DIMENSION_3))
115             allocate(MMS_W_s(DIMENSION_3))
116             allocate(MMS_T_s(DIMENSION_3))
117             allocate(MMS_Theta_m(DIMENSION_3))
118     
119             allocate(MMS_ROP_g_Src(DIMENSION_3))
120             allocate(MMS_U_g_Src(DIMENSION_3))
121             allocate(MMS_V_g_Src(DIMENSION_3))
122             allocate(MMS_W_g_Src(DIMENSION_3))
123             allocate(MMS_T_g_Src(DIMENSION_3))
124     
125             allocate(MMS_ROP_s_Src(DIMENSION_3))
126             allocate(MMS_U_s_Src(DIMENSION_3))
127             allocate(MMS_V_s_Src(DIMENSION_3))
128             allocate(MMS_W_s_Src(DIMENSION_3))
129             allocate(MMS_T_s_Src(DIMENSION_3))
130             allocate(MMS_Theta_m_Src(DIMENSION_3))
131     
132             allocate(P_g_Sh(DIMENSION_3))
133     
134             allocate(xtr(DIMENSION_3))
135             allocate(ytr(DIMENSION_3))
136             allocate(ztr(DIMENSION_3))
137     
138     
139           RETURN
140           END SUBROUTINE ALLOCATE_MMS_VARS
141     
142     
143     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
144     !                                                                      !
145     !  Module name: DEALLOCATE_MMS_VARS                                    !
146     !  Purpose: Deallocate memory for allocatable variables defined inside !
147     !  MMS module.                                                         !
148     !                                                                      !
149     !  Author: Aniruddha Choudhary                        Date: Feb 2015   !
150     !                                                                      !
151     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
152           SUBROUTINE DEALLOCATE_MMS_VARS
153     
154           IMPLICIT NONE
155     
156     
157             deallocate(MMS_Ep_g)
158             deallocate(MMS_P_g)
159             deallocate(MMS_U_g)
160             deallocate(MMS_V_g)
161             deallocate(MMS_W_g)
162             deallocate(MMS_T_g)
163     
164             deallocate(MMS_ROP_s)
165             deallocate(MMS_U_s)
166             deallocate(MMS_V_s)
167             deallocate(MMS_W_s)
168             deallocate(MMS_T_s)
169             deallocate(MMS_Theta_m)
170     
171             deallocate(MMS_ROP_g_Src)
172             deallocate(MMS_U_g_Src)
173             deallocate(MMS_V_g_Src)
174             deallocate(MMS_W_g_Src)
175             deallocate(MMS_T_g_Src)
176     
177             deallocate(MMS_ROP_s_Src)
178             deallocate(MMS_U_s_Src)
179             deallocate(MMS_V_s_Src)
180             deallocate(MMS_W_s_Src)
181             deallocate(MMS_T_s_Src)
182             deallocate(MMS_Theta_m_Src)
183     
184             deallocate(P_g_Sh)
185     
186             deallocate(xtr)
187             deallocate(ytr)
188             deallocate(ztr)
189     
190           RETURN
191           END SUBROUTINE DEALLOCATE_MMS_VARS
192     
193     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
194     !                                                                      !
195     !  Module name:CALCULATE_MMS                                           !
196     !  Purpose: Generic stub/placeholder for MMS analytical solutions.     !
197     !                                                                      !
198     !  Author: J.Musser                                   Date: 04-Dec-13  !
199     !                                                                      !
200     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
201           SUBROUTINE CALCULATE_MMS
202     
203           IMPLICIT NONE
204     
205           RETURN
206           END SUBROUTINE CALCULATE_MMS
207     
208     !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv!
209     !                                                                      !
210     !  Module name:CALCULATE_MMS_SOURCE                                    !
211     !  Purpose: Generic stub/placeholder for MMS source terms.             !
212     !                                                                      !
213     !  Author: J.Musser                                   Date: 04-Dec-13  !
214     !                                                                      !
215     !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!
216           SUBROUTINE CALCULATE_MMS_SOURCE
217     
218           IMPLICIT NONE
219     
220           RETURN
221           End SUBROUTINE CALCULATE_MMS_SOURCE
222     
223           END MODULE mms
224