CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   SampleDict Pressure Plot across a wing chord (https://www.cfd-online.com/Forums/openfoam-solving/115087-sampledict-pressure-plot-across-wing-chord.html)

70m1 March 23, 2013 10:45

SampleDict Pressure Plot across a wing chord
 
2 Attachment(s)
Hi all,

I would like to make a pressure plot on the surface of my wing geometry along the centre chord with gnuplot.

Unfortunately I require a bit of hand holding...

I intend to do this using the SampleDict file. The geometry is .stl data that was used to create the mesh with snappyHexMesh and so is in the triSurface folder.

To potentially complicate matters the centre chord is along z=0.05 instead of z=0. However this is still the middle of the boundary (See attached image)

Below is what I have attempted so far... I think it is probably a pretty poor attempt.




/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

setFormat gnuplot;

surfaceFormat raw;

formatOptions
{
ensight
{
format ascii;
}
}

interpolationScheme cell;

fields
(
p
);

sets
(
TopOfAerofoil
{
type face; //not sure on this
axis xyz; // not sure on this

start (0.0001 0.0001 0.05001); //how do i find this accurately? Also should it be slightly offset from the surface?
end (0.1001 0.1001 0.05001);
nPoints 50;
}

BottomOfAerofoil
{
type face;
axis xyz;

start (0.1001 0.1001 0.05001);
end (0.1001 0.1001 0.05001);
nPoints 50;
}
);

surfaces
(
triSurfaceSampling
{
// Sampling on triSurface
type sampledTriSurfaceMesh;
surface PointyTip.stl;
source boundaryFaces; // not sure on this
interpolate true; //not sure on this
}
);


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



Thanks!

doubtsincfd March 23, 2013 20:35

Quote:

I would like to make a pressure plot on the surface of my wing geometry along the centre chord with gnuplot
Are you trying to plot pressure along a line lying on the airfoil?

Quote:

TopOfAerofoil
{
type face; //not sure on this
axis xyz; // not sure on this

start (0.0001 0.0001 0.05001); //how do i find this accurately? Also should it be slightly offset from the surface?
end (0.1001 0.1001 0.05001);
nPoints 50;
}
This will give you values along line joining the two points
xyz refers it will print in three columns

read applications/utilities/postProcessing/sampling/sample/sampleDict file.
It has detailed explanation of all the options that can be used

If the point are along a curved line, I suggest you use patchCloud. You will have to manually enter the coordinates of the points though. Plus you can give some tolerance to the points. OF will search points ON THE PATCH and print the values

fumiya March 23, 2013 20:36

I don't know the way to do what you want with the sample utility
but alternatively you could use "Plot On Intersection Curves" filter
in ParaView.

According to the following procedure, you can get the csv file of the
data sampled on the patch:
1) Select the patch you want to sample(e.g., wing)
2) Select Filters -> Data Analysis -> Plot On Intersection Curves
(Slice Type: Plane, z=0.05)
3) File -> Save Data (Files of type: csv)

Hope this helps,
Fumiya

70m1 March 24, 2013 15:24

much easier way of doing it, thanks Fumiya

@doubtsincfd I will have to have a longer look at this to understand it in depth, but thank you for your help.

stephie August 3, 2015 08:32

Hello everyone,

I know the last post is two years ago, but I hope someone might help me...
I am working with foam ext. 3.1 and my task is to produce the pressure distribution around an airfoil. My airfoil is defined as a wall, which leads to me to the following problem:

--> unknown sample typ

I created the mesh with Salome and defined just the inlet and the outlet as patch, top/bottom/airfoil as walls and front/back as empty. So I can't use patch or one of the other sample typs.

This is the content of my sampleDict:

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.2.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object sampleDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

setFormat gnuplot;

surfaceFormat vtk;

interpolationScheme cellPoint;

fields
(
p
);

sets
(
TopOfAerofoil
{
type face;
axis xyz;

start (-0.025 0.0875 0); //how do i find this accurately? Also should it be slightly offset from the surface?
end (0.075 0.0875 0);
nPoints 250;
}

BottomOfAerofoil
{
type face;
axis xyz;

start (-0.0249658 0.0873361 0);
end (0.0749617 0.0874998 0);
nPoints 50;
}
);

surfaces
(

//Extracting a patch
walls_constant
{
type wall;
patches ( airfoil );
}
);

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

Also tried the way with paraview, but for me it didn't work..maybe I did something wrong.

If anyone has an ida to solve this problem or to produce a pressure distribution, I would be very gratefule!

Best regards,
Stephie

Miguel.Mendez July 5, 2021 18:33

Plot on intersection curves with sample
 
Quote:

Originally Posted by fumiya (Post 415931)
I don't know the way to do what you want with the sample utility
but alternatively you could use "Plot On Intersection Curves" filter
in ParaView.

According to the following procedure, you can get the csv file of the
data sampled on the patch:
1) Select the patch you want to sample(e.g., wing)
2) Select Filters -> Data Analysis -> Plot On Intersection Curves
(Slice Type: Plane, z=0.05)
3) File -> Save Data (Files of type: csv)

Hope this helps,
Fumiya

Hi, This is very usefull. I would like to replicate the same with the post processing functions of OpenFoam (sample functions). Does anyone knows if it is possible? I use OpenFoam 6.0.

Thanks in advance to the ones who can help me!

Greetings.


All times are GMT -4. The time now is 02:56.