CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Is div(grad(U))=laplacian(U) ??? (https://www.cfd-online.com/Forums/openfoam/107701-div-grad-u-laplacian-u.html)

mmkr825 October 4, 2012 08:00

Is div(grad(U))=laplacian(U) ???
 
Hi Everyone,
I have a doubt about div() and laplacian(). For the general case in all solvers we written gamma*div(grad(U))=laplacian(gamma, U).
But when i checked by replacing fvc::laplacian(gamma, U) =gamma*fvc::div(fvc::grad(U)) for the icoFoam solver, the solution is diverging (Courant Number going to high value).
Anyone please clarify my doubt.

Thanks
Regards
Mallikarjuna

ata October 6, 2012 06:51

Hi
I think you see instability because you use a non-conservative form.

mmkr825 October 7, 2012 01:39

Hi Ata,
Thanks very much quick reply. You are correct, i am getting instability. could you please suggest me to rectify this problem. I need to use div(gradU+gradU.T()) in my problem.

Thanks
Regards
Mallikarjuna

ata October 7, 2012 05:02

Hi
May using lower relaxations be helpful.

mmkr825 October 7, 2012 06:41

Hi Ata,
Thanks for your reply. I tried with low relaxation factor but it is not working. Is there any other method to solve this problem? If it is there please guide me

Thanks
Regards
Mallikarjuna.

ata October 7, 2012 07:14

Hi
Would you please tell me what relaxation factors you used?

mmkr825 October 7, 2012 08:02

hi Ata,
I have taken relaxation factor as 0.2. But still it is coming the same

Thanks
Regards
Mallikarjuna

ata October 7, 2012 08:29

Hi
Is the problem unsteady state? If yes how much is your time step and max courant number?
You used 0.2 for all equations?

mmkr825 October 8, 2012 01:07

Hi Ata,
My solver is steady state. I have taken relaxation factors as for p=0.2,U=0.07.

Thanks
Regards
Mallikarjuna

ata October 8, 2012 05:08

Hi
What is your solver?
Could you try both of relaxation factors 0.01?

mmkr825 October 8, 2012 06:08

1 Attachment(s)
Hi Ata,
I developed my own solver for predicting velocity profile(U) and particle concentration profile(T) for suspension flow (fluid+particles). And in my momentum equation, the viscosity is not constant, it is function of particle volume fraction(T).

I am attaching my solver.

Thanks
Regards
Mallikarjuna

ata October 9, 2012 06:45

Hi
Is it possible to write your solver in a conservative form?
Did you try both of relaxation factors 0.01?

mmkr825 October 9, 2012 06:57

Hi Ata,
I tried for both of relaxation factors 0.01. I think my solver is in non conservative form.
At First i tried for icoFoam solver by replacing laplacian (nu, U) by nu*fvc::div(fvc::grad(U)).
And i tried another method where laplacian(U)=div(faceFluxes).
Code:-

surfaceVectorField surfNormalGradDU = fvc::snGrad(U);
surfaceVectorField n = mesh.Sf()/mesh.magSf();
surfaceTensorField surfGradDU=(n*surfNormalGradDU) + ((I-n*n)&(fvc::interpolate(fvc::grad(U))));

fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
- nu*fvc::div(mesh.magSf()*(surfGradDU&n))
);


But i am getting the divergence problem.


Thanks
Regards
Mallikarjuna

ata October 9, 2012 07:14

Hi
Could you first calculate the viscosity and then use fvm::laplacian(nu, U) in your code?

mmkr825 October 10, 2012 02:32

Hi Ata,
I tried for the icoFoam solver and for cavity case. I taken relaxation factors as you suggested 0.01 for both p and U. Here nu is constant. And i used gauss linear for div() and Gauss linear corrected for laplacian().

Should i change these schemes to other schemes?

Thanks
Regards
Mallikarjuna

ata October 10, 2012 05:23

Ho
For start they are good. What did you got using these?

mmkr825 October 10, 2012 05:32

Hi Ata,
when i run my case by using modified icoFoam solver, it is running some iterations giving some error as follows.

Error:-

Time = 0.145

Courant Number mean: 7.93942e+94 max: 1.42329e+96
DILUPBiCG: Solving for Ux, Initial residual = 0.999994, Final residual = 0.980212, No Iterations 1001
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 1.46608, No Iterations 1001
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.0270296, No Iterations 1001
time step continuity errors : sum local = 6.53592e+99, global = -4.90912e+83, cumulative = -4.90911e+83
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#1 Foam::sigFpe::sigHandler(int) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#2 Uninterpreted:
#3 Foam::PCG::solve(Foam::Field<double>&, Foam::Field<double> const&, unsigned char) const in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libOpenFOAM.so"
#4 Foam::fvMatrix<double>::solve(Foam::dictionary const&) in "/opt/openfoam211/platforms/linuxGccDPOpt/lib/libfiniteVolume.so"
#5
in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/testIcoFoam"
#6
in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/testIcoFoam"
#7 __libc_start_main in "/lib/i386-linux-gnu/libc.so.6"
#8
in "/home/malli_reddy/OpenFOAM/malli_reddy-2.1.1/platforms/linuxGccDPOpt/bin/testIcoFoam"
Floating point exception

i have checked the solution in paraView, the results are out of expectations.

Thanks
Regards
Mallikarjuna

ata October 10, 2012 05:45

Hi
How much is your max. Courant number?

mmkr825 October 10, 2012 05:52

Hi Ata,
At the last iteration it is max: 1.42329e+96. And my delta t is 0.005. At first iteration courant no < 1. But it is gradually increasing.

Thanks
Regards
Mallikarjuna

ata October 10, 2012 08:15

Hi
Decrease your delta T.

mmkr825 October 10, 2012 12:24

Hi Ata,
I decreased delta t, case is running but giving wrong results. I taken delta T as 0.000005.

Thanks
Regards
Mallikarjuna


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