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

sampleDict for streamFunction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2014, 20:58
Default sampleDict for streamFunction
  #1
New Member
 
Sri
Join Date: Nov 2012
Posts: 10
Rep Power: 13
srivatta is on a distinguished road
Hello,
I am trying to write out stream function values on a 2-d surface. Once the case is done running, I invoke the streamFunction utility. I make sure that the streamFunction file exists in each time directory.
Then I invoke the sample utility. The sampleDict is given here. (I got rid of the headers here)

surfaceFormat vtk;
interpolationScheme cellPoint;
surfaces
(
testplane
{
type plane;
basePoint (0 0 0.001);
normalVector (0 0 1);
}
);
fields (

streamFunction

);

After the sample utility is run, the post-processing/surface/time folders show up, but there are no files inside the time directories. Is the "streamFunction" field recognized by the sample utility? If I replace streamFunction with U, p etc, they work.

Thanks,
Srivathsan
srivatta is offline   Reply With Quote

Old   November 28, 2014, 02:44
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

streamFunction utility creates pointScalarField (while p is volScalarField). While sample utility can't sample these kind of fields

Once I've made streamFunctionV (https://bitbucket.org/mrklein/streamfunctionv) which first creates pointScalarField and then interpolates point values into cell values. Basically it's streamFunction with the following addition:

Code:
            streamFunctionV = dimensionedScalar("zero", phi.dimensions(), 0.0);
            weight = 0.0;
            const labelListList& cellPoints = streamFunctionV.mesh().cellPoints();
            forAll(streamFunctionV, cellI)
            {
                const labelList& curCellPoints = cellPoints[cellI];
                forAll(curCellPoints, cellPointI)
                {
                    streamFunctionV[cellI] += 
                        streamFunction[curCellPoints[cellPointI]];
                    weight[cellI] += 1.0;
                }
            }

            streamFunctionV /= (weight + 1.0);
            streamFunctionV.boundaryField() = 0.0;
            streamFunctionV.write();

Last edited by alexeym; November 28, 2014 at 02:45. Reason: typo
alexeym is offline   Reply With Quote

Old   November 28, 2014, 08:54
Default
  #3
New Member
 
Sri
Join Date: Nov 2012
Posts: 10
Rep Power: 13
srivatta is on a distinguished road
Thank you for your quick reply. I will try this and let you know.
Sri
srivatta is offline   Reply With Quote

Old   November 30, 2014, 10:53
Default
  #4
New Member
 
Sri
Join Date: Nov 2012
Posts: 10
Rep Power: 13
srivatta is on a distinguished road
This idea works the way I want it to.
Thank you very much.
srivatta is offline   Reply With Quote

Reply

Tags
sample postprocessing


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sampleDict and controlDict musahossein OpenFOAM Post-Processing 39 July 17, 2016 11:00
controlDict and sampleDict giving different results Shenan OpenFOAM Post-Processing 2 November 15, 2014 11:15
Question on sampleDict musahossein OpenFOAM Running, Solving & CFD 8 May 8, 2013 18:48
sampleDict keyword patchName not accepted musahossein OpenFOAM Bugs 6 January 28, 2013 01:48
sampleDict Bug musahossein OpenFOAM Bugs 7 December 12, 2011 13:45


All times are GMT -4. The time now is 15:59.