CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   modifying nuSgsWallFunction (https://www.cfd-online.com/Forums/openfoam-solving/96230-modifying-nusgswallfunction.html)

impecca January 16, 2012 22:03

modifying nuSgsWallFunction
 
Dear Foamers,
I am trying to modify the nuSgsWallFunction (nuSgsUSpaldingWallFunctionFvPatchScalarField.C) in OF 1.7.1 and I got some questions.

I want to implement Wang & Moin ( pof.aip.org/resource/1/phfle6/v14/i7/p2043_s1 ) model. In this model it specifies tauw (wall shear stress) directly rather than nuSgs (like in 'nuSgsWallFunction'). So I managed to acess to the 'tauw' (B() in LES model, see the code below) as a first step but I do not know how I return a calculated values into the B().
I just added few more lines within the nuSgsUSpaldingWallFunctionFvPatchScalarField.C file.

// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

void nuSgsWallFunctionFvPatchScalarField::evaluate
(
const Pstream::commsTypes
)
{
const scalarField& ry = patch().deltaCoeffs();

const fvPatchVectorField& U =
patch().lookupPatchField<volVectorField, vector>(UName_);

scalarField magUp = mag(U.patchInternalField() - U);

const scalarField& nuw =
patch().lookupPatchField<volScalarField, scalar>(nuName_);

//*** modification
const label patchI = patch().index();
const LESModel& lesModel =db().lookupObject<LESModel>("LESProperties");
fvPatchSymmTensorField& tauw= lesModel.B()().boundaryField()[patchI];

forAll(tauw, facei){
tauw[facei]=symmTensor(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
}
//*** modification END


By this way, I got an error when I run a simulation which is

#0 Foam::error:: printStack(Foam::Ostream&)

It seems that 'tauw[facei]=symmTensor(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)' has a problem. without this line, no error.
So could you suggest me how to return the calculated 'tauw' values into B() please? or any suggestion will be appreciated.

Thanks in advance.
Yusik


All times are GMT -4. The time now is 21:56.