CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Usinng divDevReff vs div(R) + laplacian(nu,U) (https://www.cfd-online.com/Forums/openfoam/74299-usinng-divdevreff-vs-div-r-laplacian-nu-u.html)

mchurchf March 29, 2010 17:20

Usinng divDevReff vs div(R) + laplacian(nu,U)
 
I am wondering if anyone can help with a problem I am encountering. I need to apply boundary conditions on SGS stresses in addition to nuSgs. I would like to perform near-wall modeling in LES by setting the stess at the wall.

Therefore, I have reformulated the UEqn matrix in a PISO solver to look like:

fvm::ddt(U) + fvm:div(phi,U) + div(R) + laplacian(nu,U)

where R = turbulence->R(); Originally, the code is as follows:

fvm::ddt(U) + fvm:div(phi,U) + turbulence->divDevReff(U)

I am finding that if I set the value of the shear stress at the ground, the solution develops very oscillatory instabilities. If I set the boundary condition of R to zeroGradient, things are okay, but I need to be able to set specific stress tensor values at the ground.

Any ideas??

Thanks,

Matt

mchurchf April 5, 2010 15:27

I just want to ask the above question again. If anyone can help, it would be much appreciated.

Matt

chb April 8, 2010 07:34

Could it be that the signs of your div() and laplacian() term are wrong?

Maybe

fvm::ddt(U) + fvm:div(phi,U) - fvc::div(R) - fvm::laplacian(nu,U)

solves your problem.


mchurchf April 8, 2010 09:26

Using divDevReff vs div(R) - laplacian(nu,U)
 

Christof,

Thanks for your reply. You are correct about my signs being partially incorrect. I typed them into my original posting at the top of the thread incorrectly, but I had them coded correctly. They should be

fvm::ddt(U) + fvm:div(phi,U) + fvc::div(R) - fvm::laplacian(nu,U)

where R = turbulence->R(). One interesting thing that I am finding is that in the code for a full Reynolds or SGS stress model like the LRR model, divDevReff(U) is defined as:

+ fvc::div(R_ + couplingFactor_*nut_*fvc::grad(U), "div(R)")
+ fvc::laplacian((1.0 - couplingFactor_)*nut_,U,"laplacian(nuEff,U)")
- fvm::laplacian(nuEff(), U)

which is interesting. Why not just define it as
+ fvc::div(R) - fvm::laplacian(nu, U) like I have unsuccessfully tried to do? The above formulation contains both a "coupling factor", which could possibly by used for stability reasons, and it contains an implicit Laplacian that uses nuEff (which is larger than just nu), which seems to be important for stability in OpenFOAM solvers. divDevReff(U) in the eddy-viscosity based solvers also is formulated to include an implicit Laplacian that uses nuEff, although there would be other ways to formulate this term without a Laplacian using nuEff such as

- fvc::div(nut_*twoSymm(fvc::grad(U))) - fvm::laplacian(nu,U)


Since at least the OpenFOAM PISO-based solvers do not include added dissipation terms, I am wondering if this fvm::laplacian(nuEff,U) is in there for stability reasons.

Matt



chb April 9, 2010 04:37

Since fvc::div(R) is an explicit term, it might cause numerical instabilities when your time step is too large. Maybe reducing the time step to get a cell CFL number less than 1 helps. CFL = U_ref * DT / DX where DX is the cell size and DT the time step. I'd try DT = 0.25 * DX / U_ref to get the explicit formulation stable. (Depending on the diffusion number it could be that you even need an much smaller time step with an explicit formulation.)

pgiannatselis April 8, 2015 08:29

hi everyone

I am trying to use the following UEqn


tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::laplacian(nueff, U)
- g
- fvm::div(nueff, fvc::grad(U)) - fvm::div(nueff, T(fvc::grad(U))) //this line
==
fvOptions(U)
);


nueff is volScalarField


errors that no matching function for call to ‘div(Foam::volSca.......... appear and I can't find out where I am wrong.

Can anyone point out how I should syntax the two terms. Without these terms no errors appear. Thanks a lot in advance.


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