FEATool Multiphysics
v1.17.1
Finite Element Analysis Toolbox
|
EX_NAVIERSTOKES2B 2D Driven cavity CFD benchmark.
[ DATA, FEA ] = EX_NAVIERSTOKES2B 2D Driven cavity CFD benchmark
CFD benchmarking script comparing the OpenFOAM and SU2 CFD solvers to the fully coupled FEATool Multiphysics solver, for stationary laminar driven cavity test case.
% Define available solvers. solvers = { 'FEATool', 'FEniCS', 'OpenFOAM', 'SU2' }; FEATOOL = 1; FENICS = 2; OPENFOAM = 3; SU2 = 4; % Define available grid cases. grids = { 'Quad', 'Tri', 'TriU' }; QUAD = 1; TRI = 2; % Structured triangles. TRIU = 3; % Unstructured triangles. % Define available FEM shape/basis functions. D0 = 'sf_disc0'; D1 = 'sf_disc1'; P1 = 'sf_simp_P1'; P2 = 'sf_simp_P2'; Q1 = 'sf_quad_Q1'; Q2 = 'sf_quad_Q2'; % Set up benchmark test cases. NLEV = 1:5; % Select grid levels. cases = { FEATOOL, TRI, {P1,P1}, NLEV, {}; FEATOOL, TRI, {P2,P1}, NLEV(1:end-1), {}; FEATOOL, QUAD, {Q1,Q1}, NLEV, {}; FEATOOL, QUAD, {Q2,D1}, NLEV(1:end-1), {}; FENICS, TRI, {P1,P1}, NLEV(1:end-1), {'nlrlx',0.6}; ... FENICS, TRI, {P2,P1}, NLEV(1:end-1), {}; OPENFOAM, TRI, {D0,D0}, NLEV, {}; OPENFOAM, QUAD, {D0,D0}, NLEV, {}; SU2, TRI, {P1,P1}, NLEV, {}; SU2, QUAD, {Q1,Q1}, NLEV, {} }; opt.basename = mfilename(); opt.solvers = solvers; opt.grids = grids; opt.cases = cases; opt.fcn_fea = @l_setup_fea_struct; opt.fcn_err = @l_compute_error; [ data, fea ] = run_featool_benchmarks( opt ); %