CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Getting nu at a particular location, please help! (http://www.cfd-online.com/Forums/openfoam/118635-getting-nu-particular-location-please-help.html)

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:

nu()[CellI]

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!

Jack

Code:

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

forAll(omega_, i)
{
        if(yPlus[i] < 2.0)
        {
                fixCells.insert(i);
                setO[i]=1;
               
        }
}

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


forAll(fixO, i)
{
        label cellI =  fixCellsLabel[i];
        fixO[i]=6.0/beta1_.value()*nu()[cellI]/(sqr(y_[cellI]));
}

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:

Code:

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?

Thanks

Jack


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