CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Produce a cut plane through axisymmetric domain in OF-2.1.x from sampleDict (https://www.cfd-online.com/Forums/openfoam/107688-produce-cut-plane-through-axisymmetric-domain-2-1-x-sampledict.html)

aerospain October 4, 2012 04:21

Produce a cut plane through axisymmetric domain in OF-2.1.x from sampleDict
 
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 October 4, 2012 04:34

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!

wyldckat October 5, 2012 07:38

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 :rolleyes:


Best regards,
Bruno

aerospain October 8, 2012 06:59

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!

mcarpe October 8, 2012 09:30

Hi Aerospain,

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

See here: http://www.cfd-online.com/Forums/ope...-sampling.html

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.

aerospain October 8, 2012 10:56

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 October 9, 2012 07:16

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

mcarpe October 9, 2012 11:19

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

aerospain October 9, 2012 11:27

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 October 10, 2012 06:05

1 Attachment(s)
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!

mcarpe October 11, 2012 05:06

Quote:

Originally Posted by aerospain (Post 385913)
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...


All times are GMT -4. The time now is 00:29.