rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
demo_rb_stokes_fem.m
Go to the documentation of this file.
1 function demo_rb_stokes_fem(mesh_number)
2 %function demo_rb_stokes_fem(mesh_number)
3 % This function demonstrates the reduced basis approximation of the
4 % stationary Navier-Stokes equations (2-d CFD benchmark problem).
5 
6 if (nargin < 1)
7 
8  mesh_number = 1;
9 end
10 
11 
12 params = [];
13 params.mesh_number = mesh_number;
14 
15 % create model
16 model = laminar_flow_model(params);
17 model.verbose = 2;
18 
19 % generate model data
20 model_data = gen_model_data(model);
21 
22 % generate reduced basis
23 fprintf('\n');
24 disp('-> generate radial basis interpolant for inf-sup constant approximation');
25 model_data.infsup_constant = stokes_infsup_rbf_interpolant(model, model_data);
26 fprintf('\n');
27 disp('-> approximate continuity constant (sobolev embedding)');
28 model_data.rho_sqr = stokes_sobolev_embedding_constant(model, model_data);
29 fprintf('\n');
30 disp('-> reduced basis greedy algorithm');
31 detailed_data = gen_detailed_data(model,model_data);
32 reduced_data = gen_reduced_data(model,detailed_data);
33 
34 % plot solution
35 plot_params = [];
36 % specify functions to be plotted
37 %plot_params.modes = { ...
38 % 'pressure', ...
39 % 'velocity_xcomp', ...
40 % 'velocity_ycomp', ...
41 % 'velocity_abs', ...
42 % 'velocity_vec'};
43 plot_params.modes = {'pressure', 'velocity_abs'};
44 plot_params.subsampling_level = 0;
45 plot_params.vector_plot_distance = 0.02;
46 plot_params.no_lines=1;
47 plot_params.rbgui=1;
48 plot_params.hide_N_ruler=1;
49 
50 %GUI demo
51 fprintf('\n');
52 disp('Please call demo_rb_stokes_fem(3) for a better resolution');
53 
54 model.descr.is_stationary = 1;
55 model.enable_error_estimator = 0;
56 model.descr.gridtype ='triagrid';
57 model.N = get_rb_size(model,detailed_data);
58 
59 demo_rb_gui(model,detailed_data,reduced_data,plot_params);
60 
61 end
function demo_rb_gui(varargin)
reduced basis demo with sliders
Definition: demo_rb_gui.m:17
function demo_rb_stokes_fem(mesh_number)
This function demonstrates the reduced basis approximation of the stationary Navier-Stokes equations ...
function demo()
small script demonstrating the possibilities of the rectgrid class.
Definition: demo.m:18
function model = laminar_flow_model(params)
Model of laminar flow (steady Navier-Stokes) around cylinder in a pipe.
function p = plot(params)
plot of a rectgrid via plot_polygon_grid()
Definition: plot.m:18