CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

makeAxialMesh for OpenFoam-2.0.0

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

Reply
 
LinkBack Thread Tools Display Modes
Old   June 20, 2011, 14:01
Default makeAxialMesh for OpenFoam-2.0.0
  #1
Senior Member
 
Join Date: Jun 2011
Posts: 141
Rep Power: 6
mechy is on a distinguished road
when I compile the makeaxialmesh in openfoam 2 I enconter bellow problem please help me to compile makeAxialMesh


Making dependency list for source file makeAxialMesh.C
could not open file repatch.H for source file makeAxialMesh.C
SOURCE=makeAxialMesh.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-100 -I/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/dynamicMesh/lnInclude -I/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/cfdTools/lnInclude -I/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/meshTools/lnInclude -IlnInclude -I. -I/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude -I/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/OSspecific/POSIX/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/makeAxialMesh.o
makeAxialMesh.C: In function ‘void changeCoordinates(Foam:olyMesh&, Foam:lane, linie&, Foam::scalar, Foam::scalar, bool)’:
makeAxialMesh.C:198: error: ‘mathematicalConstant’ has not been declared
makeAxialMesh.C:199: error: ‘mathematicalConstant’ has not been declared
makeAxialMesh.C: In function ‘void splitWedge(Foam:olyMesh&, Foam::word, Foam:lane)’:
makeAxialMesh.C:255: error: invalid use of incomplete type ‘const struct Foam::SubField<Foam::Vector<double> >’
/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude/Field.H:62: error: declaration of ‘const struct Foam::SubField<Foam::Vector<double> >’
makeAxialMesh.C:257: error: invalid use of incomplete type ‘const struct Foam::SubField<Foam::Vector<double> >’
/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude/Field.H:62: error: declaration of ‘const struct Foam::SubField<Foam::Vector<double> >’
makeAxialMesh.C:258: error: invalid use of incomplete type ‘const struct Foam::SubField<Foam::Vector<double> >’
/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude/Field.H:62: error: declaration of ‘const struct Foam::SubField<Foam::Vector<double> >’
makeAxialMesh.C:261: error: invalid use of incomplete type ‘const struct Foam::SubField<Foam::Vector<double> >’
/home/yas/OpenFOAM/OpenFOAM-2.0.0/src/OpenFOAM/lnInclude/Field.H:62: error: declaration of ‘const struct Foam::SubField<Foam::Vector<double> >’
makeAxialMesh.C:262: error: no match for ‘operator[]’ in ‘fcs[faceI]’
make: *** [Make/linux64GccDPOpt/makeAxialMesh.o] Error 1
mechy is offline   Reply With Quote

Old   June 20, 2011, 18:53
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mechy View Post
when I compile the makeaxialmesh in openfoam 2 I enconter bellow problem please help me to compile makeAxialMesh
Hi!

I won't have time to look into this for the next month (actually I have time, but there is more interesting stuff to do during vacation).

For the time being I'd suggest that you use makeAxialMesh from one of your working 1.x-installations (the solver doesn't care where his mesh comes from, unless the mesh format changed).

If you want to be sure that I remember porting it please add a ticket at https://sourceforge.net/apps/mantisb..._view_page.php (Section "Breeder Stuff" - MAM doesn't have its own section). Of course: if somebody beats me with porting it ... I can live with that

Bernhard
gschaider is offline   Reply With Quote

Old   June 20, 2011, 19:00
Default
  #3
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 14
l_r_mcglashan will become famous soon enough
Quote:
makeAxialMesh.C: In function ‘void changeCoordinates(Foam:olyMesh&, Foam:lane, linie&, Foam::scalar, Foam::scalar, bool)’:
makeAxialMesh.C:198: error: ‘mathematicalConstant’ has not been declared
makeAxialMesh.C:199: error: ‘mathematicalConstant’ has not been declared
The above is because the mathematicalConstant namespace has been split into constant::mathematical. I updated my code using this (comes with a health warning):

Code:
grep -lre 'mathematicalConstant::' . | xargs -d'\n' sed -i 's/mathematicalConstant::/constant::mathematical::/g'
The rest of the errors are probably fixed by adding #include "SubField.H"
__________________
Laurence R. McGlashan :: Website

Last edited by l_r_mcglashan; June 20, 2011 at 19:19.
l_r_mcglashan is offline   Reply With Quote

Old   June 21, 2011, 05:06
Default
  #4
Senior Member
 
Join Date: Jun 2011
Posts: 141
Rep Power: 6
mechy is on a distinguished road
Hi McGlashan
thanks for your explanation
with your command the makeAxialMesh is compiled
I want to Run flow filed about a cone and I create a 2D mesh for this geometry can you help me to convert this mesh to a axisymmetric mesh (wedge mesh) ?
if It is possible Please give me your Email

best regards
mechy is offline   Reply With Quote

Old   August 31, 2011, 03:15
Default
  #5
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 7
jordi.muela is on a distinguished road
Quote:
Originally Posted by l_r_mcglashan View Post
The above is because the mathematicalConstant namespace has been split into constant::mathematical. I updated my code using this (comes with a health warning):

Code:
grep -lre 'mathematicalConstant::' . | xargs -d'\n' sed -i 's/mathematicalConstant::/constant::mathematical::/g'
The rest of the errors are probably fixed by adding #include "SubField.H"
Hi,

thanks! This worked for me! But now i'm having a problem with the function 'collapseEdges'.

Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/libc.so.6"
#3  Foam::polyMesh::calcDirections() const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::polyMesh::polyMesh(Foam::IOobject const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/collapseEdges"
#6  __libc_start_main in "/lib/libc.so.6"
#7  
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/collapseEdges"
Anybody else is having the same problem with OF 2.0.x?

Best regards,

Jordi.
jordi.muela is offline   Reply With Quote

Old   August 31, 2011, 05:05
Default
  #6
Senior Member
 
Laurence R. McGlashan
Join Date: Mar 2009
Posts: 370
Rep Power: 14
l_r_mcglashan will become famous soon enough
What are you trying to do? Did this work in previous versions? Can you post your mesh up here?
__________________
Laurence R. McGlashan :: Website
l_r_mcglashan is offline   Reply With Quote

Old   August 31, 2011, 07:06
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jordi.muela View Post
Hi,

thanks! This worked for me! But now i'm having a problem with the function 'collapseEdges'.

Code:
#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/libc.so.6"
#3  Foam::polyMesh::calcDirections() const in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#4  Foam::polyMesh::polyMesh(Foam::IOobject const&) in "/opt/openfoam201/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#5  
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/collapseEdges"
#6  __libc_start_main in "/lib/libc.so.6"
#7  
 in "/opt/openfoam201/platforms/linux64GccDPOpt/bin/collapseEdges"
Anybody else is having the same problem with OF 2.0.x?

Best regards,

Jordi.
I just pushed a version that is fixed for 2.0 to the SVN (see the wiki for the URL). Tried to reproduce your problem with the testcase (set the origin-vector to (0 0 0)) and "collapseEdges 1e-5 45" works fine for me
gschaider is offline   Reply With Quote

Old   September 9, 2011, 07:53
Default
  #8
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 7
jordi.muela is on a distinguished road
Hi,

sorry for my late answer. First of all, thanks for the new version . I've tested it with the testcase, and it works perfectly, as you've said.

But i'm still having the same problem with my own case. The problem starts when i do the makeAxialMesh. Before using the utility makeAxialMesh, if i do a checkMesh i'm obtaining a "Mesh OK", but if i do the checkMesh after run makeAxialMesh then i'm getting the same message error (floating point exception) that i've posted in the previous post, thus it's a problem with my geometry and the utility makeAxialMesh...

I'm using makeAxialMesh utility after a snappyHexMesh and a extrudeMesh (great improvement of this tool in OF 2.0.x!), because i'm using a STL geometry but i want to solve the case in 2D axisymmetric. In OF 1.7.1 it works great...

I attach an image of the mesh after the makeAxialMesh with the patch names... it's seems ok, at first view..

Thanks a lot for your time, i keep investigating.

Jordi.
Attached Images
File Type: jpg image_gen.jpg (57.0 KB, 68 views)
File Type: jpg vertex_detail.jpg (10.8 KB, 39 views)
jordi.muela is offline   Reply With Quote

Old   September 12, 2011, 05:50
Default
  #9
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by jordi.muela View Post
Hi,

sorry for my late answer. First of all, thanks for the new version . I've tested it with the testcase, and it works perfectly, as you've said.

But i'm still having the same problem with my own case. The problem starts when i do the makeAxialMesh. Before using the utility makeAxialMesh, if i do a checkMesh i'm obtaining a "Mesh OK", but if i do the checkMesh after run makeAxialMesh then i'm getting the same message error (floating point exception) that i've posted in the previous post, thus it's a problem with my geometry and the utility makeAxialMesh...

I'm using makeAxialMesh utility after a snappyHexMesh and a extrudeMesh (great improvement of this tool in OF 2.0.x!), because i'm using a STL geometry but i want to solve the case in 2D axisymmetric. In OF 1.7.1 it works great...

I attach an image of the mesh after the makeAxialMesh with the patch names... it's seems ok, at first view..

Thanks a lot for your time, i keep investigating.

Jordi.
Does the FPE still occur in calcDirection of polyMesh? I'm afraid then the problem is there. What probably happens is that MAM produced faces with an area of 0 and it is difficult to calculate a normal vector on these in a numerically stable way.

What you could do to pinpoint this problem: use MAM 2.0 then do checkMesh and or collapseEdges with 1.7. If that works then something in 2.0 was reimplemented that makes this fail. In that case write a bug-report on the OpenCFD-Mantis

Bernhard
gschaider is offline   Reply With Quote

Old   September 19, 2011, 23:14
Default
  #10
New Member
 
Pallav Jha
Join Date: Apr 2011
Posts: 17
Rep Power: 6
Pallav is on a distinguished road
Hi Bernhard,

I am using your makeAxialMesh utility with OF-2.0 but running into problems that I cannot resolve.

<code>

object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices
(
(5 505 -0.5)
(0 505 -0.5)
(5 500 -0.5)
(0 500 -0.5)
(5 0.5 -0.5)
(0 0.5 -0.5)
(15 500 -0.5)
(15 0.5 -0.5)
(5 505 0.5)
(0 505 0.5)
(5 500 0.5)
(0 500 0.5)
(5 0.5 0.5)
(0 0.5 0.5)
(15 500 0.5)
(15 0.5 0.5)
);
blocks
(
hex (3 2 0 1 11 10 8 9) (20 5 1) simpleGrading (1 1 1)
hex (5 4 2 3 13 12 10 11) (20 1000 1) simpleGrading (1 1 1)
hex (4 7 6 2 12 15 14 10) (30 1000 1) simpleGrading (1 1 1)
);
edges
(
);
patches
(
patch inlet
(
(0 1 9 8)
)
wall inletWall
(
(0 2 10 8)
)
patch atmosphere
(
(7 4 12 15)
(4 5 13 12)
(2 6 14 10)
(6 7 15 14)
)
empty frontAndBack
(
(1 0 2 3)
(2 6 7 4)
(3 2 4 5)
(9 8 10 11)
(10 14 15 12)
(11 10 12 13)
)
patch center
(
(1 3 11 9)
(3 5 13 11)
)
);
mergePatchPairs
(
);
// ************************************************** *********************** //

<code>

makeAxialMesh writes the new mesh to 0.01; however, collapseEdges 1e-8 180 gives
Collapsing 0 small edges
Collapsing 0 in line edges

The same is for values from 1e-6 to 1e-8

Please advise me as to what I should do.

Thanks and regards.
Pallav is offline   Reply With Quote

Old   September 20, 2011, 03:54
Default
  #11
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 7
jordi.muela is on a distinguished road
Hi Pallav,

Are you running OF 2.0.x? This code for the dictionary blockMeshDict that you've posted is wrote in OF 1.x.x syntax, it shouldn't work in OF 2.0.x.

Best regards,

Jordi.
jordi.muela is offline   Reply With Quote

Old   September 20, 2011, 05:01
Default
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Pallav View Post
Hi Bernhard,

I am using your makeAxialMesh utility with OF-2.0 but running into problems that I cannot resolve.


makeAxialMesh writes the new mesh to 0.01; however, collapseEdges 1e-8 180 gives
Collapsing 0 small edges
Collapsing 0 in line edges

The same is for values from 1e-6 to 1e-8

Please advise me as to what I should do.

Thanks and regards.
Are you sure that the axified mesh is the one that CE wants to collapse? Check the output which mesh is read (make sure that startFrom in controlDict is set to latestTime)

If that is not the problem visually check the mesh in paraview
gschaider is offline   Reply With Quote

Old   September 20, 2011, 21:07
Default
  #13
New Member
 
Pallav Jha
Join Date: Apr 2011
Posts: 17
Rep Power: 6
Pallav is on a distinguished road
Hello Bernhard,

Thanks for your reply.

Here are the steps that I took:
  1. cd case_folder
  2. blockMesh
  3. cd ..
  4. makeAxialMesh -axis center -wedge frontAndBack (This created a folder 0.01)
  5. cd case_folder/system (to edit controlDict for changing startTime to latestTime)
  6. cd ..
  7. collapseEdges 1e-8 180
This gives the following output:

<code>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0.01

Merging:
edges with length less than 1e-08 meters
edges split by a point with edges in line to within 179 degrees

Collapsing 1006 small edges
Morphing ...
Collapsing 0 small edges
Collapsing 0 in line edges
Max face area:6.54291e-07
Collapse area factor:1e-09
Collapse area:6.54291e-16
Collapsing 0 small high aspect ratio faces
Writing collapsed mesh to time 0.02
End
<code>

So, if I understand correctly, the final axisymmetric mesh is in the folder 0.02.

How do I check the mesh for this time step? I get an error if I try paraFoam or paraView.

Thanks a lot.

Regards,
Pallav


Quote:
Originally Posted by jordi.muela View Post
Hi Pallav,

Are you running OF 2.0.x? This code for the dictionary blockMeshDict that you've posted is wrote in OF 1.x.x syntax, it shouldn't work in OF 2.0.x.

Best regards,

Jordi.
Hello Jordi,

I am running OF-1.7-x on a supercomputer. I run OF-2.0.1 on my laptop.
I have run the corresponding svn codes to build makeAxialMesh at both places.

I transferred the case_folder from the supercomputer and ran it on my laptop. Hence, the difference in syntax in the blockMeshDict file. However, there is no problem when I run 'blockMesh'.

checkMesh gives 'OK'

However, I did get the same error as you when I did a checkMesh after makeAxialMesh.

So, I went back to the supercomputer and did everything from scratch in OF-1.7-x

Thanks and regards.
Pallav is offline   Reply With Quote

Old   September 21, 2011, 05:33
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Pallav View Post
Hello Bernhard,

Thanks for your reply.

Here are the steps that I took:
  1. cd case_folder
  2. blockMesh
  3. cd ..
  4. makeAxialMesh -axis center -wedge frontAndBack (This created a folder 0.01)
  5. cd case_folder/system (to edit controlDict for changing startTime to latestTime)
  6. cd ..
  7. collapseEdges 1e-8 180
This gives the following output:

<code>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0.01

Merging:
edges with length less than 1e-08 meters
edges split by a point with edges in line to within 179 degrees

Collapsing 1006 small edges
Morphing ...
Collapsing 0 small edges
Collapsing 0 in line edges
Max face area:6.54291e-07
Collapse area factor:1e-09
Collapse area:6.54291e-16
Collapsing 0 small high aspect ratio faces
Writing collapsed mesh to time 0.02
End
<code>

So, if I understand correctly, the final axisymmetric mesh is in the folder 0.02.

How do I check the mesh for this time step? I get an error if I try paraFoam or paraView.
"checkMesh -time 0.02" should tell you whether the mesh is OK

Of course the error would be helpful. Try the following: deselect all fields before changing the time-step.

Alternatively rerun all mesh-manipulation with -overwrite. That would make sure that the final mesh is in constant/polyMesh
gschaider is offline   Reply With Quote

Old   September 21, 2011, 18:40
Default
  #15
New Member
 
Pallav Jha
Join Date: Apr 2011
Posts: 17
Rep Power: 6
Pallav is on a distinguished road
Thank you Bernhard.
I was able to visually check the mesh and everything looks great. (OF-1.7)

I adapted the new patches to the p_rgh, U, etc. files as per your comment about adapting fields at http://www.cfd-online.com/Forums/ope...tric-flow.html

However, I run into a few errors. I guess this is not the correct thread to discuss about the same. I will post them in some other thread.

Thanks once again for your help.

Regards,
Pallav
Pallav is offline   Reply With Quote

Reply

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
makeAxialMesh issue feijooos OpenFOAM Meshing & Mesh Conversion 8 October 23, 2014 05:21
makeAxialMesh and axisymmetric flow yassepid OpenFOAM Mesh Utilities 4 April 24, 2013 20:01
OpenCFD release OpenFOAM® version 2.0.0 opencfd OpenFOAM Announcements from ESI-OpenCFD 1 July 1, 2011 08:43
makeAxialMesh > collapseEdges!! billynoe OpenFOAM 17 February 21, 2011 05:29
How to Import Gambit 2.2.16 file to Gambit 2.0.0 solomon FLUENT 0 January 4, 2007 15:49


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