potentialFlow3.mws

FINITE ELEMENTS

SYMBOLIC PROGRAMMING IN MAPLE

by Artur Portela

Potential-Flow Example 3: Flow with Specified Normal-Boundary Velocities

> restart:interface(verboseproc=3):printlevel:=3:

> libname := "C:/mylib/fem",libname:

> with(Plotter):

> with(Cgt_fem):

> with(G_cgt_fem):

>

Data Preparation

The best way to input data for Cgt_fem is to use the procedure read_save_data , which reads a file with the following structure:

* control * [title,point sources,element sources,boundary velocities]
title Potential Flow in a Rectangular Domain
point sources
element sources
boundary velocities

*
materials * [material,x-permeability,y-permeability,angle of the local x-direction]
1 2 2 45
2 8 8 45

*
nodes * [node,x,y]
1 0 0
2 0 1
3 0 2
4 1 0
5 1 1
6 1 2
7 2 0
8 2 1
9 2 2
10 3 0
11 3 1
12 3 2
13 4 0
14 4 1
15 4 2

*
elements * [element,node1,node2,node3,material]
1 1 4 5 1
2 1 5 2 1
3 2 5 3 1
4 3 5 6 1
5 4 7 8 1
6 5 4 8 1
7 5 8 6 1
8 6 8 9 1
9 7 10 11 1
10 7 11 8 1
11 8 11 9 1
12 11 12 9 1
13 10 13 14 1
14 10 14 11 1
15 11 14 12 1
16 12 14 15 1

*
constraints * [node,potential]
1 10
2 10
3 10
13 0
14 0
15 0

*
boundary velocities * [node1,node2,normal velocity]
1 2 0
2 3 0
5 4 0

*
point sources * [node,Q]
1 -50

*
element sources * [element,q]
2 30

*
end *

The data blocks, with the respective keyword on the top, can be defined in any order.

Alternatively, data can be given manually through the definition of the variables: tcase , control , nods , elems , mat_props , bdr_conds , b_velts , p_srcs and e_srcs . See bellow the structure of these variables.

>

Flow with Specified Normal-Boundary Velocities

As another problem, consider the same case of a uniform flow in a rectangular domain. Define flow potentials, uniformly distributed on side, and, uniform velocities normal to the boundary, on the opposite side. Consider the hydraulic conductivity parameters.

> read_save_data();

read data from a file (y/n) ? y;

file name: "dat_test3.txt";

save data into a file (y/n) ? y;

file name: "check.txt";

> #tcase;control;nods;elems;mat_props;bdr_conds;b_velts;p_srcs;e_srcs;

Check the problem data

> plot_problem_data();

[Maple Plot]

> plot_mesh();

[Maple Plot]

Run the finite element procedure

> cgt_fem();

`Cpu time:  1.001 seconds`

> #n_potls;e_grads;e_velts;n_velts;n_fluxes;n_kined;total_kinetic_energy;

> animate_3D_rot(n_potls);

plot title: "Nodal Flow Potential";

[Maple Plot]

> plot_contour_lines(n_potls);

plot title: "Nodal Flow Potential";

[Maple Plot]

> plot_velocities();

[Maple Plot]

> animate_velocities();

[Maple Plot]

> plot_fluxes();

[Maple Plot]

> animate_3D_rot(n_kined);

plot title: "Nodal kinetic-Energy Density";

[Maple Plot]

> plot_contour_lines(n_kined);

plot title: "Nodal kinetic-Energy Density";

[Maple Plot]

>