当前位置:文档之家› Fluent二维波浪模拟教程

Fluent二维波浪模拟教程

Tutorial10.Simulation of Wave Generation in a TankIntroductionThe purpose of this tutorial is to illustrate the setup and solution of the2D laminarfluid flow in a tank with oscillating motion of a wall.The oscillating motion of a wall can generate waves in a tank partiallyfilled with a liquid and open to atmosphere.Smooth waves can be generated by setting appropriate frequency and amplitude.One of the tank walls is moved to and fro by specifying a sinusoidal motion.In this tutorial you will learn how to:•Read an existing meshfile in FLUENT.•Check the grid for dimensions and quality.•Add newfluid in the materials list.•Set up a multiphaseflow problem.•Use the dynamic mesh model.•Set up an animation using Execute Commands panel.PrerequisitesThis tutorial assumes that you have little experience with FLUENT but are familiar with the interface.Problem DescriptionIn this tutorial,we consider a rectangular tank with a length(L)of15m and width(W) of0.8m(Figure10.1).The left wall is assigned a motion with sinusoidal time variation.The top wall is open to atmosphere and thus maintained at atmospheric pressure.The flow is assumed to be laminar.Simulation of Wave Generation in a TankFigure10.1:Problem SchematicPreparation1.Copy the meshfile,wave.msh and libudf folder to your working directory.2.Start the2D double precision solver of FLUENT.Setup and SolutionStep1:Grid1.Read the gridfile,wave.msh.File−→Read−→Case...FLUENT will read the meshfile and report the progress in the console window.2.Check the grid.Grid−→CheckThis procedure checks the integrity of the mesh.Make sure the reported minimumvolume is a positive number.3.Check the scale of the grid.Grid−→Scale...Simulation of Wave Generation in a Tank Check the domain extents to see if they correspond to the actual physical dimensions.If not,the grid has to be scaled with proper units.4.Display the grid(Figure10.2).Display−→Grid...(a)Click Colors....The Grid Colors panel opens.i.Under Options,enable Color by ID.ii.Click Close.(b)In the Grid Display panel,click Display(c)Zoom in near the moving-wall(Figure10.3).Simulation of Wave Generation in a TankFigure10.2:Grid DisplayFigure10.3:Grid Display(Close-up of moving-wall)Simulation of Wave Generation in a TankStep2:Models1.Specify the solver settings.Define−→Models−→Solver...(a)Under Time,enable Unsteady(b)Under Transient Controls,enable Non-Iterative Time Advancement.(c)Click OK.2.Enable VOF multiphase model.Define−→Models−→Multiphase...Simulation of Wave Generation in a Tank(a)Under Model,enable Volume of Fluid.The panel expands to show the other settings related to VOF model.Retainthe other settings as default.(b)Click OK.Step3:MaterialsDefine−→Materials...1.Add liquid water to the list offluid materials by copying it from the materialsdatabase.Simulation of Wave Generation in a Tank(a)Click Fluent Database....Fluent Database Materials panel opens.Simulation of Wave Generation in a Tanki.Select water-liquid(h2o<l>)from the Fluent Fluid Materials list.Scroll down to view water-liquid.ii.Click Copy and close the panel.(b)Click Change/Create and close the panel.Step4:PhasesDefine−→Phases...1.Set air as primary phase and water as secondary phase.(a)Under Phase,select phase-1.The Type will be shown as primary-phase.(b)Click Set....i.Change Name to air.ii.Select air in the Phase Material drop-down list.iii.Click OK.(c)Similarly,change the Name of phase-2to water and set its Type to water-liquid.(d)Close the Phases panel.Simulation of Wave Generation in a TankStep5:Operating ConditionsDefine−→Operating Conditions...1.Set the gravitational acceleration.(a)Enable Gravity.(b)Under Gravitational Acceleration,set Y to-9.81m/s2.As the tank bottom is perpendicular to Y axis,gravity points in the negativeY direction.2.Set the operating density.(a)Under Variable-Density Parameters,enable Specified Operating Density.(b)Retain the default density of1.225kg/m3.Set the operating density to the density of the lighter phase.This excludesthe build-up of hydrostatic pressure within the lighter phase,improving theround-offaccuracy for the momentum balance.3.Set the reference pressure location.(a)Under Reference Pressure Location,retain the default value of zero for both Xand Y.This location corresponds to a region where thefluid will always be100%ofone of the phases(water).If it is not,it is recommended to change the regionto a appropriate location where the pressure value does not change much overtime.This condition is essential for smooth and rapid convergence.4.Click OK to accept the settings and close the panel.Simulation of Wave Generation in a TankStep6:Boundary ConditionsFLUENT maintains zero velocity condition on all the walls.Also,the pressure condition for outlet boundary at the top is set by default to zero gauge(or atmospheric).Hence, there is no need to change the boundary conditions.Retain all the boundary conditions as default.Step7:UDF LibraryDefine−→User-Defined−→Functions−→Compiled...1.Click Load to load the UDF library.The sinusoidal wall motion will be assigned using user defined function.A compiledUDF library named libudf is created for this purpose.Step8:Dynamic Mesh Model1.Set the dynamic mesh parameters.Define−→Dynamic Mesh−→Parameters...(a)Under Models,enable Dynamic Mesh.The panel expands.(b)Under Mesh Methods,disable Smoothing and enable Layering.(c)Under the Layering tab,set Collapse Factor to0.4.(d)Click OK.2.Set the dynamic mesh zones.Define−→Dynamic Mesh−→Zones...(a)Under Zone Names,select moving-wall.(b)Under Type,retain the default selection of Rigid Body.(c)Under Meshing Options tab,set Cell Height to0.008m.This is the average size of the cell normal to the moving wall.(d)Click Create and close the panel.Step9:Solution1.Retain the default solution controls.Solve−→Controls−→Solution...Solve−→Initialize−→Initialize...(a)Click Init and close the panel.The complete domain is now initialized with air.The water level required at start(t=0)can be patched.3.Create a register marking the region of initial water level.Adapt−→Region...(a)Set X Max to be15m.(b)Set Y Max to be0.5m.(c)Click Mark and close the panel.FLUENT displays the following message in the console:8510cells marked for refinement,0cells marked for coarsening.4.Patch the initial water level.Solve−→Initialize−→Patch...(a)Under Registers to Patch,select hexahedron-r0.(b)Under Phase,select water.(c)Under Variable,select Volume Fraction.(d)Set Value to1.(e)Click Patch and close the panel.5.Display the zone motion to check the movement of moving-wall.(a)Display the grid(Figure10.4).Display−→Grid...i.Under Surfaces,deselect default-interior.Zoom-in the graphics window to get the view as shown in Figure10.4.ii.Click Display.Figure10.4:Grid Display Outline at t=0(b)Display the zone motion.Display−→Zone Motion...i.Under Motion History Integration,set Time Step to0.001.ii.Set Number of Steps to300.iii.Click Integrate.iv.Under Preview Controls,set Time Step to0.001.v.Set Number of Steps to300.vi.Click Preview to observe the wall motion.vii.Close the Zone Motion panel.6.View the contours of volume fraction for water(Figure10.5).Display−→Contours...(a)Select Phases...and Volume Fraction in the Contours of drop-down lists.(b)Under Phase,select water.(c)Under Options,enable Filled.(d)Click Display and close the panel.Figure10.5:Contours of Volume Fraction for Water7.Enable the plotting of residuals during the calculation.Solve−→Monitors−→Residuals...(a)Under Options,enable Plot.(b)Under Plotting,set Iterations to10.This will display residuals for only the last10iterations.(c)Click OK.8.Set hardcopy settings.File−→Hardcopy...(a)Under Format,select TIFF.(b)Under Coloring,select Color.(c)Click Apply.(d)Click Preview.The background of graphics window is changed to white.FLUENT will displaya question dialog box asking you whether to reset the window.(e)Click Yes in the Question dialog box.(f)Close the panel.9.Set the commands to capture the images of contours.You need to use Text User Interface(TUI)commands to achieve this.For most of the graphical commands,corresponding TUI commands are available.Solve−→Execute Commands...(a)Set the number of Defined Commands to3.(b)Enable On option for all the commands.(c)Under Every,set7for all the commands.(d)Under When,set Time Step for all the commands.(e)For command-1,specify the Command as:display set-window1This command will make the window-1active.(f)For command-2,specify the Command as:display contour water vof01This command will display the contours of water volume fraction in the activewindow.(g)For command-1,specify the Command as:display hard-copy"vof-%t.tif"This command will save the image in the TIF format.The%t option gets replaced with the time step number,when the imagefileis saved.The TIFfiles saved can then be used to create a movie.For theinformation on converting TIFfile to an animationfile,refer to/cfm/graphics01.htm(h)Click OK to accept the settings and close the panel.10.Set the surface monitors.Solve−→Monitors−→Surface...(a)Increase the number of Surface Monitors to1.(b)Enable Plot for monitor-1.(c)Under Every,select Time Step.(d)Click on Define...next to monitor-1.(e)Select Area Weighted Average in the Report Type drop-down list.(f)Select Grid and X-Coordinate in the Report of drop-down list.(g)Under Surfaces,select moving-wall.(h)Click OK to close both the panels.11.Save the case and datafiles(wave-init.cas.gz and wave-init.dat.gz).File−→Write−→Case&Data...Retain the default Write Binary Files option so that you can write a binaryfile.The .gz extension will save zippedfiles on both,Windows and UNIX platforms.12.Start the calculation.Solve−→Iterate...(a)Set the Time Step Size as0.001s(b)Set Number of Time Steps to4000.(c)Click Iterate.Figure10.6:Scaled Residuals13.Save the case and datafiles(wave-4000.cas.gz and wave-4000.dat.gz).Figure10.7:Monitor Plot of Area Weighted Average on moving-wallStep10:Postprocessing1.Displayfilled contours of static pressure(Figure10.8).Display−→Contours...(a)Select Pressure...and Static Pressure in the Contours of drop-down lists.(b)Click Display.The pressure at the bottom of the tank is maximum and goes on decreasingtowards the top.This shows the variation of hydrostatic pressure due to theheight of the liquid.Figure10.8:Contours of Static PressureSummaryThe dynamic mesh model is used to apply periodic sinusoidal motion to the wall.This generates a wave in thefluid.The VOF model is used to track the air-water interface and consequently the wave motion.Non-iterative time advancement(NITA)was used to reduce the run time of transient simulation.Images displaying contours of water phase were captured to visualize the transient effects.References1.Flow Around the Itsukushima Gate,an example from Fluent Inc.Marketing Cata-log,2003.Exercises/Discussions1.Run the simulation for longerflow time to check the wave pattern.2.Try running the simulation without non-iterative time advancement(NITA)option.(a)Are theflow patterns different?(b)Compare the wall clock time taken to reach the sameflow time.3.Run the simulation using variable time step option.4.Try different motions to the wall and observe wave patterns.This will need specific C compiler to create UDF library from the source code.5.What other situation can be simulated using the same meshfile?Links for Further Reading•http://www.prads2004.de/pdf/027.pdf•http://www.prads2004.de/pdf/138.pdf•http://www.math.rug.nl/∼veldman/preprints/OMAE2004-51084.pdf。

相关主题