|
[Sponsors] |
Writing scalarField values into a pointScalarField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 13, 2011, 08:06 |
Writing scalarField values into a pointScalarField
|
#1 | ||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hi all,
I want to write values of a scalarField sF to the patch boundaryField values of a pointScalarField pSF. The pointScalarField pSF has been created as pointScalarField pSF ( IOobject ( "pSF", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), pMesh, dimensionedScalar("pSF", dimensionSet(0, 1, 0, 0, 0, 0, 0), 0.0), "zeroGradient" ); These are the errors I get: 1. pSF.boundaryField()[patchi] = sF; results in Quote:
2. pSF.boundaryField()[patchi].patchInternalField() = sF; compiles but results in Quote:
Do you have any idea? Arne |
|||
October 13, 2011, 08:52 |
|
#2 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Sorry, patchInternalField() is of course a function to write internalField values to the corresponding boundaryFields. I mixed that.
Last edited by Arnoldinho; October 13, 2011 at 08:58. Reason: typo |
|
October 13, 2011, 09:58 |
|
#3 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
Hi Arne,
I hope it helps to recall that a geometricField (e.g. a volScalarField) is defined at cell centroid, whereas pointField values are defined at cell vertices. Refer to figure 2.4 of the programmer's guide. Best regards, Hisham |
|
October 13, 2011, 10:05 |
|
#4 | |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hi Hisham,
Quote:
Do you have a hint on howto access/replace the points on the specific boundary patch of the pointScalarField? I'm stuck right now... Arne Last edited by Arnoldinho; October 13, 2011 at 10:26. |
||
October 13, 2011, 10:26 |
|
#5 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Ok, regarding Figure 2.4, I'm a bit confused. boundaryField values of a volField are on the edes (in 2D), what is the same for a pointField.
So now I'm not sure which points I need: I want to modify a pointDisplacement file as boundary condition for e.g. interDyMFoam during runTime. Modifications in the pointDisplacement file are done in the boundaryField (e.g. SnakeRiverCanyon tutorial). Regarding fig. 2.4, are these now the vertices of the internalField lying on the patch, or the face mid-points of the bundaryField lying on the patch? Arne |
|
October 13, 2011, 13:21 |
|
#6 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
The following is only my understanding (not to be taken without checking)
The fvMesh is the mesh on which all FV calculations are done and stored. Therefore, it is logically found that a geometricBoundaryField exists, which is a geometricField defined over the patchField. Checking moveDynamicMesh, what is manipulated is the dynamicFvMesh, which is an fvMesh (again centroid). Checking the code (I have no experience with moving mesh but interested), the dynamicFvMesh type set, in the dynamicMeshDict dictionary, is the responsible for the mesh.update() function. Checking this dynamicMotionSolverFvMesh.C for example, it seems that the code does the update of the fvMesh. In displacementSBRStressFvMotionSolver.C, it seems that there is an interpolation from pre-defined face displacements to cell centroid. Then, the motion solver solves for cellDisplacement, which I believe is at the centroid (as the Doxygen makes it explicitly clear that all FV calculations are at the fvMesh) I am interested in this topic, would you kindly keep me informed? Best regards, Hisham |
|
October 22, 2019, 04:38 |
|
#7 |
Member
Bidesh Sengupta
Join Date: Sep 2018
Location: Sngapore
Posts: 76
Rep Power: 8 |
Sorry for bumping into an old post. But my problem seems very similar.
I wish to write a scalarField. My code is the following: scalarField CE = (pUx*normal_x + pUy*normal_y + pUz*normal_z)/(mag(U_Air) * rho_Air); volScalarField bCE ( IOobject ( "CE", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("CE", dimensionSet(0, 0, 0, 0, 0, 0, 0), 0.0) ); It is getting compiled. I could print the values on the terminal and those were non zero. But it is always writing the values as 0. " FoamFile { version 2.0; format ascii; class volScalarField; location "0.75364000004"; object CE; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { wall { type calculated; value uniform 0; } pressure-far-field-1 { type calculated; value uniform 0; } frontAndBackPlanes { type empty; } } " Can any one suggest me my mistake. Thanks a lot. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
It would be wonderful if a tool for FoamToTecplot is available | luckyluke | OpenFOAM Post-Processing | 165 | November 27, 2012 07:54 |
max node values exceed max element values in contour plot | jason_t | FLUENT | 0 | August 19, 2009 12:32 |
exact face values | RubenG | Main CFD Forum | 0 | June 22, 2009 12:09 |
Writing yPlusRAS Values | velan | OpenFOAM Running, Solving & CFD | 0 | December 30, 2008 07:09 |
strange node values @ solid/fluid interface - help | JB | FLUENT | 2 | November 1, 2008 13:04 |