CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   A question on adaptive remeshing or mesh deformation for handling object motions (http://www.cfd-online.com/Forums/openfoam/79943-question-adaptive-remeshing-mesh-deformation-handling-object-motions.html)

daveatstyacht September 8, 2010 21:06

A question on adaptive remeshing or mesh deformation for handling object motions
 
Hi all,
I have been trying to run interDyMFoam on a model with a very fine mesh near the surface of a boat hull. Unfortunately, the motion of the hull due to heave and trim causes the small cells near the hull to collapse and results in a divergence after a mere two hundredths of a second. I have traditionally used an inverseDistance diffusivity and this has worked fine for a coarse mesh, but I am now trying to better capture the boundary layer with a finer mesh and have run into trouble since. I have decided that there are two possible solutions to these problems.

Solution 1: Create a mesh that is static relative to the hull in a region surrounding the hull where the mesh is finest and deform coarser cells farther away. This seems like the preferred approach since it saves the time consuming process of remeshing, but I have not managed to create a region of cells that will be recognized in the arguments of BC and the dynamicMeshDict. I have tried creating a cell set but have not been able to get it to modify the constants files (boundary and faceZones in particular). Does anyone know the set of commands to take a cell set and make it into a useful cell region for this problem? Also does anyone know if the region needs BC in the /0 folder and if so what the pointDisplacement BC should be to move with the hull?

Solution 2: Use mesh deformation as it is but then remesh when the cell deformation gets severe enough. This remeshing posses two problems to me. First I need to define the remeshing based on the magnitude of cellDisplacement, but the remesher is looking for a VolScalarField such as alpha1 or p. Does someone know if it is possible to do this at run time or will this require modifying the code? Secondly, I have tried running with both dynamic mesh options active (inverseDistance diffusivity and then refinemesh based on alpha1 to keep to what know works in the tutorials). Unfortunately, it wont run at all in parallel because it is looking at both the global and processor cell levels and see a different number of cells and aborts. When I tried to run it one processor I get the following error:

FOAM FATAL ERROR:
Only call if constructed with history capability

From function hexRef8::getSplitPoints()
in file polyTopoChance/polyTopoChange/hexRef8.C at line 4884.

FOAM aborting

In any case any insight into either approach (particularly the first since it looks more promising) would be greatly appreciated.

Regards,
-Dave

Ralph M October 31, 2010 13:25

Hello Dave,

This is exactly the problem that I'm facing. The courant number is going through the roof after just a few milliseconds. Did you also observed that the linear and angular velocities became large?

Did you already found a solution for this problem?

What I've been trying to do is increase the quality of the mesh near the hull; e.g. by creating a more even mesh. Unfortunately this seems very difficult at the moment.

Looking forward to your (or someone else) reply.

daveatstyacht November 1, 2010 16:40

Ralph,
Glad to see I am not the only one trying to tackle this problem. As I said in my message to you yesterday, I have not had time to work on the problem in the last month. I can how ever share where I have gotten so far. Yes my courant number blows up (9000+ and climbing, and the linear velocity went through the roof. Restraint forces and moments did as well). It blew up after 0.02 seconds and playing with relaxation factors did not seem to solve the problem. So the first method I mentioned above was the way I have tried to fix the problem. What I tried to do was create a region in the problem domain. I have tried two sets of commands to attempt this.
Create a cell set using the cellSet command and cellSectDict file (you have to poke around to find a template of this in the files that come in OF, I forget where it is) to specify a region around the hull. Create a face set through the faceSet command and the faceSetDict file and then create a patch from that face set using the createPatch command and a createPatchDict file. Unfortunately, the setting to specify the boundary faces of the cell set for use with the faceSet command has yet to be determined.
2) Another possible command after cellSet is to use subsetMesh (cellsetname) -patch (a predefined patch name) since this appears to place the exposed cell faces onto the patch. The cell set definition is very flexible and can be very selective because one of the options is to specify a set based on a distance from a patch (the hull). Alternatively a patch could be defined in blockMeshDict that is a rectangular prism surrounding the hull (including possibly the domain boundaries). This patch could then be used to specify diffusivity. I have not managed to get either of these methods to work simply because I have not been able to find any guidance on these relatively simple task in any forum post or OF documentation.
An alternative is there is another solver besides the displacementLaplacian solver used by dynamicMeshDict called the LaplaceFaceDecomposistion solver which can be used when the order of magnitude of the maximum displacement is not known or known to be big. The mesh is rebuilt after a decomposition of all cells and faces and the Laplace smoothing equation is solved by the Finite Element Method. Unfortunately, this method is both computationally more costly and and currently only available in the dev versions of OF to my knowledge. I was not able to find where it is located, but I believe it is available in OF 1.5 Dev (someone please correct me if I am wrong).

I believe that this problem is coming about because of the small cells are being inverted, since I never had an issue when I used a very coarse mesh (too coarse to be accurate for pressure forces and completely lacking a BL mesh)

Please let me know if you make any progress since this problem has been bugging me for quite some time even though I have not had time to work on it further.
Regards,
Dave

Ralph M November 1, 2010 17:44

Hi Dave,

I think we're on the same road and your solutions seem to be worth trying. I'll give it a shot tomorrow, let you know what happens.

I also tried a HO mesh (rectangular top view and a circular front view) but that didn't worked out either.

Regards,

Ralph

Ralph M November 5, 2010 10:50

Hi all,

I've been talking to prof. Hasak on the first dutch open foam day. The result of the conversation is not very positive; according to him the pressure in the system is ill defined which is why the code explodes. Possible solution is to rewrite the solver...

I'm busy in the next few days, but will have a look at it next week.

Regards,

Ralph

daveatstyacht November 5, 2010 11:41

That sounds like this problem may be a little more involved than I had originally hoped. Did he indicate in any further detail what the issue with how pressure is defined actually is/ provide any hints about how to address the problem?

Ralph M November 5, 2010 11:44

Well, he already has a solution for the problem! Unfortunately he is sharing this solution only with the AC team he's working with so:
-we wait untill this agreement is ended
-we find the solution ourselves :D

Ralph M November 10, 2010 06:50

I've found some sort of solution: shipFoam!

Go to http://www.cfd-online.com/Forums/ope...e-gravity.html and have a look. I'm trying to get it to work for OF 1.7.1 but i'm already facing dome problems. Keep you updated.

Ralph

daveatstyacht November 10, 2010 14:27

Ralph,
I investigated shipFoam back in August and I think that there is certainly the possibility of utilizing pieces of it for such aspects as recording vessel attitude (and certain other features), but I recall reading that there was a fundamental flaw in how the viscous forces were handled. Try searching shipfoam on the forums and I think if you dig far enough you will find the same conclusion. I wish I could send you the link but the forum is intolerably slow and I can't get to the search options in a reasonable time frame.

Regards,
Dave

Ralph M November 10, 2010 16:24

Hi Dave,

I didn't read anything about that particular problem but I'll be investigating it tomorrow. Since shipFoam is combined from interFoam and ... (???) I thougt the solution would be good enough. Anyway; I've got a problem running at the moment and I'm planning to do some yacht-simulation tomorrow.

Keep you updated.

Ralph

Ralph M November 13, 2010 09:29

Quote:

Originally Posted by daveatstyacht (Post 282984)
Ralph,
I investigated shipFoam back in August and I think that there is certainly the possibility of utilizing pieces of it for such aspects as recording vessel attitude (and certain other features), but I recall reading that there was a fundamental flaw in how the viscous forces were handled. Try searching shipfoam on the forums and I think if you dig far enough you will find the same conclusion. I wish I could send you the link but the forum is intolerably slow and I can't get to the search options in a reasonable time frame.

Regards,
Dave

Dave,

Shipflow just uses interdymFoam and has therefore the same functions. However, in the example files only laminar flow is used. Didn't tried RAS at the moment because of available computational power but I wil have a look into this matter in the future.

Cheers,

Ralph


All times are GMT -4. The time now is 18:35.