-
Notifications
You must be signed in to change notification settings - Fork 0
/
INV_test_DK.i
269 lines (248 loc) · 5.17 KB
/
INV_test_DK.i
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# Simple inlet-flux-driven flow dynamics simulation with MOOSE Navier-Stokes Modules
# Activation of navier_stokes module is required during compiling the code.
# Incompressible fluid flow with gravity in 3D
# To verify Bernoulli's principle; check the auxiliary variable 'Check_Bernoulli'
[Mesh]
type = FileMesh
file = test_Bernoulli_rectangle.msh
[]
mu=8.90e-4 #[Pa*s] Viscosity of water @ 298K
rho=1000.0 #[kg/m^3] density of water @ 298K
[GlobalParams]
#Variable coupling and naiming
u = vel_x
v = vel_y
w = vel_z
p = p
#Stabilization Parameters
supg = true
pspg = true
alpha = 1e0
#Problem coefficients
gravity = '0 0 0'
#Weak form customization
convective_term = true
integrate_p_by_parts = true
transient_term = true
laplace = true
[]
[Variables]
[./vel_x]
order = FIRST
family = LAGRANGE
[../]
[./vel_y]
order = FIRST
family = LAGRANGE
[../]
[./vel_z]
order = FIRST
family = LAGRANGE
[../]
[./p]
order = FIRST
family = LAGRANGE
[../]
[]
#[AuxVariables]
# [./Check_Bernoulli]
# order = FIRST
# family = SCALAR
# [../]
#[]
[ICs]
[./IC_vel_x]
type = ConstantIC
variable = vel_x
value = 0.0
[../]
[./IC_vel_y]
type = ConstantIC
variable = vel_y
value = 0.0
[../]
[./IC_vel_z]
type = ConstantIC
variable = vel_z
value = 0.0
[../]
#[./IC_pressure]
# type = ConstantIC
# variable = p
# value = 0.0
#[../]
[]
[Kernels]
#Continuity equations
[./mass]
type = INSMass
variable = p
[../]
#Time derivative of vel_x
[./x_time]
type = INSMomentumTimeDerivative
variable = vel_x
[../]
[./x_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_x
component = 0 #May be x:0, y:1, z:2 ?
[../]
#Time derivative of vel_y
[./y_time]
type = INSMomentumTimeDerivative
variable = vel_y
[../]
[./y_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_y
component = 1 #May be x:0, y:1, z:2 ?
[../]
#Time derivative of vel_z
[./z_time]
type = INSMomentumTimeDerivative
variable = vel_z
[../]
[./z_momentum_space]
type = INSMomentumLaplaceForm
variable = vel_z
component = 2 #May be x:0, y:1, z:2 ?
[../]
[]
[Functions]
[./Inlet_vel]
type = ParsedFunction
value = '0.05*(1-(x-0.1)*(x+0.1))*(1-(y-0.1)*(y+0.1))'
[../]
[]
[BCs]
[./vel_x_inlet]
type = DirichletBC
variable = vel_x
value = 0.0
boundary = inlet
[../]
[./vel_y_inlet]
type = DirichletBC
variable = vel_y
value = 0.0
boundary = inlet
[../]
[./vel_z_inlet]
type = FunctionDirichletBC
function = Inlet_vel
variable = vel_z
boundary = inlet
[../]
[./vel_x_wall] #no-slip boundary conditions
type = DirichletBC
variable = vel_x
value = 0.0
boundary = wall
[../]
[./vel_y_wall] #no-slip boundary conditions
type = DirichletBC
variable = vel_y
value = 0.0
boundary = wall
[../]
[./vel_z_wall] #no-slip boundary conditions
type = DirichletBC
variable = vel_z
value = 0.0
boundary = wall
[../]
#BC for outlet
#[./vel_x_outlet]
# type = INSMomentumNoBCBCLaplaceForm
# variable = vel_x
# boundary = outlet
# u = vel_x
# v = vel_y
# w = vel_z
# p = p
# component = 0
#[../]
#[./vel_y_outlet]
# type = INSMomentumNoBCBCLaplaceForm
# variable = vel_y
# boundary = outlet
# u = vel_x
# v = vel_y
# w = vel_z
# p = p
# component = 1
#[../]
#[./vel_z_outlet]
# type = INSMomentumNoBCBCLaplaceForm
# variable = vel_z
# boundary = outlet
# u = vel_x
# v = vel_y
# w = vel_z
# p = p
# component = 2
#[../]
#BC for pressure; natural BC
[]
[Materials]
[./Constants]
type = GenericConstantMaterial
prop_names = 'rho mu'
prop_values = '1000 8.9e-4'
[../]
[./dymamic_pressure]
type = DerivativeParsedMaterial
f_name = p_dynamic
constant_names = 'rho0'
constant_expressions = '1000'
args = 'vel_x vel_y vel_z'
function = '0.5*rho0*(vel_x^2+vel_y^2+vel_z^2)'
outputs = exodus
[../]
[./total_pressure]
type = DerivativeParsedMaterial
f_name = p_total
constant_names = 'rho0'
constant_expressions = '1000'
args = 'vel_x vel_y vel_z p'
function = '0.5*rho0*(vel_x^2+vel_y^2+vel_z^2) + p'
outputs = exodus
[../]
[]
[Preconditioning]
[./SMP_PJFNK]
type = SMP
full = true
solve_type = 'NEWTON'
[../]
[]
[Executioner]
#Time integrator and time stepper customization
type = Transient
num_steps = 100
trans_ss_check = true
ss_check_tol = 1e-10
dtmin = 5e-4
dt = 0.5
[./TimeStepper]
dt = 0.5
type = IterationAdaptiveDT
cutback_factor = 0.4
growth_factor = 1.2
optimal_iterations = 5
[../]
#Solver tolerance and iteration limits
nl_rel_tol = 1e-8
nl_abs_tol = 1e-12
nl_max_its = 50
l_tol = 1e-6
l_max_its = 50
line_search = 'none'
# Options passed directly to PETSc
petsc_options = '-snes_converged_reason -ksp_converged_reason '
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package ' petsc_options_value = 'lu NONZERO superlu_dist '
[]
[Outputs]
exodus = true
[]