|
[Sponsors] |
fvc::laplacian(mu,U) returns (very) different reslts from fvc::div(2*mu*D) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 3, 2016, 13:16 |
fvc::laplacian(mu,U) returns (very) different reslts from fvc::div(2*mu*D)
|
#1 |
Member
Paolo Capobianchi
Join Date: Sep 2014
Posts: 35
Rep Power: 11 |
Dear All,
I would like to put to your attention an issue that I have encountered during some tests. As the title of the thread suggest, I have noticed pretty much different results evaluating the diffusive term of the momentum equation using two different, but (mathematically) equivalent, ways. If mu is the viscosity of the fluid, U its velocity and D = 0.5*(grad(U) + grad(U).T()) is the deformation tensor, we can write div(2*mu*D) = div(mu*grad(U)) + div(mu*grad(U).T()) where grad(U).T() is the transpose of the velocity gradient. For an incompressible flow, and considering mu = constant, the second term of the previous equation is zero, hence we finally have: div(2*mu*D) = div(mu*grad(U)) On the other hand div(mu*grad(U)) = laplacian(mu,U), if I am not wrong, so I have implemented a piece of code to evaluate these two variables: volVectoField laplacian = fvc::laplacian(mu,U); volVectorField div = fvc::div(2*mu*D); During my tests I have seen difference (~20% and larger) in the x-components and a smaller difference in the other two components (the error here might be due to a different numerical treatment). I have also tried all the numerical schemes available but the results are always quite different. Unless I made some mistakes during the calculations, the two terms I wrote should be "equivalent", otherwise there might be a bug somewhere. Does anyone else came across a similar issue? Many thanks! Regards, Paolo Last edited by pablitobass; June 4, 2016 at 07:36. |
|
June 4, 2016, 10:57 |
|
#2 |
Member
Paolo Capobianchi
Join Date: Sep 2014
Posts: 35
Rep Power: 11 |
The problem has been solved. There is a mistake in the code I am using. I did the same tests in icoFoam and the operator laplacian and div work fine.
Thanks and sorry for the wrong report. Paolo |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
dynamic contact angle udf returns no value to solver | shiraz_man67 | Fluent UDF and Scheme Programming | 5 | July 3, 2018 14:51 |
Mesh returns to undeformed shape after ICEM Remesh | Kindel | CFX | 4 | January 21, 2013 14:26 |
CrankNicholson returns wrong dimensions and sound speed when mesh is moving | lillberg | OpenFOAM Bugs | 6 | May 4, 2009 17:53 |
UDF - C_STRAIN_RATE returns 0 | Grzegorz | FLUENT | 0 | June 3, 2008 08:50 |
DNS always returns to laminar initial solution | kat | Main CFD Forum | 10 | September 9, 2007 09:20 |