CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Problem using AMI (https://www.cfd-online.com/Forums/openfoam-solving/95697-problem-using-ami.html)

ADGlassby April 21, 2013 16:55

Alexander,
Thanks for your patience!! I think I didn't understand what the AMI interface was! OK I have divided my geometry up into a cylindrical domain containing the two sectors and the overall domain with a cylinder of the same dimension in place of the two sectors. If I look at the propellor example which is 3D would this be a good place to be? I know this is 3D but from what I can see it involves stitching together a propellor and shaft geometry into a cylindrical domain.

I am beginning to think that persevering with this snappyHexMesh method may be worth it in the end and I think I'm getting close to having a working geometry.

Thanks again

Andrew

ADGlassby April 23, 2013 17:22

Hi Alexander,

Is there any chance you could take a look at my test AMI model please? I have gone through the propeller example step by step and tried to understand each step. I'm pretty sure I understand what the theory is but the execution is just leaving me behind. The model I have put together is effectively the 2D mixer example but using snappyHexMesh to do the meshing. There are a couple more steps in the snappyHexMesh steps then the propeller example simply because I am doing 2D meshing so there are a couple of steps to deal with this.

The part I am having trouble understanding is the removal of the inner cylinder patch and replacing with the AMI interface and the baffle creation.

I feel like I am almost there but the final step is just out of reach.

If you have the time I could zip the model and send direct to you?

Many thanks for your help.

Kindest Regards

Andrew

ADGlassby April 24, 2013 17:54

I have been working with OpenFoam v 2.1.1 and have noticed that version 2.2 has the capability of introducing baffles using snappyHexMesh. Does anyone have any examples of this capability? I'm particularly interested in the propeller or mixer AMI examples. I am going to be looking at doing these examples using snappyHexMesh baffles but I think I might need some further help in time.

I'm currently installing/compiling OpenFoam v2.2 on my MacBook (Mountain Lion) so I will be exploring this new installation over the next couple of days.

I would very much appreciate anyones advice or suggestions

Kindest Regards
Andrew

ADGlassby April 29, 2013 11:10

1 Attachment(s)
OK..... I've been looking at creating my mesh using the new updated snappyHexMesh (OpenFOAM 2.2) and creating the baffle for AMI interface using sHM. I have managed to create a cylindrical baffle which has two entries in the /Constant/polyMesh/boundaries file. These entries are innerCylinder_patch0 and innerCylinder_patch0_slave. From what I can see from baffles information this should give me the baffle allowing movement from one side of the baffle to the other.

I'm at a bit of a loss because I'm not REALLY sure what to do with the mesh now. I have tried simply renaming the baffles as AMI1 and AMI2 using the information in the propellor example to populate the AMI entries "correctly".

I have managed to get the model to run and I can see that my "rotor" begins to rotate but I am finding that the AMI interface just stretches and doesn't slide like in the mixer example.

Would anyone be able to advise what else I need to modify to get the AMI interface to slide correctly? I have zipped and attached the blank model for anyone to take a look at my working.

Thanks and Kindest Regards

Andrew

wyldckat April 29, 2013 17:31

Greetings to all!

@Andrew: I didn't look at the file you attached, but I would like to suggest that you have a look a tutorial that was added today to OpenFOAM 2.2.x, namely "compressible/rhoPimpleDyMFoam/annularThermalMixer": https://github.com/OpenFOAM/OpenFOAM...arThermalMixer
It uses snappyHexMesh for generating the mesh and uses AMI, so I can only guess that this tutorial case can give you some more clues on what you can do!

Best regards,
Bruno

ADGlassby April 30, 2013 06:26

Bruno,

Thanks for your pointer.

Did constant/BoundaryConditions and caseSettings get introduced in 2.2.x ?? I have been using 2.2.0 and using the old way of setting boundary and initial conditions.... took me a moment to find my bearings but I think I might like this way of working better.

Incidentally since the 0/ initial conditions files for each of the properties are not populated with numeric information for the start condition (since caseSettings sets this now) paraFoam is having a bit of a sulk. But just stepping past the 0 seconds point cheers it up again! I'm running OpenFOAM on a Mac so I'm wondering if there might be an automatic way of kicking ParaFoam off beyond the 0 second step??

Best Regards
Andrew

wyldckat April 30, 2013 18:23

Hi Andrew,

The file that sets default boundary conditions already exists since 2.2.0. You can see the path to said file by running:
Code:

echo $WM_PROJECT_DIR/etc/caseDicts/setConstraintTypes
It relies on the new patch grouping mechanism: http://www.openfoam.org/version2.2.0...g.php#x5-17000

As for paraFoam, the trick is to not click on the "Apply" button right away. First skip to the next time snapshot and then click on the Apply button.
Another possibility is to rename the folder "0" after starting/stopping the solver... and before running paraFoam...

Best regards,
Bruno

arnau1985 May 2, 2013 03:35

Hi Randomizer,

Thanks for your reply and sorry for my delay, I've been busy lately. I managed to make my case work (it seems it was some problem regarding the cellZones definition).

BTW, If somebody is interested in running a case with a Salome mesh using pimpleDyMFoam and AMI interfaces, do not hesitate to send me a private message and I'll send them a case they can use as a template, although setting up a case like that from the scratch is quite straightforward.

ADGlassby May 3, 2013 13:15

Hi Bruno,

Thanks for the pointers. Sorry it's taken so long to respond!

I've been looking through the annularHeater example and I can see the theory.

Let me see if my understanding is correct:
- create the backgroundMesh
- extract the surfaceFeatures of the graphic/CAD files for use in sHM

execute sHM.
- one of the obj files is noted as AMI.obj my understanding is that this file creates a marker for the AMI interface
-Once the mesh has been created use createPatch to clear out unused, zero faces, patches.
- createBaffles actually creates the AMI interface with the cellZone on the AMI and the faceZone on the AMI_slave so rotating zone can slide around the interface.
- slipBaffles makes the split at the interface created above releasing the faces and cells at the interface.

So I'm pretty sure I understand this theory and I believe I can recreate it. My problem is that to get form a 3D mesh to a 2D mesh I loose all the definition of the AMI interface. I believe this is a limitation of extrudeMesh.

I have looked at the wingMotion 2DMesh example on OpenFOAMWiki and have tried the AutoPatch 90 -overwrite directive but since my mesh is circular I end up with 360 auto patches :-(

Do you have any suggestions as to how I can move from a 3D to a 2D mesh AND maintain my AMI interface definition?

I haven't attached my working example directory since it is quite lareg, larger than allowed I believe

your help, as alway is much appreciated!

Regards

Andrwe

wyldckat May 3, 2013 14:11

Hi Andrew,

What you're looking for is createPatch. There is a dictionary example in OpenFOAM: https://github.com/OpenFOAM/OpenFOAM...reatePatchDict

For more examples, run:
Code:

find $WM_PROJECT_DIR -name createPatchDict
Best regards,
Bruno

ADGlassby May 4, 2013 12:54

Ok, I'm stepping through very carefully right now. I'v created the mesh and flattened / extruded it to 2D mesh dimensions.

In the preparatory steps I included a circular boundary STL . This is the location of my AMI interface. I have created a createPatchDict which creates a new patch based on the boundary created above. Is this correct? I have asked createPatch to create this patch as a baffle is this correct?

I have taken a look in constants/polyMesh/boundary and seen that the new patch exists as a zero faces patch. looking in paraFoam I don't actually see anything in the graphic. I guess this is because the new patch is zero face??

From my understanding of AMI and rotating meshes the cells INSIDE the cylindrical zone must move to do this should I be looking to use topoSetDict too?

Thanks for your help!!

Andrew

wyldckat May 4, 2013 13:19

Hi Andrew,

I might be wrong, but aren't AMI interfaces usually of type "cyclicAMI"? I think you can create cyclics directly, without relying on intermediate baffles... unless you want a baffle to act as a wall.

Sometime ago I played a bit with "cyclic" vs "cyclicAMI", for making things easier to run in parallel: http://www.cfd-online.com/Forums/ope...tml#post398703 - post #12 - it relies on blockMesh for the mesh, but it's a very similar configuration if the cyclics were made with createPatch.

Note: As you should be able to see on the "createPatchDict" example, there are at least two relations between cyclics: linear transformation and rotation. So keep in mind which type you're dealing with.

As for AMI, my experience is extremely limited: my guess is that you'll need to select the cellZone with topoSet which will be moving around. This is where all other tutorials can help.

Best regards,
Bruno

reza1980 May 6, 2013 06:31

Two zones ...
 
2 Attachment(s)
Hi Foamers,
My project is to simulate a propeller by AMI . I used ver 2.1x and run the case .After taking the results I found there are two odd zones around the shaft which are progressing along the length of cylinder,please look at the attachment.
I change the ver to 2.2x but there is the same .
Would you please let me know your ideas in this regard.
The first thing coming to my mind is createAMIFaces.topoSetDic ,But I am not sure.
Best/Reza

reza1980 May 6, 2013 06:41

[/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
{
name innerCylinder;
type cellSet;
action new;
source cylinderToCell;
sourceInfo
{

p1 (1.3081096 0 0);
p2 (2.882 0 0);
radius 2.21;
}
}

{
name innerCylinder;
type cellZoneSet;
action new;
source setToCellZone;
sourceInfo
{
set innerCylinder;
}
}

);

// ************************************************** *********************** //]

reza1980 July 16, 2013 05:02

Hi all,
I hope you are fine. I am working on AMI to handle a propeller case. My results seems not acceptable.
would you please let me your instruction to implement AMI.
I use this:

* Export two parts like Stator and Rotor from pointwise to OpenFoam
* Merge to parts as mergeMeshes Stator Rotor
* Update Boundary (Add cyclicAMi and tolerance)
* Use splitMeshRegions -makeCellZones -overwrite to make cellZones

I look forward to hear from you

Best
Reza

ADGlassby July 16, 2013 07:40

OK, the way I got my mesh to move using Pointwise was:
Note, my model is 2D and I imported a flat IGES file into Pointwise. The IGES included all the model, I did not have to merge two meshes together here.

- Make the model with a single cylindrical feature around the area I wanted to move. So in your case that would be around your rotor.
- Create the mesh (I created a structured mesh) ensuring that you mesh up to BOTH sides of the surrounding cylinder.. This ensures you have good mesh resolution at your AMI interface.
- I selected everything and extruded in the Z direction. While I was extruding I made sure that the build process did NOT make one face per block. This had the effect of making the AMI cylinder unselectable and it doesn't become an undefined boundary in your constant/polyMesh/boundary file.
- Define BCs and export the mesh to OF.

once in OF it is a case of using topoSet to create cellSets on either side of your AMI boundary. this is done using an .obj file with a cylinder of exactly the same dimension as your AMI boundary....... don't forget to check your boundary file to see what units PointWise exported in and make your .obj file in the same units!! caught me out a couple of times. The topoSet entry you need is:

name cellSetName;
type cellSet;
action new;
source surfaceToCell;
sourceInfo
{
file filename.obj;
outsidePoints ((x y z)); // This is a point that lies in a cell OUTSIDE your AMI region
includeCut true; // cells cut by surface
includeInside true; // cells not on outside of surf
includeOutside false; // cells on outside of surf
nearDistance -1; // cells with centre near surf
// (set to -1 if not used)
curvature 0.9; // cells within nearDistance
// and near surf curvature
// (set to -100 if not used)
}

then use this cellSet to define your outer cellSet..... cellToCell and then invert. finally create a faceSet based on your innerCellSet

I then used setsToZones, at the command line, to create the cell and face Zones. I had a problem (which I haven't resolved yet) with doing the cell and face zones in topoSet.

Once this is done use createBaffles -overwrite and finally mergeOrSplitBaffles -split -overwrite.

You can check that your mesh moves by using moveDynamicMesh at the command line. you should get a load of folders with timestamps on them. paraFoam should then show you your moving mesh.

Hope this helps. I know it's 2D but it should apply equally to 3D, the only thing I'm not sure about is the dodge in Pointwise at the extrusion to avoid creating an internal wall.

Best regards

Andrew

ADGlassby July 16, 2013 07:47

Bruno,

thanks for your response! Sorry I haven't responded sooner, I seem to have missed it come in! Anyway, I managed to get my mesh moving. I had a look at Pointwise to create the mesh and then used topoSet and createBaffles etc.... see my post back to Reza

I will be going back into snappyHex to see if I can re-create the mesh that I made in Pointwise. I think I have a plan forming for this!!

Anyway I think I will be coming back to you on my next step which is getting my model to actually work with a numerical solver now that I have a mesh to run with. I'm having problems with rhoPimpleDyMFoam at present. I'm going to puzzle it over a little longer then I think I will accept I'm lost and call for help :-)

Best Regards

Andrew

reza1980 July 19, 2013 08:58

I have run a propeller case with AMI but have noticeable different results with my AMI case and experimental values. In this regard,I reconsider tutorial of propeller and take this steps to run it,


Going step by step through the allrun.pre

1. run blockMesh - create a rectangular domain
2. extract features of the outerCylinder - will form the new domain, innerCylinder - will form the refinement region, innerCylinderSmall - will form the AMI interface
3. snap the mesh to the inside of the outerCylinder but keeping the cells inside the inner and innerSmall cylinders
4. run topoSet to remove the cellZones created by snappy
5. again, run topoSet and create faceZones which will form the inlet and outlet (note: the inlet and outlet patches from the initial domain are now empty because outerCylinder small to which the mesh has been snapped is smaller than the initial domain)
6. run topoSet yet again to create the cellZone which will form the AMI interface. the steps here are as follows:
6.1 select the cells in the inenrCyl
6.2 select the same cells once again in the set called outerCells
6.3 invert the selection of outerCels thereby selecting all the cells outside the innerCyl
6.4 convert the innerCyl cellSet to a cellZone and then to a faceSet
6.5 pick the faces at the interface between the outerCells and the innerCylinder (I am not entirely sure about this step)
6.6 Select all faces in the faceSet orientated so slave side is in innerCylinderSmallcellSet
6.7 create a dummy face set apparently needed by createPatch application
7. create the inlet & outlet patches from the sets you've created before
8. create baffles from the face zone that is there already
9. split the baffle so that you have master and slave faces of the ami (inner and outer layer as I understand it)

But I am not sure ,my case ,whose mesh generated by pointwise ,would implement like below
* Export two parts like Stator and Rotor from pointwise to OpenFoam
* Merge to parts as mergeMeshes Stator Rotor
* Update Boundary (Add cyclicAMi and tolerance)
* Use splitMeshRegions -makeCellZones -overwrite to make cellZones

and doesn't need to create face Set and createAMIFaces.topoSetDict?!
Best
Reza

wyldckat July 21, 2013 05:55

Greetings to all!

@Reza: I noticed that your question this is related to this thread: http://www.cfd-online.com/Forums/ope...utorial-3.html

I thought that this was the post where you had finally figure out how things work... I guess not :( I'll try to have a look into that other thread when I can.

Best regards,
Bruno

reza1980 July 21, 2013 05:58

Bruno,
I made that page my self. But my question is related to handle AMI with pointwise mesh not snappy that tutorial is managed with.


All times are GMT -4. The time now is 00:32.