CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Initialize a Field reading from a table (https://www.cfd-online.com/Forums/openfoam-programming-development/188213-initialize-field-reading-table.html)

S.Colucci May 25, 2017 13:06

Initialize a Field reading from a table
 
Hi,
I'm trying to understand how to initialize a Field by looking into a table. For example, I have a Field for indexes like this ( dimensionedScalar("one", dimless, 1) is just an example, values can vary from cell to cell)
Quote:

volScalarField k_index
(
IOobject
(
IOobject::groupName("k_index", this->pair_.name()),
this->pair_.phase1().mesh().time().timeName(),
this->pair_.phase1().mesh()
),
this->pair_.phase1().mesh(),
dimensionedScalar("one", dimless, 1)
);
and I want to create an other Field, called F, reading the k_index entries in a table
Quote:

volScalarField Fsaturation
(
IOobject
(
IOobject::groupName("prova", pair.name()),
pair.phase1().mesh().time().timeName(),
pair.phase1().mesh()
),
pair.phase1().mesh(),
??? table[k_index] ???
);
Anybody know how to do that?

Thanks

Simone


All times are GMT -4. The time now is 11:10.