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

Produce a cut plane through axisymmetric domain in OF-2.1.x from sampleDict

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 4, 2012, 04:21
Default Produce a cut plane through axisymmetric domain in OF-2.1.x from sampleDict
  #1
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hi everyone!

I have been trying to get a slice through an OF-2.1.x axisymmetric region in order to be used as base to post-process streamlines afterwards with another software.

I've spent two days trying to understand why the following lines were giving me an EOF error message:

surfaces
(
constantPlane
{
type plane;
basePoint (0 0 0.005);
normalVector (0 1 0);
}
);

Now, I don't get that error message by using:
surfaces
(
triangleCut
{
// Cutingplane using iso surface
type cuttingPlane;
planeType pointAndNormal;
pointAndNormalDict
{
basePoint (0 0 0.005);
normalVector (0 1 0);
}
interpolate true;
}
);

But, I don't get any field data on that plane!!! :-( I get results for several line sets I have also defined in sampleDict, but nothing for that plane. I know I can go into paraView, but I'm trying to reduce the number of steps in my post-processing.

Could anyone bring some light on this doubt I now have, please?

Thanks!
aerospain is offline   Reply With Quote

Old   October 4, 2012, 04:34
Default
  #2
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Please, forget about me saying I wasn't getting any results. I was looking inside the sub-directory 'sets'. Without realizing there was another one, called 'surfaces', next to it.

Embarrassing!!! :-(

Still, why was I getting the EOF error message? mmmm ...

thanks!
aerospain is offline   Reply With Quote

Old   October 5, 2012, 07:38
Default
  #3
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,258
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi aerospain,

If I remember correctly, EOF can happen due to at least two situations:
  • Missing semi-colon ";" or parenthesis/brackets ")" "}".
  • Missing keywords or attributes.
In other words, the dictionary reader keeps parsing characters until it finds what's it's looking for... or until it reaches the End-Of-File


Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   October 8, 2012, 06:59
Default
  #4
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks wyldckat,

It must be a missing keyword/attribute. I used the original example file that comes with the OF installation, so there must be something I'm missing.

regards!
aerospain is offline   Reply With Quote

Old   October 8, 2012, 09:30
Default
  #5
New Member
 
Matteo Carpentieri
Join Date: Mar 2009
Posts: 28
Rep Power: 8
mcarpe is on a distinguished road
Hi Aerospain,

I don't know if it's related to your problem, but I too had issues with surface sampling.

See here: Problems with surface sampling

I wasn't obtaining any output files. I wasn't able to figure out what's wrong, but using object functions during the simulation instead of sample (post-processing) works OK.

It might be a bug, but I'm not sure. I couldn't even make the tutorials work, so it's either my OpenFOAM installation or a bug.
mcarpe is offline   Reply With Quote

Old   October 8, 2012, 10:56
Default
  #6
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks Matteo!

I will look into it. I must find some more description about it my run-time sampling plane/surface should be a cut xz-plane through y=0.

cheers!
aerospain is offline   Reply With Quote

Old   October 9, 2012, 07:16
Default
  #7
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hi Matteo,

I've been reading about the 'sampledPatch' you mention in the thread you mentioned yesterday, but I cannot understand how to use it. I've been looking in the OF installation directory in my computer with no luck. And, forums are not being quite informative.

Would you be kind enough to share some notes/thoughts with me?

BTW, my interest is in generating a vertical cut plane.

Regards
aerospain is offline   Reply With Quote

Old   October 9, 2012, 11:19
Default
  #8
New Member
 
Matteo Carpentieri
Join Date: Mar 2009
Posts: 28
Rep Power: 8
mcarpe is on a distinguished road
Hi aerospain,

function objects can be executed during the simulations by putting the relevant code in the controlDict file.

In your case I believe the correct one to use would be cuttingPlane. Your sampleDict entry can be translated as a run-time function object in controlDict as:

Code:
cuttingPlane
{
    type            surfaces;
    functionObjectLibs ("libsampling.so");
    outputControl   outputTime;

    surfaceFormat   raw; // you can change this to "vtk"
    fields          ( p U ); // chose the fields you need

    interpolationScheme cellPoint;

    surfaces
    (
        constantPlane
        {
            type            cuttingPlane;
            planeType       pointAndNormal;
            pointAndNormalDict
            {
                basePoint       (0 0 0.005);
                normalVector    (0 1 0);
            }
            interpolate     true;
        }
    );
}
In theory this should give you the same results as sampling in post-processing. In practice, at least for me, surface sampling does not work, while this does.

For further info on function objects have a look here: http://www.openfoam.com/features/run...processing.php

and also the motorBike tutorial in incompressible/simpleFoam.

Cheers
Matteo
mcarpe is offline   Reply With Quote

Old   October 9, 2012, 11:27
Default
  #9
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Thanks Matteo,

I'll try it right away!

About the link you've given me. It takes me to a page, where I've been several times, where I can see a list of "available functionality" but without examples or further links :-/ sometimes, OF guidelines drive me crazy ;-(

cheers!
aerospain is offline   Reply With Quote

Old   October 10, 2012, 06:05
Default
  #10
Member
 
aerospain
Join Date: Sep 2009
Location: Madrid, Spain
Posts: 84
Rep Power: 7
aerospain is on a distinguished road
Send a message via Skype™ to aerospain
Hello Matteo,

I've tried your suggestion and got cut planes at each 'writeout' instance during the simulation, this will be quite useful when I start investigating unsteady phenomena in my research.

Just one comment/question, I don't get a 'clean cut' meaning that for each x-coordinate (this is a structured mesh) I don't get the same number of z-points and their values get a bit noisy in some parts of the mesh. I'm attaching a scatter plot from matlab where you can observe what I'm trying to explain.

cheers!
Attached Images
File Type: jpg Screenshot from 2012-10-10 12:03:58.jpg (88.7 KB, 33 views)
aerospain is offline   Reply With Quote

Old   October 11, 2012, 05:06
Default
  #11
New Member
 
Matteo Carpentieri
Join Date: Mar 2009
Posts: 28
Rep Power: 8
mcarpe is on a distinguished road
Quote:
Originally Posted by aerospain View Post
Hello Matteo,

I've tried your suggestion and got cut planes at each 'writeout' instance during the simulation, this will be quite useful when I start investigating unsteady phenomena in my research.

Just one comment/question, I don't get a 'clean cut' meaning that for each x-coordinate (this is a structured mesh) I don't get the same number of z-points and their values get a bit noisy in some parts of the mesh. I'm attaching a scatter plot from matlab where you can observe what I'm trying to explain.

cheers!
mmmm.... sorry, I don't know. I've only used this with sampledPatch and I haven't got any problem with it. I hope someone with more experience gets notice of this thread...
mcarpe 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
How to use values of a plane cutting the domain for inlet conditions? StefanG CFX 9 July 3, 2012 08:05
[ICEM] cut plane visualization Will Anderson ANSYS Meshing & Geometry 11 January 10, 2011 12:52
View with cut plane Mudblood FLUENT 3 May 27, 2010 01:24
View the pressure drop contour in a cut plane 2D in a right position zhoubinwx OpenFOAM Paraview & paraFoam 3 February 13, 2008 05:46
cut plane? qiaomu FLUENT 1 May 12, 2003 17:24


All times are GMT -4. The time now is 13:27.