CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   makeAxialMesh for OpenFoam-2.0.0 (http://www.cfd-online.com/Forums/openfoam/89706-makeaxialmesh-openfoam-2-0-0-a.html)

mechy June 20, 2011 14:01

makeAxialMesh for OpenFoam-2.0.0
 
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::polyMesh&, Foam::plane, 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::polyMesh&, Foam::word, Foam::plane)’:
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

gschaider June 20, 2011 18:53

Quote:

Originally Posted by mechy (Post 312764)
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

l_r_mcglashan June 20, 2011 19:00

Quote:

makeAxialMesh.C: In function ‘void changeCoordinates(Foam::polyMesh&, Foam::plane, 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"

mechy June 21, 2011 05:06

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

jordi.muela August 31, 2011 03:15

Quote:

Originally Posted by l_r_mcglashan (Post 312802)
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.

l_r_mcglashan August 31, 2011 05:05

What are you trying to do? Did this work in previous versions? Can you post your mesh up here?

gschaider August 31, 2011 07:06

Quote:

Originally Posted by jordi.muela (Post 322352)
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

jordi.muela September 9, 2011 07:53

2 Attachment(s)
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.

gschaider September 12, 2011 05:50

Quote:

Originally Posted by jordi.muela (Post 323527)
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

Pallav September 19, 2011 23:14

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.

jordi.muela September 20, 2011 03:54

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.

gschaider September 20, 2011 05:01

Quote:

Originally Posted by Pallav (Post 324780)
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

Pallav September 20, 2011 21:07

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 (Post 324794)
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.

gschaider September 21, 2011 05:33

Quote:

Originally Posted by Pallav (Post 324957)
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

Pallav September 21, 2011 18:40

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


All times are GMT -4. The time now is 03:57.