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

How to input surface value using sample

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By nygbook

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 20, 2012, 09:03
Default How to input surface value using sample
  #1
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Hello foamers
I use sample to write a surface value that grid is 80*80. So the number of surface value is 6400. However, I discovery the number of surface value is 12800. The sampleDict is below
Code:
surfaceFormat     raw;
interpolationScheme cell;

surfaces
(
    constantPlane
    {
        type            plane;    // always triangulated
        basePoint       (0 0 0);
        normalVector    (0 0 1);

        //- Optional: restrict to a particular zone
        // zone        zone1;
        interpolate     false;
    }
    
);
Anybody can give me some suggestion?
nygbook is offline   Reply With Quote

Old   February 27, 2012, 01:22
Default
  #2
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Done, I have write a small program to resolve the problem. of's iostream is very well
nygbook is offline   Reply With Quote

Old   May 26, 2012, 09:11
Default
  #3
Member
 
Amin Shariat KHah
Join Date: Apr 2011
Location: Shiraz
Posts: 86
Rep Power: 15
amin144 is on a distinguished road
Quote:
Originally Posted by nygbook View Post
Done, I have write a small program to resolve the problem. of's iostream is very well
Hi dear Nie
What's the story? what should I do to have same number of points as my grid points?
amin144 is offline   Reply With Quote

Old   June 9, 2012, 22:45
Default
  #4
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 15
nygbook is on a distinguished road
Dear amin144, I'm sorry to reply you thread late! The code is show as below
Quote:
#include "fvCFD.H"
#include "OFstream.H"

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

int main(int argc, char *argv[])
{


# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"



IOdictionary transportProperties
(
IOobject
(
"transportProperties",
runTime.constant(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);

word surfaceScalar_(transportProperties.lookup("surface Scalar"));

volScalarField alpha1
(
IOobject
(
surfaceScalar_,
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
),
mesh
);

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//----------
OFstream os(runTime.timeName() + ".dat");
Info << "Open the file" << nl;
scalar maxX = 0.0;

forAll(mesh.C(), celli)
{
vector c = mesh.C()[celli];
if(c.x() >= maxX)
maxX = c.x();
}


forAll(mesh.C(), celli)
{

vector c = mesh.C()[celli];
os << c.x() << ' ' << c.y() << ' ' << c.z() << ' ' << alpha1[celli] << nl;
if(c.x() >= (maxX - 0.001))
os << nl;
}



Info << "\n write file is complete \n";

return 0;
}


// ************************************************** *********************** //
I hope it can help you
amin144 likes this.
nygbook is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan OpenFOAM Meshing & Mesh Conversion 3 October 22, 2015 11:05
continuum surface tension model yukn Main CFD Forum 0 October 8, 2011 06:43
[Gmsh] boundaries with gmshToFoam‏ ouafa OpenFOAM Meshing & Mesh Conversion 7 May 21, 2010 12:43
Recover surface from surface mesh in IcemCFD Jerry Tanner CFX 0 August 20, 2008 12:48
Equilibrium of a free surface under surface tensio Ryan Main CFD Forum 1 August 7, 2001 16:14


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