CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   How are vector list ordered in OpenFOAM (http://www.cfd-online.com/Forums/openfoam/106566-how-vector-list-ordered-openfoam.html)

TianC September 1, 2012 10:51

How are vector list ordered in OpenFOAM
 
Hi everyone,

A swift reply would be greatly appreciated :) since my deadline is on Wednesday!

The main reason why the issue exists is because I am using ParaView on remote ssh connection. Because of this I can not do any kind of 1D plot (i.e. velocity vs. time). I am told by the computer administrator that he is sorting it but I am sure it will not be done in time. Therefore I am taking a different approach to do this.

I need to output the value of pressure at the middle of my downstream edge for a 3D cavity flow to plot against time.

I have written the following shell script to extract values from the p files within the saved timesteps:

for f in */p
do
cat $f | awk 'NR==21 {print}' >> p

echo "Processing $f file..."
done

This looks in all the folders within my case directory and searches for the p file; if it finds it, it will write line number 21 to a file called p in my case directory. This works perfectly for what I want to do.

The only problem is I don't know how the list of vectors are ordered in the U, p, k, nuSgs, etc... files.

Does anyone know how the vectors are organised??

Cheers,

Tian

ngj September 1, 2012 12:02

Hi Tian,

It is actually quite simple. The ordering of all the fields are related to the mesh. This means that the first cell (index 0) is linked to the first field in p, U, k, etc. You can make the same argument for the cell with index N.

Maybe you should look into the sampling utility and see if it could fit your needs.

Kind regards,

Niels

TianC September 1, 2012 12:19

Hi Niels,

Ah... I think it is the sample utility I could use for this. Thank you.

Kind regards,

Tian

TianC September 1, 2012 12:59

Hi again Niels,

I am trying to use the sample utility, this is how my sampleDict reads:

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

setFormat raw;

interpolationScheme cellPointFace;

fields
(
p
);



sets
(
bottomSurfaces
{
type cloud;
points (2 1 0.5);
axis y;
}
);

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

I get the following error message:


--> FOAM FATAL IO ERROR:
Expected a '(' while reading VectorSpace<Form, Cmpt, nCmpt>, found on line 36 the label 2

file: /gpfs/home/eng/mauiie/OpenFOAM/mauiie-2.1.0/run/project/cavity3D/cavity3Db/system/sampleDict::sets::points at line 36.

From function Istream::readBegin(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 94.

FOAM exiting

I can't work out what I've done wrong. Please let me know the error of my ways!

Kind regards,

Tian


All times are GMT -4. The time now is 18:39.