CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (http://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   setValues - access coordinates (http://www.cfd-online.com/Forums/openfoam-programming-development/89001-setvalues-access-coordinates.html)

catapult June 1, 2011 04:39

setValues - access coordinates
 
Hi there,

I am using the function setValues of fvmatrix. I can create a labelList of the cells I want to update. I can not however create a corresponding scalarField that require the values of the turbulent energy k_ when looping over selected cells. The following exemple will help understand my problem:
---------------------------------------------
labelHashSet wallCells;
forAll(fmu_, cellI)
{
if (fmu_[cellI]<0.95)
{wallCells.insert(cellI);}
}
labelList cellLabels = wallCells.toc(); //I successfully created my list of selected cell

scalarField fixedEpsilon (cellLabels.size());
forAll(fixedEpsilon, cellI)
{
fixedEpsilon[cellI] = pow(k_[cellI], 1.5)/Leps_; //this is wrong **
}
epsEqn().setValues(cellLabels, fixedEpsilon);
----------------------------------------------

** this is where I get stuck. How can i set my epsilon in a particular cell given that I need to access the k_ in this cell ??? the cell [cellI] of fixedEpsilon doesnot match the cell [cellI] of k_. How can I solve this ?

Thank you very much for your help.


All times are GMT -4. The time now is 14:47.