Beruflich Dokumente
Kultur Dokumente
terminates; otherwise the new design-variable values are used in the next calculation of
the flow problem.
Setting up this kind of model with a general optimization routine would require quite
a bit of work, but as you will discover, solving this problem with the built-in tools for
optimization in COMSOL Multiphysics is easy.
MODE L NAVIGATOR
1 In the Model Navigator begin by clicking the Multiphysics button.
2 Select COMSOL Multiphysics>Fluid Dynamics>Incompressible Navier-Stokes, then click
Add.
3 Select COMSOL Multiphysics>Optimization and Sensitivity>Optimization, then click
Add.
4 Click OK to close the Model Navigator.
GEOMETRY MODELING
1 Create three rectangles according to the following table. For each rectangle,
Shift-click the Rectangle/Square button on the Draw toolbar; then specify width,
height, and corner position; and finally click OK.
2 Click the Zoom Extents button to fit the model geometry to the drawing area.
3 Draw a point at the center of the channel by shift-clicking the Point button and then
entering 5e-3 and 0.5e-3 in the x and y edit fields, respectively.
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 6
reversed_flow_sbs.book Page 7 Thursday, December 4, 2008 1:32 PM
2 Define constants according to the following table (the descriptions are optional):
q 1 Optimization parameter
Da 1e-5 Darcy number
L 1[mm] Inlet height
rho 1e3[kg/m^3] Density of water
eta 1e-3[Pa*s] Viscosity of water
u0 10[mm/s] Flow velocity scale
The purpose of the constant u0 is to introduce a rough velocity scale that you can
use to make the objective function dimensionless with a value of the order 1.
3 Click OK to close the dialog box.
4 Choose Options>Expressions>Subdomain Expressions.
5 Select Subdomain 2, then enter names and expressions according to the following
table:
NAME EXPRESSION
alpha_max eta_ns/(Da*L^2)
alpha alpha_max*q*(1-gamma)/(q+gamma)
6 Click OK.
PHYSICS SETTINGS
5 Click OK.
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 7
reversed_flow_sbs.book Page 8 Thursday, December 4, 2008 1:32 PM
1 From the Physics menu, open the Boundary Settings dialog box.
2 Enter the boundary conditions according to the following table:
Keep all other boundaries at the default condition, which is the no-slip condition.
3 Click OK.
Subdomain Settings—Optimization
1 From the Model Tree, select Optimization (opt).
2 Open the Subdomain Settings dialog box.
Only the center part of the channel geometry is needed in the optimization, so you
can deactivate the other subdomains.
3 Select Subdomains 1 and 3, and then clear the Active in this domain check box.
4 Select Subdomain 2 and go to the Variables page.
5 Edit the fields according to the following table:
This defines shape functions for gamma, which is the design variable used in the
optimization. The initial value 1 corresponds to a channel free from porous material.
In the next step, you constrain the design variable to the range [0, 1].
6 Click the Pointwise Constraints tab.
7 Type 0 in the lb field, gamma in the Expression field, and 1 in the ub field.
8 Click OK.
Point Settings—Optimization
1 Choose Physics>Point Settings.
2 Select Point 5 from the list. On the Objective page, type u/u0 in the q0 edit field.
This defines the objective function to be proportional to the x-component of the
velocity at the center and normalized by the velocity-scale constant u0.
3 Click OK.
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 8
reversed_flow_sbs.book Page 9 Thursday, December 4, 2008 1:32 PM
MESH GENERATION
This model is naturally highly dependent on the mesh size. In this example, choose a
dense mesh; note, however, that this mesh can be further improved.
1 From the Mesh menu, open the Free Mesh Parameters dialog box.
2 On the Global page, click the Custom mesh size button.
3 In the Element growth rate edit field, type 1.1.
4 Click the Subdomain tab. Select all three subdomains.
5 In the Subdomain mesh parameters area, select Triangle from the Method list.
6 Select Subdomain 2 only, then set the Maximum element size to 0.12e-3.
7 On the Point page, select Point 5 and set the Maximum element size to 0.03e-3.
8 Click the Remesh button to generate the mesh.
9 When the mesher has finished, click OK to close the Free Mesh Parameters dialog box.
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 9
reversed_flow_sbs.book Page 10 Thursday, December 4, 2008 1:32 PM
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 10
reversed_flow_sbs.book Page 11 Thursday, December 4, 2008 1:32 PM
7 On the Initial Value page, click the Current solution button in the Initial value area,
then click OK.
8 Click the Solve button on the Main toolbar to solve the model.
The optimization routine requires approximately 90 steps requiring about 150 model
evaluations and takes about 10 to 15 minutes depending on the computer.
PO S T P RO C E S S I N G A N D V I S U A L I ZAT I O N
The default plot shows the velocity field. To evaluate the horizontal velocity in the
center of the channel, follow these steps:
The value appears in the lower part of the interface and should be about −0.013 m/s.
1 Still on the Surface Data page, change the text in the Expression edit field to p.
2 Click Apply.
1 Change the text in the Expression edit field to u (or select Incompressible
Navier-Stokes (ns)>x-velocity from the Predefined quantities list).
2 From the Unit list, select mm/s.
3 Click the Contour tab and select the Contour plot check box.
4 On the Contour Data page, type gamma in the Expression edit field.
5 In the Contour levels area, click the Vector with isolevels option button and then type
0.5 in the associated edit field.
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 11
reversed_flow_sbs.book Page 12 Thursday, December 4, 2008 1:32 PM
6 In the Contour color area, click first the Uniform color option button and then the
Color button.
7 In the Contour Color dialog box select black, then click OK.
8 Clear the Color legend check box.
9 Click the Streamline tab and select the Streamline plot check box.
10 Leave the default selection (Velocity field) on the Streamline Data page.
11 From the Streamline plot type list, select Magnitude controlled.
12 On the Density page, set the Density to 10.
13 On the Line Color tab, click the Color button.
14 In the Streamline Color dialog box select white, then click OK.
15 In the Plot Parameters dialog box, click OK to close the dialog box and generate the
plot.
E X A M P L E — M I N I M I Z I N G T H E F L O W VE L O C I T Y I N A M I C R O C H A N N E L | 12