CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] Converting a 2Dmesh to axisymmetric (https://www.cfd-online.com/Forums/openfoam-meshing/61473-converting-2dmesh-axisymmetric.html)

gschaider April 20, 2005 15:57

Converting a 2Dmesh to axisymmetric
 
I just wrote a utility that takes a regular 2D-mesh (a mesh that is one cell thick) and converts it into a axi-symmetric mesh (as described in the UserGuide 6.2.2) by collapsing one (user-specified) boundary patch and adjusting the cordinates of the vertices.

If it is of general interest, I'd be happy to share it.

hsieh April 20, 2005 20:15

Hi, Bernhard, I am interest
 
Hi, Bernhard,

I am interested in this utility. Could you please email to me? Is the input using true 2D mesh (like shell element) or it takes a 3D mesh but, with only one cell thick in the Z direction? Thanks!

Pei
Peiying2003@yahoo.com

nils April 21, 2005 03:05

Hi, I am also interested! C
 
Hi,

I am also interested! Could you please also email it to me? Thanks a lot!


Nils :-)

gschaider April 21, 2005 03:51

Yes, the utilities uses a Open
 
Yes, the utilities uses a OpenFOAM-2D-mesh: a 3D-mesh that is one cell thick. Don't know if OF can handle true 2D-grids (I don't think so)

groens January 17, 2006 08:26

Hello Bernhard, I am starting
 
Hello Bernhard,
I am starting to do some work with FOAM.
I would be interested in your tool, too.

Thanks in Advance.
Thomas

gschaider January 17, 2006 10:01

Hello Thomas! The utility c
 
Hello Thomas!

The utility can be found at:

http://openfoamwiki.net/index.php/Contrib_MakeAxi alMesh

Let me know if it works for you (Judging from the date it was developed on 1.1, maybe something has to be changed in Make/options to get it to compile on 1.2)

engrstudentgmailcom February 1, 2008 11:08

Hey All, Im a mac user, for
 
Hey All,

Im a mac user, formerly a windows user, and I am not a linux programmer.

Im trying to work through a basic cfd tutorial for fluent, except in OpenFOAM.
http://courses.cit.cornell.edu/fluent/pipe1/index.htm

I made the mesh in gambit, and exported to fluent.
I found the utility to import the fluent mesh into OpenFOAM. Now I discover that one problem is that the new mesh isn't axisymmetric. I need to find a way to do that. (Im using CAELinux with its installation of OpenFOAM.)

I dont know how to compile with makefiles. A majority of my programming experience is MatLab.

How do i make the makeAxialMesh go from a .tgz to a working program in CAE Linux - Foam?

Thanks,
Mike Munroe

gschaider February 4, 2008 08:36

Hi Michael! Just untar the
 
Hi Michael!

Just untar the sources (the tgz is nothing but a zip-file for men). Propable you can do that from the GUI of your Linux-distro. Then go to the resulting directory and do as described in section 3.2 of the OF-Userguide (Compilation of applications). No programming should be required.

Bernhard

bonzodeb April 19, 2008 19:08

Hi all, I have a problem whe
 
Hi all,
I have a problem when I try to compile MakeAxialMesh .
I have:
1) In $HOME untar the file MakeAxialMesh1.4.1.tgz
2) cd ./makeAxialMesh
3)wmake

This is the output

SOURCE=makeAxialMesh.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/dynamicMesh/lnInclude -I/home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/cfdTools/lnInclude -I/home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/meshTools/lnInclude -IlnInclude -I. -I/home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/makeAxialMesh.o
In file included from /home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/i686-pc-linux-gnu/bits/c++config.h:41,
from /home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/string:45,
from /home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/string.H:47,
from /home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/stringList.H:36,
from /home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/argList.H:36,
from makeAxialMesh.C:46:
/home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/i686-pc-linux-gnu/bits/os_defines.h:44:22: error: features.h: No such file or directory
In file included from /home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/bits/char_traits.h:45,
from /home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/string:47,
from /home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/string.H:47,
from /home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/stringList.H:36,
from /home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/argList.H:36,
from makeAxialMesh.C:46:
/home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/cstring:52:20: error: string.h: No such file or directory
In file included from
...
(very long list of similar error messages)
...

/home/openflu/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude/argList.H:36,
from makeAxialMesh.C:46:
/home/openflu/OpenFOAM/linux/gcc-4.2.1/bin/../lib/gcc/i686-pc-linux-gnu/4.2.1/.. /../../../include/c++/4.2.1/i686-pc-linux-gnu/bits/gthr.h:122: error: expected declaration before end of line
make: *** [Make/linuxGccDPOpt/makeAxialMesh.o] Error 1

I can't understand where I went wrong...
What's wrong??

Simone

bonzodeb April 21, 2008 06:27

I try also with the command s
 
I try also with the command
svn checkout https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/utilities/mesh/manipulation/MakeAxialMesh

but there is the same error.
It says "not such file or directory", but the file is there...


Solutions??

I try to write the file blockMeshDict by hand:
I want to simulate a pipe r=0.5 m
This is my blockMeshDict file:
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.4 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

FoamFile
{
version 2.0;
format ascii;

root "";
case "";
instance "";
local "";

class dictionary;
object blockMeshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


convertToMeters 1;

vertices
(
( 0 0 0 ) // vertex 0
( 0 0.5 0 ) // vertex 1
( 0.04358 0.4981 0 ) // vertex 2
( 0 0 100 ) // vertex 3
( 0 0.5 100 ) // vertex 4
( 0.04358 0.4981 100 ) // vertex 5
);

blocks
(
hex (0 2 1 0 3 5 4 3) (1 10 1) simpleGrading (1 1 1)
);

edges
(
);

patches
(
patch inlet
(
(0 1 2 0 )
)

patch outlet
(
(3 5 4 3 )
)

patch wall
(
(1 4 5 2 )
)

wedge a
(
(4 1 0 3)
)

wedge b
(
( 0 2 5 3 )
)

empty collapsed
(
( 0 0 3 3 )
)
);

mergePatchPairs
(
);


// ************************************************** ***********************

This is the error
Reading block mesh description dictionary

Creating block mesh

Creating blockCorners

Creating curved edges

Creating blocks

Creating patches

Creating block mesh topology

Default patch type set to empty
#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#1 Foam::sigFpe::sigFpeHandler(int) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#2 Uninterpreted: [0xb7f61420]
#3 Foam::wedgePolyPatch::initTransforms() in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#4 Foam::wedgePolyPatch::wedgePolyPatch(Foam::word const&, int, int, int, Foam::polyBoundaryMesh const&) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#5 Foam::polyPatch::addwordConstructorToTable<foam::w edgepolypatch>::New(Foam::word const&, int, int, int, Foam::polyBoundaryMesh const&) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#6 Foam::polyPatch::New(Foam::word const&, Foam::word const&, int, int, int, Foam::polyBoundaryMesh const&) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#7 Foam::polyMesh::polyMesh(Foam::IOobject const&, Foam::Field<foam::vector<double> > const&, Foam::List<foam::cellshape> const&, Foam::List<foam::list<foam::face> > const&, Foam::List<foam::word> const&, Foam::List<foam::word> const&, Foam::word const&, Foam::List<foam::word> const&, bool) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/lib/linuxGccDPOpt/libOpenFOAM.so"
#8 Foam::blockMesh::createTopology(Foam::IOdictionary &) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/blockMesh"
#9 Foam::blockMesh::blockMesh(Foam::IOdictionary&) in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/blockMesh"
#10 main in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/blockMesh"
#11 __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#12 Foam::regIOobject::readIfModified() in "/home/openflu/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linuxGccDPOpt/blockMesh"
Floating point exception


Can somebody help me??

Simone

gschaider April 21, 2008 06:56

Hi Simone! Concerning your
 
Hi Simone!

Concerning your compilation problem from the 19th. Seems like some system headers are missing. I assume that
a) you're using the gcc that comes with OpenFOAM (and there is no other gcc installed)
b) you never compiled any applications on your machine before (otherwise the error would have happened there too)
The easiers way to get the necessary headers is by installing the vendor-gcc, which will pull in all the necessary dependencies (glibc-headers etc) (OF will keep on using the OF-gcc, but at least the headers will be there)

Bernhard

bonzodeb April 21, 2008 10:22

You are right! I have been so
 
You are right!
I have been solved:

$ aptitude install build-essential gcc

Thanks Bernhard.

Simone

mahendra January 13, 2009 05:03

hi everyone, I am the getting
 
hi everyone,
I am the getting the following error ,plz help me solve the problem.

Exec : makeAxialMesh Shaft_wall frontAndBackPlanes
Date : Jan 13 2009
Time : 15:43:00
Host : linux
PID : 10815
Case : /home/ms.wankhede/OpenFOAM/ms.wankhede-1.5/mrj/channel
nProcs : 1

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

#0 Foam::error::printStack(Foam:http://www.cfd-online.com/OpenFOAM_D...part/proud.gifstream&) in "/home/ms.wankhede/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/lib OpenFOAM.so"
#1 Foam::sigSegv::sigSegvHandler(int) in "/home/ms.wankhede/OpenFOAM/OpenFOAM-1.5/lib/linux64GccDPOpt/libOpenF OAM.so"
#2 ?? in "/lib64/libc.so.6"
#3 std::basic_string<char,>, std::allocator<char> >::basic_string(std::string const&) in "/home/ms.wankhede/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux64/lib64/libstdc ++.so.6"
#4 main in "/home/ms.wankhede/OpenFOAM/ms.wankhede-1.5/applications/bin/linux64GccDPOpt/mak eAxialMesh"
#5 __libc_start_main in "/lib64/libc.so.6"
#6 __gxx_personality_v0 in "/home/ms.wankhede/OpenFOAM/ms.wankhede-1.5/applications/bin/linux64GccDPOpt/mak eAx ialMesh"
Segmentation fault

gschaider January 13, 2009 06:57

Hi Mahend! Can't tell much
 
Hi Mahend!

Can't tell much from that error message. The strange thing is that it seems to happen during some string-handling operation. Have you got a Debug-enabled OF-version (see http://openfoamwiki.net/index.php/Main_FAQ#An_application_ends_with_a_segmentati on_fault._What_is_wrong.3F and the links going from it)? Could you provide us with a stack-trace from that one? Or the case?

Bernhard

PS: other question: do other applications that YOU compiled work? Have you recently updated your OF-installation?

mahendra January 13, 2009 07:57

Hello Bernhard... Yes I hav
 
Hello Bernhard...

Yes I have compiled the "ComputeTorque", "calcMassFlow" utilities and they work fine. Even the "makeAxialMesh" utility was compiled without any errors.

And I have not updated the OpenFOAM-1.5 to higher version, I am still using OpenFOAM-1.5.

Regards,
Mahendra

gschaider January 13, 2009 17:36

Hi Mahendra! makeAxialMesh
 
Hi Mahendra!

makeAxialMesh never touches the pressure-field (I hope). I'd need the mesh. At least the boundary file

On a second thought: the call you posted looks a bit strange to me (maybe the docu on the Wiki is a bit out of date): try
makeAxialMesh -axis Bottom_wall -wedge frontAndBackPlanes

Bernhard

mahendra January 13, 2009 23:51

Dear Bernhard hello, This i
 
Dear Bernhard hello,

This is what I am getting after using makeAxialMesh -axis Bottom_wall -wedge frontAndBackPlanes

lcfd@clust5:~/OpenFOAM/lcfd-1.5/Mahendra/Pipe> makeAxialMesh -axis Bottom_wall -wedge frontAndBackPlanes
/*---------------------------------------------------------------------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.5 |
| \ / A nd | Web: http://www.OpenFOAM.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Usage: makeAxialMesh <axis> <wedge> [-case dir] [-parallel] [-help] [-doc] [-srcDoc]


Invalid option: -axis
Invalid option: -wedge


FOAM exiting


I think the makeAxialMesh i have downloaded is for OpenFOAM-1.4.1 and I am using OpenFOAM-1.5. Is here the catch??

Regards,
Mahendra.

mahendra January 14, 2009 01:37

Dear Bernhard Hello ! I jus
 
Dear Bernhard Hello !

I just went through the User Guide of OpenFOAM-1.5 and found the thing regarding importing a 2D fluent Mesh to OpenFOAM-1.5 and converting it into axi-symmetric mesh. It says that "Creation of axi-symmetric mesh is currently not supported"

I just wanted to know is really the conversion not available in OpenFOAM-1.5?

Regards,
Mahendra

gschaider January 14, 2009 05:18

Hi Mahendra! @1.5: Definitl
 
Hi Mahendra!

@1.5: Definitly. Get the newest version (as described on the Wiki-page) before trying anything else. That one has the new Syntax.
@fluentMeshToFoam: That was never supported (meshes that were defined in Fluent as axisymetric). That is why makeAxialMesh got written in the first place

Bernhard

mahendra January 14, 2009 05:36

Dear Bernhard... I am unabl
 
Dear Bernhard...

I am unable to download the makeAxialMesh utility for OpenFOAM-1.5 from svn, Can you please help me how to download the utility?

Regards,
Mahendra


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