CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   TimeVaryingUniformFixedValueFvPathField (http://www.cfd-online.com/Forums/openfoam-solving/59329-timevaryinguniformfixedvaluefvpathfield.html)

skabilan November 8, 2007 04:04

Hi, I need to share an arra
 
Hi,

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?

Cheers!
Senthil

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

Senthil


All times are GMT -4. The time now is 07:25.