CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > 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 Display Modes
Old   February 20, 2012, 10:03
Default How to input surface value using sample
  #1
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 6
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, 02:22
Default
  #2
New Member
 
NieYongguang
Join Date: Sep 2010
Posts: 27
Rep Power: 6
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: 6
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: 6
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
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error : Self intersecting surface mesh, computing intersections & Error : Impossible velan Open Source Meshers: Gmsh, Netgen, CGNS, ... 1 July 14, 2015 05:54
continuum surface tension model yukn Main CFD Forum 0 October 8, 2011 06:43
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 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 02:55.