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/)
-   -   [Other] Meshing an ellipse (https://www.cfd-online.com/Forums/openfoam-meshing/129171-meshing-ellipse.html)

Sujatha January 30, 2014 03:53

Meshing an ellipse
 
Hi all,
I wanted to create an elliptical geometry in interFoam. An ellipse of 43mm major axis and 12.2mm semi minor axis. What I am trying is actually 1/4 of a circle cut along a plane parallel to the diameter, like an ellipse and not a quarter circle.
I am working with 'blockmesh' and tried to use 'arc' edge but was in vain probably as it is meant for circular arcs. The 'spline' edge also didn't worked as it gave lines and not curves between that points. The 'simpleSpline' edge failed with errors.
Can any one please help me with some idea to mesh the ellipse.
Any hint will be a privilege and is greatly appreciated.

Thanks in advance
regards
Sujatha

startingWithCFD January 30, 2014 05:34

"spline" works great for me.
Are you sure you have used the right coordinates for the internal points?
Would you like to post your blockMeshDict?

Ruli January 30, 2014 05:47

Dear Sujatha,
have you tried polyLine? It connects two vertices along a defined set of points with lines between these points.
You could generate these points with some other software with very close distance to each other.
As we are simulating discretized, I don`t think this little 'linearity' does matter.

Quote:

Originally Posted by Sujatha (Post 472491)
The 'simpleSpline' edge failed with errors.

How do the erros look like?

Best regards
Julian

mturcios777 January 30, 2014 17:03

You could make a circular geometry using arc, then use transformPoints to make it into an ellipse.

Sujatha January 30, 2014 23:48

Sir startingWithCFD, sir Ruli, sir mturcios777, Thanks a million for your responses.
[ "spline" works great for me.
Are you sure you have used the right coordinates for the internal points?
Would you like to post your blockMeshDict?]


I got straight lines with 'spline' but I wanted curves, that is what I meant. My blockmeshdict is as below,
[/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices
(
(0 0 0)
(124.79 0 0)
(168.21 0 0)
(293 0 0)
(293 200 0)
(168.21 200 0)
(124.79 200 0)
(0 200 0)
(0 0 1)
(124.79 0 1)
(168.21 0 1)
(293 0 1)
(293 200 1)
(168.21 200 1)
(124.79 200 1)
(0 200 1)

);

blocks
(
hex (0 1 6 7 8 9 14 15) (20 20 1) simpleGrading (5 1 5)
hex (1 2 5 6 9 10 13 14) (10 20 1) simpleGrading (5 1 5)
hex (2 3 4 5 10 11 12 13) (20 20 1) simpleGrading (5 1 5)
);

edges
(
spline 1 2
(
(125.74 4.8344 0)
(129.1966 9.7233 0)
(146.5 12.2 0)
(154.4897 13.123 0)
(163.8034 9.7233 0)
(167.2698 4.8344 0)
)

spline 9 10
(
(125.74 4.8344 1)
(129.1966 9.7233 1)
(146.5 12.2 1)
(154.4897 13.123 1)
(163.8034 9.7233 1)
(167.2698 4.8344 1)
)
);

patches
(
);

mergePatchPairs
(
);

// ************************************************** *********************** //],

Sir Ruli, my error while using 'simpleSpline' is as below
[--> FOAM FATAL ERROR:
Unknown curvedEdge type simpleSpline

Valid curvedEdge types are

4
(
arc
line
polyLine
spline
)


From function curvedEdge::New(const pointField&, Istream&)
in file curvedEdges/curvedEdge.C at line 96.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Foam::curvedEdge::New(Foam::Field<Foam::Vector<dou ble> > const&, Foam::Istream&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libblockMesh.so"
#3 Foam::blockMesh::createTopology(Foam::IOdictionary const&, Foam::word const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libblockMesh.so"
#4 Foam::blockMesh::blockMesh(Foam::IOdictionary const&, Foam::word const&) in "/opt/openfoam220/platforms/linuxGccDPOpt/lib/libblockMesh.so"
#5
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/blockMesh"
#6 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#7
in "/opt/openfoam220/platforms/linuxGccDPOpt/bin/blockMesh"
Aborted (core dumped)
]

Sujatha January 30, 2014 23:52

Sir Ruli,
Can you kindly specify some software that will help make points in the curve.

Sir mturcios777,
Sir kindly explain about the 'transformPoints' some time at your convenience.

Thank you all again,
Regards
Sujatha

startingWithCFD January 31, 2014 03:36

2 Attachment(s)
You have too few points in the x-direction in that block.
Please see the attached images, the modified done with 40 points instead of 10.
The mesh does not look really good, you might want to reconsider your blocks.

Ruli January 31, 2014 04:45

Dear Sujatha,

Quote:

Originally Posted by Sujatha (Post 472692)
Sir Ruli,
Can you kindly specify some software that will help make points in the curve.

If you know the functions of your ellipse curves you could use Excel or Matlab or Scilab for calculation of discrete points.

As startingWithCFD has pointed out, mesh refinement is critical to get a nice 'round' mesh. Keep in mind, the connections between the points in OF are always linear, as we are generating plane surfaces.

Best regards

Sujatha January 31, 2014 05:54

Thank you sir startingWithCFD and Sir Ruli.
So I will improve the refinement and will try by increasing the defined points in the edges.

Sir, I am a beginner so may I put one more question, I get some skewness errors when ever I try to increase the no of cells. Are there some ways to prevent that??
Regards
sujatha

mturcios777 January 31, 2014 13:34

Tranform points allows you to perform operations such as scaling, rotation and translation of mesh points. For example, if you have meshed a circle that is in the x-y plane with unit radius and wish to generage an ellipse with semimajor axes a, b (in the x, y directions respectively), then you could use the following command:

Code:

transformPoints -scale (a b 1)
Run the command with the help option for more information. Note that because you are scaling your original circular mesh will need to be denser in the the regions you are expanding and sparser in regions you are compressing

Sujatha January 31, 2014 19:58

Thank you sir, mturcios777.


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