CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[mesh manipulation] Generating nonuniform meshes with sizefunction

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 16, 2009, 05:21
Default
  #21
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17
johndeas is on a distinguished road
I modified the end of my code this way:

Code:
mesh.movePoints(points);

runTime.functionObjects().off();

runTime++;

mesh.write();
And I don't have errors related to fieldAverage anymore. A new time directory is created, but, only points are exported, not the full mesh with boundaries, owners, neighbours, etc... which doesn't make all this very useful.
johndeas is offline   Reply With Quote

Old   July 16, 2009, 06:49
Default
  #22
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17
johndeas is on a distinguished road
I tried to understand a little how all this work.

In an fvMesh, the write() method is a reimplementation of the virtual write() inherited from polyMesh, itself inherited from objectRegistry (and itself from regIOobject).

But, when fvMesh::write() is called, the following code is executed

Code:
bool fvMesh::write() const
{
    return polyMesh::write();
}
and thus the regIOobject::write() is called, in the end.

The problem in my case is that the only written file is points.

When the fvMesh mesh is created, with

Code:
Foam::fvMesh mesh
(
    Foam::IOobject
    (
     Foam::fvMesh::defaultRegion,
     runTime.timeName(),
     runTime,
     Foam::IOobject::MUST_READ
    )
);
the IOobject provided is used by the inherited constructor of polyMesh, which creates the faces_, owner_, etc... each with their own IOobject, and registering all them on the fvMesh object. I don't see where is the difference of treatment, and why only the "points" file is exported.

Plus, if I try a

Code:
mesh.names()
I get:
Code:
11
(
cellZones
fvSolution
meshPhi
points
neighbour
faces
faceZones
fvSchemes
pointZones
boundary
owner
)
Which made me expect to find those files in the time directory.

Last edited by johndeas; July 16, 2009 at 07:10.
johndeas is offline   Reply With Quote

Old   July 19, 2009, 14:10
Default
  #23
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18
henrik is on a distinguished road
John,

it's all about saving disk space.

When OF write a mesh, it only saves data that has changed after the last dump. On read OF goes backwards through the time dumps and collects the necessary data.

All what you have to do in order to obtain a "normal" mesh is to copy 1/polyMesh/points into constant/polyMesh and delete the "1" time directory.

Henrik
henrik is offline   Reply With Quote

Old   July 19, 2009, 14:52
Default
  #24
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17
johndeas is on a distinguished road
Thank you for the information !

Well rewriting the whole polyMesh forced me to dive a little into OF structure which wasn't a bad thing, after all
johndeas is offline   Reply With Quote

Old   July 20, 2009, 05:36
Default
  #25
Senior Member
 
John Deas
Join Date: Mar 2009
Posts: 160
Rep Power: 17
johndeas is on a distinguished road
Something that might be attractive (my 2 cents...) would be to have the same kind of rule for field reading. If I apply a preprocess on the mesh, which outputs to other time directories, the process of field reading would detect and use the latest version so I don't have to manually copy everything on the last time directory.
johndeas is offline   Reply With Quote

Old   March 26, 2010, 04:58
Default hyperbolic mesh
  #26
New Member
 
guillaume maurice
Join Date: Mar 2010
Posts: 4
Rep Power: 16
guillaumem is on a distinguished road
Hi
I am also performing LES on channel flow and i would like to use ane hyperbolic mesh does someone has some know how to do that how to implement the routine in the code
guillaumem is offline   Reply With Quote

Old   April 11, 2010, 06:01
Default
  #27
New Member
 
Bertrand Delvaux
Join Date: Apr 2010
Posts: 29
Rep Power: 16
Bertrand is on a distinguished road
Hello Alberto,

I am very new to OF and would like to know if it is possible for you to send me your code about "hyperbolic" (or any other analytical function" meshing? Because I would like to implement it on a variable cross-sectional cylinder, with the number of cells depending on the radius, for instance...

Thank you very much!

Best,

Bertrand
Bertrand is offline   Reply With Quote

Old   April 18, 2012, 04:53
Default final code
  #28
Member
 
Lev
Join Date: Dec 2010
Posts: 31
Rep Power: 15
levka is on a distinguished road
Hello guys,
could you please upload final working code...
levka is offline   Reply With Quote

Old   July 31, 2017, 18:50
Default
  #29
Member
 
Kaufman
Join Date: Jul 2013
Posts: 55
Rep Power: 13
kmefun is on a distinguished road
Quote:
Originally Posted by alberto View Post
Thanks Hrv. It works! :-)
Hello Alberto
I know this is a very old thread. But could you possibly share your code of how to move the internal points of a uniform mesh?

Thank you,

Kaufman
kmefun is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Other] Generating hex meshes STutexas OpenFOAM Meshing & Mesh Conversion 1 February 24, 2016 03:55
generating OpenFOAM meshes with pointwise robo OpenFOAM Pre-Processing 1 April 29, 2014 14:47
Doxygen documentation Tanay OpenFOAM Installation 9 September 23, 2011 12:40
ParaView and Qt 4.3.5 on Mac OS X 10.6 Adrian OpenFOAM 3 August 8, 2010 04:16
Generating big meshes with GAMBIT on NT Andrew Ooi FLUENT 12 February 2, 2000 23:26


All times are GMT -4. The time now is 05:14.