HowTo setting up dynamic mesh cases

From OpenFOAMWiki
Revision as of 17:10, 26 April 2006 by Mztlrb (Talk | contribs)

From this thread in the message board: Dynamic mesh changes

1 Basics

Basically, we've got three things to go through:

  1. automatic mesh motion
  2. layer addition/removal
  3. sliding interface

Please note that in most cases, the sliding interface and layer addition/removal will also require mesh motion, but it needs to be set up such that it works with the mesh modifier.

1.1 Automatic mesh motion

This is used for cases when the geometry does not change. The motionSolver class uses a FEM solver in foam to determine the new point positions from the old ones. The way to get it to work is to specify motion of boundaries as boundary conditions on the motionU field, and then use the solution to update point position. Note that the motion of one boundary will influence the complete mesh, i.e. (almost) all points in the mesh will move. If the boundary motion is time- or solution-dependent, this needs to be built into the top-level solver.

A good example for this is the icoFoamAutoMotion tutorial and I don't think this will interest you much (pretty straightforward so far)

1.2 Topological changes in the mesh

1.2.1 General implementation.

The idea is that one can define 9 basic operations on a mesh which allow all possible changes that I can imagine. They are: add/modify/remove point, face or a cell. With those 9 commands I can do everything possible on a mesh. The classes that describe this live in:

OpenFOAM-1.0/src/OpenFOAM/meshes/polyMesh/morphEngine/polyTopoChange

and are all derived from topoAction. There is a class for each of the operations in the same directory - have a look and describe what kind of change can be done.

However, taking a valid initial mesh and adding a point or removing a cell is not sufficient: doing this in an arbitrary manner will simple create an invalid mesh. Therefore, a bunch of changes needs to be grouped together until they make a sensible change in the mesh, like for example, addition of a cell layer. This is described by the polyTopoChange class - it can take a group of topoActions that belong together using a steAction member function.

At this stage, I can make myself a polyTopoChange object and put a bunch of topoActions that describe my operation.

Finally, the polyMesh is capable of taking a polyTopoChange and executing the change.

The next level is to recognise that a user cannot be expected to work with topoActions: you really want to specify where and how to create a new layer of cells and not worry about topoActions. Also, we want the possibility of having several layer addition /removals and sliding interfaces working at the same time. Also, the changes need to happen DURING the simulation, so the whole mechanism needs to be a part of the mesh definition. This is how it's done: a polyMesh has got a polyMeshMorphEngine, which consists of a set of polyMeshModifiers. When morph() is called, the polyMeshMorphEngine goues through all the mesh modifiers and asks them whether they want to change the topology. If yes, each mesh modifier adds is topoActions to the same polyTopoChange and when they are all done, the mesh executes a change.

Therefore, a job of a mesh modifier is to

  • decide whether it wants to change the mesh topology
  • if yes, fill in a polyTopoChange with the topoActions that describe the change
  • (some other actions, not currently important)

Examples of mesh modifiers are in the dynamicMesh library and they are derived form the polyMesh modifier class. Currently, there are three:

  • attachDetach
  • layerAdditionRemoval
  • slidingInterface

Note that our job is to create and define a self-contained object that can do the job.

In order to do this, we need some additional things necessary to define the mesh modifier - they also live in the polyMesh class and are called zones. The code for zones lives in

OpenFOAM-1.0/src/OpenFOAM/meshes/polyMesh/zones

and I can make point, face or cell zones.

A zone is an arbitrary subset of mesh objects (points, faces or cells). They are grouped into zoneMesh (pointZoneMesh, faceZoneMesh etc, depending on the object). When creating, say, a pointZoneMesh, I can distribute the points of the mesh into as many groups as I like but one point can belong to a maximum of one zone.

Finally, let's think about the faces. As you know, faces in polyMesh are ordered according to the cell ordering and they point from the lower cell index into the higher (for the two cells around the face) or, for the boundary faces, they point outwards. Therefore, if I want to collect a bunch of faces into a zone and give it oriaentation (front and back, if you like), I need to collect all face indices that belong into the zone and for each face specify a bool "flip". If the face already point in the right direction, its "flip" is set to false and if its normal vector points in the wrong direction, the flip is true.

1.3 Poly mesh modifiers

1.3.1 Attach-detach boundary

Attach-detach boundary is made up of a bunch of internal mesh faces which can at required time be converted into boundary faces. Since the set of faces has got two sides (front and back), each face will need to be converted into two boundary faces. Once the mesh modifier is detached, it can again be attached, so you can operate in on-off-on-off cycles.

The definition of an attach-detact boundary consists of 3 things:

  • a face zone containing the faces that should detach. When collecting faces into a zone you have to be careful to define them such that the zone has got a well-defined front and back. If this is not the case, the algorithm will not work
  • a master patch name and a slave patch name. These two patches are initially empty (zero faces) when the mesh is attached and the faces get put into them once it is detached.
  • a list of trigger times. When the run time reaches a trigger time, the state of attach-detach boundary will change: detach if attached and vice versa.

An example would look like this:

HrvsAttach
{
   type attachDetach;
   faceZoneName membraneFaces;
   masterPatchName attachMasterWall;
   slavePatchName attachSlaveWall;
   triggerTimes (3 6 9 12 15 18);
}

1.3.2 Layer addition-removal

A layer addition/removal mesh modifier will add a layer of cells in front of it once the thickness goes over the give threshold and remove a layer of cells if the layer thickness goes below the minimum. It is defined with the following parameters:

  • an oriented face zone. The cells will be added and removed at the front side of the zone. Faces of the zone can be either internal or boundary or a mixture (does not matter.
  • min layer thickness
  • max layer thickness

There are also some auxiliary stuff in there which is not important or is used for the mesh modifier to record its current state. Here is an example:

right
{
   type layerAdditionRemoval;
   faceZoneName rightExtrusionFaces;
   minLayerThickness 2e-4;
   maxLayerThickness 5e-4;
   oldLayerThickness -1;
   active on;
}

Please note that the overall mesh motion needs to be done in such a way that the layer thickness in front of the modifier changes in time. Typically, you will need to be careful to set this up in a useful way and avoid cases where the motion is too fast (negative cell volumes and similar).

1.3.3 Sliding interface

Finally, a sliding interface. The idea of a sliding interface is that I've got two pieces of detached mesh that I want to connect (call it left and right). I will first need to pick out a set of BOUNDARY faces on each side which will merge. Also, when I look at two patches that partially overlap, some part of them will become internal faces and some parts will remain uncovered. We want to keep the uncovered faces on the left and right in separate boundary patches.

In order for the setup to work, I will therefore need:

  • one face zone (at the beginning made up of boundary faces) for the left and right side.
  • one boundary patch for each of the sides. Typically at the beginning of the story (when the patches are disconnected) all patch faces will also belong to a zone
  • scratch space: one empty zone for cut faces and one point zone for cut points.

This mesh modifier does not need a triggering criterion - it will find out whther the mesh has changed based on the relative mesh motion. Also, setting up mesh motion needs to be done carefully, as the two pieces of the mesh should move independently from each other before the mesh attached.

An example of a sliding interface is given below:

mixerSlider
{
   type slidingInterface;
   masterFaceZoneName outsideSliderZone;
   slaveFaceZoneName insideSliderZone;
   cutPointZoneName cutPointZone;
   cutFaceZoneName cutFaceZone;
   masterPatchName outsideSlider;
   slavePatchName insideSlider;
   typeOfMatch integral;
   coupleDecouple off;
   projection visible;
   attached off;
   active on;
}

(this may change a bit between the versions).

2 Examples

TODO: See the original thread

buy online ambien buy adipex online buy levitra online online viagra buy online buy carisoprodol buy online phentermine online buy xanax carisoprodol buy phentermine buy buy xanax online owned watch pre rolex pre rolex owned watch cleaner carpet cleaner carpet buy xanax xanax buy xanax cheap cheap xanax xanax buy online online xanax buy online phentermine phentermine online online phentermine online phentermine phentermine online phentermine online buy online phentermine buy phentermine online cheap phentermine online phentermine cheap online order phentermine online order online phentermine buy phentermine buy phentermine phentermine cheap phentermine cheap phentermine order phentermine order cheap phentermine phentermine cheap order phentermine order phentermine car antonio san quality pre owned car san quality owned antonio pre watch panerai owned pre owned pre watch panerai watch rolex man pre owned watch owned rolex pre man pre uk owned cartier watch owned uk pre watch cartier watch pre owned worldofwatches.com worldofwatches.com owned pre watch owned omega pre watch man omega owned pre watch man watch pre owned in singapore in owned singapore pre watch pre oris watch owned watch pre owned oris watch owned cartier pre pre watch cartier owned pre lady rolex watch owned watch rolex lady pre owned owned watch pre muller franck pre watch owned muller franck breitling owned pre watch breitling owned watch pre watch iwc owned pre owned pre watch iwc omega owned watch pre pre omega watch owned rolex pre owned watch owned watch rolex pre watch owned pre watch owned pre card master debit reward mega mega debit card reward master irs form 2688 form 2688 irs kamman genealogy kamman genealogy biotechnology name name biotechnology name biotechnology name biotechnology really cheap airline ticket really cheap ticket airline die it today it today die blockage clog clear drain drain blockage clog clear repair concrete raise foundation foundation concrete repair raise store blind drapery drapery store blind mortgage wholesale wisconsin mortgage wholesale wisconsin mortgage wisconsin wholesale wholesale mortgage wisconsin mortgage wisconsin wholesale mortgage wisconsin wholesale litigation trial attorney litigation attorney trial attorney litigation trial trial litigation attorney show olympics source today olympics show source today 0 credit interest card 0 card credit interest a as my control remote use pc pc as my control use remote a name for baby top 2005 top 2005 baby for name top for baby name 2005 2005 for name top baby last origin name origin last name last name origin name origin last domain registration internet registration internet domain earls name earls name earls name name earls enter city name name enter city enter name city name city enter robot noindex content name meta content robot meta name noindex robot noindex name content meta meta content noindex robot name install above build ground pool swimming ground build pool above install swimming chase.com credit card card credit chase.com curtain clean drape clean curtain drape router 192.168.1.1 linksys linksys 192.168.1.1 router alarm commercial fire system alarm honeywell fire system alarm system est fire fire system faraday alarm non fire coded system alarm history alarm fire system fire system siemens alarm alarm testing fire system equipment alarm fire berkshires system fire alarm berkshires system system rochester fire alarm alarm fire wireless system fire commercial system alarm fire alarm design system fire camera and alarm system fire system notifier alarm fire system simplex alarm alarm system fire edwards alarm system fire manufacturer fire alarm commercial system system fire design alarm system fire alarm camera and notifier fire system alarm simplex alarm system fire system fire edwards alarm system manufacturer fire alarm daytona rolex watch replica watch designer replica rolex swiss replica replica swiss watch watch band rolex replica replica rolex rolex watch replica the best rolex watch replica replica rolex watch swiss rolex replica daytona watch replica rolex replica designer watch replica rolex swiss swiss watch replica rolex replica watch band rolex replica replica best watch the rolex watch replica rolex rolex replica watch swiss rolex replica walgreen%27s walgreen%27s canadian pharmacies pharmacies canadian cvs pharmacy pharmacy cvs aid pharmacies rite pharmacies rite aid pharmacy international international pharmacy drugstores drugstores online pharmacies online pharmacies replica iwc iwc replica watch replica iwc replica iwc watch watch fake rolex fake rolex watch fake watch cartier watch fake cartier fake watch fake watch watches replica watches replica rolex watch replica replica watch rolex rolex watch rolex watch Canopy Beds Iron Wrought Wrought Beds Canopy Iron Canopy Wooden Beds Wooden Canopy Beds Wood Bed Canopy Wood Canopy Bed Wheelchair Canopy Canopy Wheelchair Canopies Vehicle Vehicle Canopies Under The Canopy The Under Canopy Trundle Canopy Bed Bed Trundle Canopy Truck Canopies Truck Canopies Tractor Canopy Canopy Tractor Tent Canopies Canopies Tent Canopy Tanning Canopy Tanning With Canopy Swing With Canopy Swing Canopy Sun Sun Canopy Canopy Steel Steel Canopy Canopies Shade Shade Canopies Canopy Screen Canopy Screen Canopies Rv Rv Canopies Replacement Canopy Covers Covers Replacement Canopy Rainforest Canopy Canopy Rainforest Canopy Quik Shade Shade Canopy Quik Quick Shade Canopies Shade Canopies Quick Canopy Princess Princess Canopy Portable Canopy Portable Canopy Canopy Swing Porch Swing Canopy Porch Pop Canopy Up Pop Up Canopy Canopies Pickup Canopies Pickup Patio Canopy Swing Canopy Swing Patio Patio Canopies Canopies Patio Party Canopies Canopies Party Canopy Swing Outdoor Canopy Swing Outdoor Canopies Outdoor Canopies Outdoor Bed Net Mosquito Canopy Mosquito Net Canopy Bed Metal Canopy Canopy Metal A Bed Canopy Make Canopy A Bed Make Leer Canopy Leer Canopy Canopy Lawn Canopy Lawn Canopy King Canopy King Bedding Kids Canopy Canopy Kids Bedding Jewish Canopy Wedding Jewish Canopy Wedding Iron Bed Canopy Iron Bed Canopy Instant Canopy Canopy Instant Canopy Hercules Hercules Canopy Green Canopy Green Canopy Girls Beds Canopy Beds Girls Canopy Canopy Party Garden Party Canopy Garden Canopy Garden Canopy Garden Door Front Canopy Front Door Canopy Canopy Fabric Fabric Canopy Canopies Ezup Canopies Ezup Easy Up Canopy Up Canopy Easy Canopies Up Z E E Up Z Canopies Canopies Door Door Canopies Canopy Deck Deck Canopy Crib Canopy Canopy Crib Canopy Commercial Canopy Commercial Canopy Colorado Colorado Canopy Canopies Carport Canopies Carport Canopies Caravan Caravan Canopies Canopy Car Canopy Car Canvas Canopy Canvas Canopy Canopys Canopys Wireless Canopy Canopy Wireless Canopy Weights Weights Canopy Tours Canopy Tours Canopy Tents Canopy Canopy Tents Canopy Tarps Tarps Canopy Swings Canopy Swings Canopy Rentals Canopy Canopy Rentals Parts Canopy Canopy Parts Canopy Manufacturers Canopy Manufacturers Kits Canopy Canopy Kits Gazebo Canopy Canopy Gazebo Twin Bed For Canopy Canopy Bed For Twin Factory Canopy Canopy Factory Design Canopy Canopy Design Cribs Canopy Cribs Canopy Canopy Covers Canopy Covers Carport Canopy Canopy Carport Bedroom Set Canopy Canopy Set Bedroom Canopy Bedding Bedding Canopy Sets Bed Canopy Bed Canopy Sets Linens Canopy Bed Canopy Bed Linens Frame Bed Canopy Frame Bed Canopy Covers Canopy Bed Canopy Bed Covers Canopy Accessories Bed Canopy Bed Accessories Crib Canopy Baby Baby Canopy Crib Accessories Canopy Canopy Accessories Canopies Canopies Boat Canopies Canopies Boat Bed Canopys Canopys Bed Canopy Drapes Bed Bed Canopy Drapes Kids Canopies Bed For For Canopies Kids Bed Beach Canopy Canopy Beach Awnings Canopies And And Canopies Awnings Aquarium Canopy Canopy Aquarium Canopy 10x10 Canopy 10x10 10 Canopy X 10 10 10 Canopy X A Electrolux A Electrolux Electrolux 6988a Parts Electrolux 6988a Parts Electrolux Repair 6500 Repair Electrolux 6500 Electrolux 2100 Hose 2100 Electrolux Hose 2100 Electrolux 2100 Electrolux Electrolux 2 1 In Electrolux 2 In 1 Electrolux 1584 Electrolux 1584 1401-b Electrolux 1401-b Electrolux Electrolux 1400xp 1400xp Electrolux Floor Brush Electrolux 14 Floor 14 Brush Electrolux Electrolux 1200xp Electrolux 1200xp Electrolux Electrolux Electrolux El1000a2 Electrolux El1000a2 Dishwashers Dishwashers Cleaners Carpet Carpet Cleaners Canister Vacuum Vacuum Canister Appliances Appliances Appliance Repair Appliance Repair Appliance Parts Parts Appliance Cleaners Air Air Cleaners Vacuum Electrolux Aerus Aerus Vacuum Electrolux Sweeper Aerus Electrolux Sweeper Aerus Electrolux Electrolux 2000 Aerus Aerus 2000 Electrolux Aerus Electrolux Aerus Electrolux Aeg Electrolux Aeg Electrolux Electrolux Ab Ab Electrolux Electrolux Electrolux carpet extractor extractor carpet watch iwc iwc watch replica iwc replica iwc replica co watch jacob replica jacob watch co watch cartier replica cartier watch replica breitling replica watch watch breitling replica rolex swiss replica swiss replica rolex watch fake fake watch rolex fake fake rolex rolex replica replica rolex watch replica rolex replica watch rolex rolex watch watch rolex watch replica replica watch rolex replica rolex replica lamborghini replica best rolex replica natural penis enlargement replica rolex submariner chanel watch replica designer replica watch swiss rolex replica swiss replica rolex watch watches replica cheap watches rolex cheap cheap fake watch cheap replica rolex cheap watch replica rolex watch cheap replica buy watches watches buy rolex buy fake watch buy rolex replica replica watch buy rolex buy watch replica online rolex replica watches rolex watches fake watch replica rolex replica watch rolex watch