|
[Sponsors] |
transforming a function defined on mesh().points() into a pointScalarField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 26, 2009, 07:49 |
transforming a function defined on mesh().points() into a pointScalarField
|
#1 |
Member
Virginie Ehrlacher
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Hello Foamers,
I am new to programming in OpenFOAM and I have created a function which is gives a certain value for each of the points of the mesh (mesh().points()) and I would to transform it in a pointScalarField so that I could see the values of the function with paraview. How would you advise me to do that? Thank you. Virginie |
|
March 26, 2009, 10:27 |
|
#2 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
Virginie,
Perhaps this would be helpful: Code:
#include "pointMesh.H" #include "pointFields.H" #include "fixedValuePointPatchFields.H" // Instantiate a pointMesh object pointMesh pMesh(mesh); pointScalarField pValues ( IOobject ( "pValues", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), pMesh, dimensionedVector("scalar", dimless, 0.0), "zeroGradient" ); pValues.internalField() = myPointField; pValues.write(); Cheers, Sandeep |
|
March 26, 2009, 10:29 |
|
#3 |
Senior Member
Sandeep Menon
Join Date: Mar 2009
Location: Amherst, MA
Posts: 403
Rep Power: 25 |
Sorry... Cut'n'Paste error:
dimensionedVector("scalar", dimless, 0.0) should be dimensionedScalar("scalar", dimless, 0.0) Cheers, Sandeep |
|
March 26, 2009, 11:13 |
|
#4 |
Member
Virginie Ehrlacher
Join Date: Mar 2009
Posts: 52
Rep Power: 17 |
Thank you a lot Sandeep.
It works perfectly fine. Virginie |
|
March 31, 2009, 11:30 |
How to begin with OpenFOAM?
|
#5 |
Member
xianghong wu
Join Date: Mar 2009
Posts: 57
Rep Power: 17 |
Hi,
I am a beginner, I am going to read OpenFOAM code and modify it for purpose of simulating aluminum extrusion. I think maybe OpenFOAM can mesh complex geometry already, but I didn't try. So I think the first step is to modify the constitutive model. When I read the code, there are so many files. I think I should understand the whole structure of the software.But it is so big. So where can I start with? Anybody can give me some advice? Wendy |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 10:31 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 01:35 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |