CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Using different turbulent viscosities for turbulent stress components (http://www.cfd-online.com/Forums/openfoam-solving/57997-using-different-turbulent-viscosities-turbulent-stress-components.html)

 braennstroem April 14, 2008 11:59

Hi, does anyone have an ide

Hi,

does anyone have an idea, how one would adjust the turbulent viscosity for each component of the reynolds stresses separately? E.g. L. Davidson uses such an approach for the v2f model modification, where he has two different eddy viscosities. I would start at the divR member function in e.g. the standard k-eps model and adjust the lines

return
(
- fvm::laplacian(nuEff(), U)
);

but I have no clue, how to adjust the divR matrix for certain components...!? Would be nice, if someone can point me in the right direction :-)

Fabian

 grtabor April 14, 2008 12:11

Well, the most general method

Well, the most general method would be to use a 4th rank tensor - but OpenFOAM won't support that. You could construct the matrix component-by-component, but thats messy and violates the spirit of OF.

I presume you have in mind different viscosities for different parts of the matrix; eg. for symmetric and antisymmetric parts? Would it be valid to construct these matrices in the usual manner and then apply the viscosities, so instead of

mu*divR

you use

mu1*(divR + divR.T()) + mu2*(divR - divR.T())

???

Gavin

 braennstroem April 14, 2008 13:06

Hi Gavin, nice idea, thanks

Hi Gavin,

nice idea, thanks. I just tried to adjust the
the 'turbulence->divR(U)' term in simpleFoam with your proposal:

+(turbulence->divR(U) + turbulence->divR(U).T()) + (turbulence->divR(U) - turbulence->divR(U).T())

but there is no member 'T':

c \$SOURCE -o Make/linux64GccDPOpt/simpleFoam.o
simpleFoam.C: In function 'int main(int, char**)':
simpleFoam.C:72: error: 'class Foam::tmp<foam::fvmatrix<foam::vector<double> > >' has no member named 'T'
simpleFoam.C:72: error: 'class Foam::tmp<foam::fvmatrix<foam::vector<double> > >' has no member named 'T'
make: *** [Make/linux64GccDPOpt/simpleFoam.o] Error 1

In addtion the above mentioned adjustment of Davidson change just one component. Another idea could be to have three different viscosities, one for each vel component (or is this a stupid idea?). Would a component wise adjustment use something like divR(U).component(1,1) for the first component!?

Thanks! Fabian

 grtabor April 14, 2008 18:32

Sorry - got caught out by the

Sorry - got caught out by the tmp (as usual). Try:

+(turbulence->divR(U) + turbulence->divR(U)().T()) + (turbulence->divR(U) - turbulence->divR(U)().T())

- that should compile.

The problem I see with doing a component-wise scaling is that it is not frame independent; ie it will be different if you change the coordinate system. It is therefore unphysical. You (and Davidson) should really be confining yourself to proper tensor operations, I think. Of course, I don't really understand quite what you are trying to achieve here, so this is a _very_ uninformed viewpoint!

Gavin

 braennstroem April 16, 2008 02:09

No, does not work: simpleFo

No, does not work:

simpleFoam.C: In function 'int main(int, char**)':
simpleFoam.C:71: error: 'struct Foam::fvMatrix<foam::vector<double> >' has no member named 'T'
simpleFoam.C:71: error: 'struct Foam::fvMatrix<foam::vector<double> >' has no member named 'T'
make: *** [Make/linux64GccDPOpt/simpleFoam.o] Error 1

Do you have an idea?

Your are right about the symmetry, but keeping the symmetry (and other constraints) in mind one is able to adjust components.

A more general would probably be to adjust the nuEff declaration in turbulenceModel.H:
//- Return the effective viscosity
virtual tmp<volscalarfield> nuEff() const
{
return tmp<volscalarfield>
(
new volScalarField("nuEff", nut() + nu())
);
}

as a vector, so being to do the adjustments directly in the turbulence model implementation!?

Thanks!
Fabian

 eugene April 16, 2008 05:05

You have to do your transpose

You have to do your transpose in the turbulence model before divR becomes a fvVectorMatrix.

Regarding your viscosity problem, can't you just use a normal tensorial viscosity?

 braennstroem April 16, 2008 11:21

Hi Eugene, did not understa

Hi Eugene,

did not understand everything... actually nothing;-)
what do you mean with 'before'?

With tensorial viscosity you mean just using volTensorField for nuEff!?

Thanks!
Fabian

 eugene April 17, 2008 06:09

Take a look at where divR is c

Take a look at where divR is created in the turbulence models. This is where you have to do your transpose operation. (Note: transpose terms will be explicit.) I also recommend you check the LRR model implementation for some ideas.

 braennstroem April 21, 2008 13:19

Thanks, will see what I'll und

Thanks, will see what I'll understand.

Regards!
Fabian

 markc February 5, 2009 05:18

Hello All, I have a solver

Hello All,

I have a solver derived from interDyMFoam and try to access the field nuEff as follows:
>>>
// Construct incompressible RAS model
autoPtr<incompressible::rasmodel> turbulence
(
incompressible::RASModel::New(U, phi, twoPhaseProperties)
);
volScalarField nuEff = turbulence.nuEff();

<<<
However during building I get the following error:

>>>
'class Foam::autoPtr<foam::incompressible::rasmodel>' has no member named 'nuEff'
<<<
This seems strange to me because RASModel.C shows the following member:
>>>
virtual tmp<volscalarfield> nuEff() const
{
return tmp<volscalarfield>
(
new volScalarField("nuEff", nut() + nu())
);
}
<<<
I clearly access a wrong class but I do not understand why and how. Any comments on how to access this nuEff?

Mark

 gschaider February 5, 2009 05:39

Hi Mark! Try turbulence().n

Hi Mark!

Try turbulence().nuEff() and have a look at the Doxygen-page of autoPtr

Bernhard

 santos February 5, 2009 06:04

Hi Mark, I dont think you n

Hi Mark,

I dont think you need to declare:
volScalarField nuEff = turbulence.nuEff();

Try to use turbulence->nut() if you need to access the turbulent viscosity, or use nuEff directly in your solver.

The first case is useful if you are solving for scalar transport, where you add nut/Sc_t to the scalar diffusivity.

Regards,
Jose Santos

 markc February 5, 2009 07:57

Hello All, Thanks, it worke

Hello All,

Thanks, it worked!

Brgds,

Mark

 T.D. October 15, 2010 08:59

nuEff()

Hi guys,

Any ideas how to add a new nuEff2() in turbulence().nuEff2() ?
or simply how to make two different "nu1" and "nu2" of two different viscosityModels where to be used both inside one solver? how to call them?

thanks a lot

 All times are GMT -4. The time now is 01:28.