CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

How can I deform a mesh with my own program? Currently getting continuity errors!

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   April 23, 2013, 04:00
Default How can I deform a mesh with my own program? Currently getting continuity errors!
New Member
Join Date: Jul 2011
Posts: 5
Rep Power: 8
clarence_carter is on a distinguished road
I have written a program that deforms a mesh by reading in the points file, applying an algebraic deformation of the points, and then replacing the original points file with a new one.

Unfortunately, although I can generate a mesh in this way, postprocess it and view it in paraview, OpenFOAM (interFoam) does not run when using the deformed mesh. Instead, I get this error:

cfdTools/general/adjustPhi/adjustPhi.C[34] [50] [39] at line Continuity error cannot be removed by adjusting the outflow.
Please check the velocity boundary conditions and/or run potentialFoam to initialise the outflow.
Total flux : 72466.1
Specified mass inflow : 992.137
Specified mass outflow : 992.137
Adjustable mass outflow : 4.64372e-11

This is using boundary conditions that work perfectly well with a non-deformed mesh.

I was initially concerned that the deformation was not being performed to a high enough accuracy (my first attempt was with Python), so I re-wrote the program using C++ in double precision, but I still get the same error.

What am I doing wrong?

From analysing the polyMesh structure, the only coordinate information seems to be stored in the points file; everything else appears to be derived from the points file, so this is the only file I have modified. Am I missing something, is there some other file I need to modify?

If anybody has formation or advice to share regarding this problem I will be extremely grateful!
clarence_carter is offline   Reply With Quote

Old   April 23, 2013, 04:31
Senior Member
Pablo Higuera
Join Date: Jan 2011
Location: Singapore
Posts: 404
Rep Power: 12
Phicau is on a distinguished road

it seems that you are starting off the previous results. Your case is most probably blowing up because your fluxes were calculated to fulfil mass conservation for the previous mesh. Now, with the deformed one, your face areas have changed, and therefore you are having mass discontinuities in some cells.

My guess is that you could try to start this case from 0 or (less advised) delete the phi field on your initial folder and see what happens...

Another option is that your topology may be screwed up due to the movement of the points (e.g. twisted faces). If you have tried checkMesh and it is OK, then do not worry for this.


Phicau is offline   Reply With Quote

Old   April 23, 2013, 07:13
New Member
Join Date: Jul 2011
Posts: 5
Rep Power: 8
clarence_carter is on a distinguished road
Thanks for your very fast reply!

Unfortunately I don't think your first suggestion is the answer. I am deforming the mesh before I even run the case, so phi has not been calculated yet.

I have had a look at the checkMesh output and it seems to be reporting a lot of non-orthogonal cells. This is surprising, since the mesh is hexahedral (computed via blockMesh) and the deformation is normal to the hexahedra surface (i.e. in the X-direction).

I will keep thinking on it.
clarence_carter is offline   Reply With Quote


meshing, openfoam, programming

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple floating objects CKH OpenFOAM Running, Solving & CFD 12 March 21, 2016 14:05
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Floating point exception error Alan OpenFOAM Running, Solving & CFD 10 April 6, 2012 14:02
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 15:09
How to control Minximum mesh space? hung FLUENT 7 April 18, 2005 09:38

All times are GMT -4. The time now is 10:48.