Skip to content

Commit 9371bf7

Browse files
authored
Merge pull request #290 from nglaser3/channelflow-test
Add shorter version of channel_flow test
2 parents 64e039e + a665b76 commit 9371bf7

File tree

3 files changed

+312
-0
lines changed

3 files changed

+312
-0
lines changed

tests/sa-model/channel_flow_short.i

Lines changed: 307 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,307 @@
1+
Re = 1.375e4
2+
density = 1 # kg cm-3
3+
D = 1
4+
inlet = 1
5+
viscosity = '${fparse density * inlet * D / Re}' # dynamic viscosity, mu = nu * rho, kg cm-1 s-1
6+
alpha = 0.33333 # INS SUPG and PSPG stabilization parameter
7+
8+
[GlobalParams]
9+
integrate_p_by_parts = false
10+
viscous_form = 'traction'
11+
pressure = p
12+
velocity = vel
13+
[]
14+
15+
[Mesh]
16+
[channel]
17+
type = CartesianMeshGenerator
18+
dim = 2
19+
dx = '0.05 0.2 19.75'
20+
dy = '0.3 0.1 0.05 0.05'
21+
ix = '20 1 79'
22+
iy = '10 5 5 10'
23+
[]
24+
[corner_node]
25+
type = ExtraNodesetGenerator
26+
input = channel
27+
new_boundary = 'pinned_node'
28+
coord = '20 0.5'
29+
[]
30+
[]
31+
32+
[Problem]
33+
type = FEProblem
34+
[]
35+
36+
[Variables]
37+
[vel]
38+
family = LAGRANGE_VEC
39+
order = FIRST
40+
[]
41+
[p]
42+
[]
43+
[mu_tilde]
44+
initial_condition = '${fparse viscosity * 5}'
45+
[]
46+
[]
47+
48+
[AuxVariables]
49+
[mu_turbulence]
50+
[]
51+
[wall_dist]
52+
[]
53+
[velx]
54+
[]
55+
[vely]
56+
[]
57+
[wall_shear_stress]
58+
family = MONOMIAL
59+
order = CONSTANT
60+
[]
61+
[turbulent_stress]
62+
family = MONOMIAL
63+
order = CONSTANT
64+
[]
65+
[]
66+
67+
[Kernels]
68+
[mass]
69+
type = INSADMass
70+
variable = p
71+
[]
72+
[mass_pspg]
73+
type = INSADMassPSPG
74+
variable = p
75+
[]
76+
[momentum_advection]
77+
type = INSADMomentumAdvection
78+
variable = vel
79+
[]
80+
[momentum_viscous]
81+
type = INSADMomentumViscous
82+
variable = vel
83+
[]
84+
[momentum_turbulent_viscous]
85+
type = INSADMomentumTurbulentViscous
86+
variable = vel
87+
mu_tilde = mu_tilde
88+
[]
89+
[momentum_pressure]
90+
type = INSADMomentumPressure
91+
variable = vel
92+
[]
93+
[momentum_supg]
94+
type = INSADMomentumSUPG
95+
variable = vel
96+
[]
97+
[momentum_time]
98+
type = INSADMomentumTimeDerivative
99+
variable = vel
100+
[]
101+
102+
[mu_tilde_time]
103+
type = SATimeDerivative
104+
variable = mu_tilde
105+
[]
106+
[mu_tilde_space]
107+
type = SATurbulentViscosity
108+
variable = mu_tilde
109+
[]
110+
[mu_tilde_supg]
111+
type = SATurbulentViscositySUPG
112+
variable = mu_tilde
113+
[]
114+
[]
115+
116+
[AuxKernels]
117+
[mu_space]
118+
type = SATurbulentViscosityAux
119+
variable = mu_turbulence
120+
mu_tilde = mu_tilde
121+
[]
122+
[wall_distance]
123+
type = WallDistanceAux
124+
variable = wall_dist
125+
walls = 'top'
126+
execute_on = initial
127+
[]
128+
[velx]
129+
type = VectorVariableComponentAux
130+
variable = velx
131+
vector_variable = vel
132+
component = x
133+
[]
134+
[vely]
135+
type = VectorVariableComponentAux
136+
variable = vely
137+
vector_variable = vel
138+
component = y
139+
[]
140+
[wall_shear_stress]
141+
type = WallShearStressAux
142+
variable = wall_shear_stress
143+
boundary = top
144+
[]
145+
[turbulent_stress]
146+
type = TurbulentStressAux
147+
variable = turbulent_stress
148+
mu_tilde = mu_tilde
149+
[]
150+
[]
151+
152+
[Functions]
153+
[xfunc]
154+
type = ParsedFunction
155+
expression = '${fparse inlet}'
156+
[]
157+
[mu_func]
158+
type = ParsedFunction
159+
expression = 'if(y=0.5, 0, ${fparse viscosity * 5})'
160+
[]
161+
[]
162+
163+
[ICs]
164+
[velocity]
165+
type = VectorFunctionIC
166+
function_x = xfunc
167+
function_y = 0
168+
variable = vel
169+
[]
170+
[]
171+
172+
[BCs]
173+
[no_slip]
174+
type = ADVectorFunctionDirichletBC
175+
variable = vel
176+
boundary = 'top'
177+
function_x = 0
178+
function_y = 0
179+
[]
180+
[inlet]
181+
type = ADVectorFunctionDirichletBC
182+
variable = vel
183+
boundary = 'left'
184+
function_x = xfunc
185+
function_y = 0
186+
[]
187+
[outlet]
188+
type = INSADMomentumTurbulentNoBCBC
189+
variable = vel
190+
boundary = 'right'
191+
mu_tilde = mu_tilde
192+
[]
193+
[outlet_supg]
194+
type = INSADMomentumSUPGBC
195+
variable = vel
196+
boundary = 'right'
197+
[]
198+
[outlet_pspg]
199+
type = INSADMassPSPGBC
200+
variable = p
201+
boundary = 'right'
202+
[]
203+
[symmetry]
204+
type = ADVectorFunctionDirichletBC
205+
variable = vel
206+
boundary = 'bottom'
207+
set_x_comp = false
208+
function_y = 0
209+
[]
210+
211+
[pressure_pin]
212+
type = DirichletBC
213+
variable = p
214+
boundary = 'pinned_node'
215+
value = 0
216+
[]
217+
218+
[mu_inlet]
219+
type = FunctionDirichletBC
220+
variable = mu_tilde
221+
boundary = 'left'
222+
function = mu_func
223+
[]
224+
[mu_wall]
225+
type = DirichletBC
226+
variable = mu_tilde
227+
boundary = 'top'
228+
value = 0
229+
[]
230+
[mu_outlet]
231+
type = SATurbulentViscosityNoBCBC
232+
variable = mu_tilde
233+
boundary = 'right'
234+
[]
235+
[mu_outlet_supg]
236+
type = SATurbulentViscositySUPGBC
237+
variable = mu_tilde
238+
boundary = 'right'
239+
[]
240+
[]
241+
242+
[Materials]
243+
[ad_mat]
244+
type = ADGenericConstantMaterial
245+
prop_names = 'rho mu'
246+
prop_values = '${density} ${viscosity}'
247+
[]
248+
[sa_mat]
249+
type = SATauMaterial
250+
alpha = ${alpha}
251+
mu_tilde = mu_tilde
252+
wall_distance_var = wall_dist
253+
use_ft2_term = true
254+
[]
255+
[]
256+
257+
[Executioner]
258+
type = Transient
259+
260+
solve_type = 'NEWTON'
261+
petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_linesearch_monitor'
262+
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_mat_solver_package'
263+
petsc_options_value = 'lu NONZERO superlu_dist'
264+
line_search = none
265+
266+
automatic_scaling = true
267+
compute_scaling_once = false
268+
resid_vs_jac_scaling_param = 0.1
269+
scaling_group_variables = 'vel; p; mu_tilde'
270+
off_diagonals_in_auto_scaling = true
271+
272+
nl_rel_tol = 1e-8
273+
nl_abs_tol = 1e-14
274+
nl_max_its = 10
275+
276+
start_time = 0.0
277+
end_time = 6
278+
dtmin = 1.0
279+
dtmax = 10
280+
[TimeStepper]
281+
type = IterationAdaptiveDT
282+
dt = 1e-0
283+
cutback_factor = 0.9
284+
growth_factor = 1.1
285+
optimal_iterations = 6
286+
iteration_window = 1
287+
linear_iteration_ratio = 1000
288+
[]
289+
[]
290+
291+
[Preconditioning]
292+
[SMP]
293+
type = SMP
294+
full = true
295+
[]
296+
[]
297+
298+
[Outputs]
299+
[exodus]
300+
type = Exodus
301+
execute_on = final
302+
[]
303+
[]
304+
305+
[Debug]
306+
show_var_residual_norms = true
307+
[]
Binary file not shown.

tests/sa-model/tests

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[Tests]
2+
[channel_flow_short]
3+
type = 'Exodiff'
4+
input = 'channel_flow_short.i'
5+
exodiff = 'channel_flow_short_exodus.e'
6+
[]
27
[channel_flow]
38
type = 'Exodiff'
49
input = 'channel_flow.i'

0 commit comments

Comments
 (0)