CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   TimeVaryingUniformFixedValueFvPathField (

skabilan November 8, 2007 04:04

Hi, I need to share an arra

I need to share an array between icoFoam.C and timeVaryingUniformFixedValueFvPathfields.C so that both the codes can update the array during the run.

Any Suggestions?


mattijs November 8, 2007 15:59

Use a volScalarField (= list o
Use a volScalarField (= list of scalars). This gets registered on the database which you can access from any boundary condition. See e.g. pressureInletVelocityFvPatchVectorField.C which gets phi from the database. (is surfaceScalarField but the principle is the same)

skabilan November 9, 2007 01:34

Hi Mattijs, Thanks for the
Hi Mattijs,

Thanks for the help! I was able to create a volScalarField (using createFields.H) basically a replica of -case directory-/0/p file. Not sure if this is the right way! I have modified the TimeVaryingUniformFixedValueFvPathField.H and .C so that it can see the new volScalarField. Success ends here! I am not sure how to write into (neither read from) the database (say the pressure value for a particluar patch into the new volScalarField) both in TimeVaryingUniformFixedValueFvPathFields.C as well as icoFoam.C. I know the new field is availble at both places.

Thanks in Advance


All times are GMT -4. The time now is 17:48.