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/)
-   -   TimeVaryingMappedFixedValue best practice to extract subset points and fields (https://www.cfd-online.com/Forums/openfoam-solving/58276-timevaryingmappedfixedvalue-best-practice-extract-subset-points-fields.html)

podallaire November 27, 2008 00:48

Hi, I've been trying to fin
 
Hi,

I've been trying to find the best way of extracting the points of a patch and the different fields (U, p, ...) related to those points from a time directory in order to use the data for a timeVaryingMappedFixedValue patch. Using this as a first pass, I want to apply a fluctuations and create multiple time directories.

However, I'm not sure that using faceSet, cellSet and subsetMesh is the best way to go. The extracted subsetMesh gives me the list of point which I need for timeVaryingMappedFixedValue but the field files are not clean in a sense that all original patches are kept.

Any idea on how to generate this first set of data from patch in order to use it as a first pass for a timeVaryingMappedFixedValue patch ?

Best regards,

PO

bephi February 14, 2011 10:56

Hello,
has anyone found out, how it is possible to achieve the points-file and the extracted U value in the time-directories to set up a timeVaryingMappedFixedValues case?

A first simulation is done and I have different U values at different times for the whole geometry. How can I extract them in a format for timeVaryingMappedFixedValue like in the pitzDailyExpInlet-tutorial?

With regards!
Philipp

markusrehm August 17, 2011 10:07

Hello,

use the sample utility. In the sampleDict choose under surfaces "constantPlane".
Now use "surfaceFormat foamFile" and paste the output in the appropriate files. Pay attention to use faceCentres instead of points for the coordinates.

Markus

Dan Pearce July 31, 2013 05:21

1 Attachment(s)
I also seemed to struggle with this and after some head scratching came up with the sampleDict file that outputs the points, faces and facecentres for a selected patch. In this example, the selected patch is called "InletFace". I then ran the sample utility and copied the points file into the /boundaryData/InletFace folder and it seemed to work straight away.

Z.Q. Niu May 21, 2014 05:20

Dear Dan,
I has also gotten into this trouble! I has download your attached files, I also copy the data into <bundaryData/inlet>,but when I run the case,the error occurs:
Expected a '(' while reading VectorSpace<Form, Cmpt, nCmpt>, found on line 17 the label 10000

file: /home/zq/桌面/timeVaryingMpped2/constant/boundaryData/inlet/0/U at line 17.

From function Istream::readBegin(const char*)
in file db/IOstreams/IOstreams/Istream.C at line 94.
Is there some changes to the origin files generated by sample Utility?

Best Regards!
Z.Q. Niu

Dan Pearce May 21, 2014 08:16

Hi Z.Q,
It has been a while since I looked at this but I don't think I had to do much to the points file, I just pasted in the standard openfoam header. What you are seeing however seems to be an error related to your U file at time zero rather than the points file itself. It would be helpful if you can let us know what version of OF you are using and post your 0/U file (or part of it if it's very large). I used a matlab script to read in experimental data and convert it to the correct time steps and write all the necessary U files and directories.

Dan

Z.Q. Niu May 21, 2014 10:25

Dear Dan,
Thank your quick reply very much! I has solved my problem, it is becasue I didn't add openfoam header as followed:
/*--------------------------------*- 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 vectorAverageField;
object values;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Average
(0 0 0)
I added open foam header manually, I'm using OF 2.2.0, my U profile in /boundaryData/inlet is sampled from previous model, and there are too much time step which need to be sampled, would you mind share your matlab script with me? I am a newer to Linux, and I am trying to use script to achieve above works quickly!

Best regard!
Z.Q. Niu


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