|
[Sponsors] |
April 29, 2015, 11:17 |
fvc::grad(U) in interFoam
|
#1 |
Member
Join Date: Mar 2015
Posts: 35
Rep Power: 11 |
Hello everybody,
actually I have a problem with the discretisation of UEqn in InterFoam. As you can see from the source code, the term "fvc::grad(U)&fvc::grad(nu)" is subtracted; i guess to take into account the variable viscosity. But if I look deep into the source code of fvm::laplacian(nu,U), then the variable viscosity should already be treated. The volume integral of "Gradient(nu*Gradient(U))" is euqal to the surface integral over "nu*Gradient(U)" (Gauus theorem). And nu is interpolated to face centers, before matrix coefficients are calculated. Therefore the varibale viscosity is already taken into account, isn't it? So where does the explicit correction term comes from? Generall question: How can the Gradient of a vectorField be calculated? I followed the source code up to Foam::fv::gradScheme<Type>::grad. Then my skills in C++ metaprogramming fail. I can see the call of calcGrad in some cases (I don't really understand the if-condition), which would involve interpolation of U to surface centers and sum up the face area vectors*U: forAll(owner, facei) { GradType Sfssf = Sf[facei]*issf[facei]; igGrad[owner[facei]] += Sfssf; igGrad[neighbour[facei]] -= Sfssf; } Then I dont see the diverence to fvc::div(U), which should be zero all the time (pressure fields makes velocity field divergence free). Previous thanks for any answer. |
|
April 30, 2015, 09:03 |
|
#2 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14 |
Hello,
Maybe take a look at nonNewtonianIcoFoam. There you have the complete Navier-Stokes Equation. In interFoam, you have a mixing rule for viscosity, which translates into a gradient in viscosity around the interface. That calculation is somewhat hidden, but you can dig it out. Regards, Daniel |
|
May 12, 2015, 09:42 |
|
#3 |
Member
Join Date: Mar 2015
Posts: 35
Rep Power: 11 |
Thanks for reply, but exactly that is my question:
Why do I have to substract the "fvc::grad(nu) & fvc::grad(U)" ? The real differential Navier-Stokes-equation goes with "gradient(nu*gradient(U))". When you think about the finite volume discretisation, you can transform the volume integral " gradient(nu*gradient(U)) * dV " into a surface integral (Gauss theorem) . Int { (nu*grad(U))_face } dA The discretsation in "fvm::laplacian(nu,U)" already interpolate the nu-Field to faces and therefore takes into account the varying values of nu. So a further correction by subtracting "fvc::grad(nu) & fvc::grad(U)" seems wrong to me. Can anybody help me to understand this explicit correction or would agree to my argumentation? Regards, K.C. |
|
May 12, 2015, 10:57 |
|
#4 |
Senior Member
Daniel Witte
Join Date: Nov 2011
Posts: 148
Rep Power: 14 |
Well,
Please take a look at the follwing thesis: http://infofich.unl.edu.ar/upload/3b...7523c8ea52.pdf Eq. 111 decribes how the stress tensor is decribed. There is a nabla operator missing after the 1st equal sign (I can't help it), but you see that you are missing the second part of the stress tensor derivation. After the development of the right far side of the equation, you see that you get the exact formulation as in OpenFoam. This term is neglible only if the solver is: - incompressible (othervice div U is not 0) - monophase (otherwise the gradient of nu is not 0) - Newtonian (otherwise the gradient of nu is not 0) Hope that helps. I do not know where to find the original of that equation, but you may google something along "stress tensor". Daniel |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
InterFoam stops after deltaT goes to 1e14 | francesco_b | OpenFOAM Running, Solving & CFD | 9 | July 25, 2020 06:36 |
interFoam vs. simpleFoam channel flow comparison | DanM | OpenFOAM Running, Solving & CFD | 12 | January 31, 2020 15:26 |
interFoam in parallel | gooya_kabir | OpenFOAM Running, Solving & CFD | 0 | December 9, 2013 05:09 |
Problem of InterFoam with LES SpalartAllmarasIDDES | keepfit | OpenFOAM | 3 | August 29, 2013 11:21 |
Open Channel Flow using InterFoam type solver | sxhdhi | OpenFOAM Running, Solving & CFD | 3 | May 5, 2009 21:58 |