CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Getting nu at a particular location, please help! (

JackW May 31, 2013 08:44

Getting nu at a particular location, please help!
Hi there!

I have the task of compiling some models into later versions of openFoam (from 1.7.1), I believe I am almost there however I have come a bit unstuck on:


in the below code. Is there still a way to use index notation with nu in OF-2.1.0?

Thanks for any help you can give me!



labelHashSet fixCells;
scalarField yPlus = 0.547723*y_*sqrt(k_)/nu();

forAll(omega_, i)
        if(yPlus[i] < 2.0)

labelList fixCellsLabel = fixCells.toc();
scalarField fixO(fixCells.size());

forAll(fixO, i)
        label cellI =  fixCellsLabel[i];

omegaEqn().setValues(fixCellsLabel, fixO );

Bernhard May 31, 2013 09:44

I don't think these kind of addressing really changed from 1.7 to 2.1. I assume you got problems with compiling, can you shows some error messages?

JackW May 31, 2013 09:56

Hi, thank you very much for a quick reply.

The error is as follows:


Making dependency list for source file v2fEASMkOmegaV2/v2fEASMkOmegaV2.C
In file included from v2fEASMkOmegaV2/v2fEASMkOmegaV2.C:670:0:
v2fEASMkOmegaV2/omegaBSLWall.H: In member function 'virtual void Foam::incompressible::RASModels::v2fEASMkOmegaV2::correct()':
v2fEASMkOmegaV2/omegaBSLWall.H:75:38: error: no match for 'operator[]' in 'Foam::incompressible::turbulenceModel::nu() const()[faceCelli]'
In file included from v2fEASMkOmegaV2/v2fEASMkOmegaV2.C:672:0:
v2fEASMkOmegaV2/setOmega.H:30:39: error: no match for 'operator[]' in 'Foam::incompressible::turbulenceModel::nu() const()[cellI]'
make: *** [Make/darwinIntel64Gcc46DPOpt/v2fEASMkOmegaV2.o] Error 1

Basically from my limited C++ knowledge I assumed this was down to the operator [] not existing anymore, so I assumed there was another way?



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