Mathematics, Numerics, Derivations and OpenFOAM
Dear all,
during the derivation of the stress equations that are implemented in OpenFOAM, I started to derive the mass, momentum and (not complete) the energy equation. Furthermore, I showed and proofed that the vector form of the equations are equal to the Cartesian notation. The content is:
http://www.holzmann-cfd.de/index.php/en/publications http://www.holzmann-cfd.de/images/ver/ver_mndao.png Feel free to comment on that and I hope that it is helpful, clear and understandable. Happy new year to everybody |
Nice work Tobias!
I have newer seen the name “shear rate tensor” for tau (usually referred to as the extra stress tensor, as you also use). What you probably mean with “shear rate tensor” is when “tau” represents the GNM (the Generalized Newtonian Model). But the extra stress tensor “tau” can be much nastier than GNM. Regarding Chapter 6, if you want also to explain why shear rate is calculated as is done in OpenFOAM (sqrt(2 e:e)), then in my paper I show proof of that in Section 3. It also explains the GNM and it relationship with non-Newtonian fluids, with some good references (the paper is using the MRF in OpenFOAM for non-Newtonian fluids). If you use this, please make ref to my paper. Thanks. Again, nice work man. Cheers J. P.s. the reference is... J.E. Wallevik, Effect of the hydrodynamic pressure on shaft torque for a 4-blades vane rheometer, International Journal of Heat and Fluid Flow, 50 (2014) 95–102. DOI: 10.1016/j.ijheatfluidflow.2014.06.001 |
I will take a look,... pretty max out right now, but I will give feedback soon on this, if I have anything on this or not.
cheers J. |
Quote:
I had the same question before, see this post http://www.cfd-online.com/Forums/ope...-stresses.html. And I realized that the second term is indeed negligible compared to p, unless k is very large. Best, Likun |
Hi Tobi and Likun
When going into the source code of simpleFoam, I cannot see it is possible that the solver is working with a modified pressure. If this were the case, the pressure equation would have to get the term 2/3*k*I from somewhere, but there is no hint of this term anywhere in the solver. However, I did another test. I went into ~/OpenFOAM/OpenFOAM-2.4.x/src/turbulenceModels/incompressible/RAS/kEpsilon/kEpsilon.C ...and did this (see the member function R() above the member divDevReff())... tmp<fvVectorMatrix> kEpsilon::divDevReff(volVectorField& U) const { return ( // - fvm::laplacian(nuEff(), U) // - fvc::div(nuEff()*dev(T(fvc::grad(U)))) // -------------------------------------------------------- // Y16M01D24: - fvm::laplacian(nuEff(), U) - fvc::div( nuEff()*dev(T(fvc::grad(U))) - ((2.0/3.0)*I)*k_ ) ); } Thereafter, I tested pitzDaily with and without the modification, after running stressComponents, I saw no difference between the the two cases. So if one want, it is possible to add this, but at least in the pitsDaily case, it is not important. Note, with modification, you have to add div(((nuEff*dev(T(grad(U))))-((0.666667)*k))) Gauss linear; into ./system/fvSchemes (in divSchemes) J. |
Hey Jon,
thanks for the clearness. As I supposed in my paper it is neglected. Thanks for checking this. @all. I found a mistake in the enthalpy equation of chapter 3. I changed it and added one more hint. The correct diffusion term is (of course): Also the temperature equation has to be changed. The new PDF is up to date. |
Hi all,
again I found some mistakes in my paper. I will change it the next days and let you know when it is finished and uploaded. Cheers |
Quote:
I think it would be better if your text was more in line with the books (Ferziger, Versteeg, Anderson) you reference to. Specifically for the part when you derive momentum equation (2.14). The second term in the right hand side of the equation comes with minus sign (-nabla . tau); so does components of a shear stress tensor in equations (4.1)-(4.6). Even though those minuses just cancel out in the end and the final equation (4.13) is the same as in the books, it would be more easy to follow your text if your text followed the books. Looking at the energy equation (3.4) it is not clear where all the terms come from. I suggest that you should derive the energy equation the way you did with continuum and momentum equations, i.e. start with an infinitesimal fluid volume, formulate the equation in Cartesian scalar notation and transform it into a vector form. Here is the useful link: http://cfd.direct/openfoam/energy-equation/ Misprints: eq. (2.21): rho was left out. eq. (4.27): nabla was left out. Anyway, good job! |
Quote:
Quote:
Quote:
Quote:
Quote:
PS: I also found other mistakes (icoFoam) and derivation to POISSON equation. These are fixed. I will also fix the stuff you mentioned and maybe add Non-Newtonian + Energy-derivation to the documentation. Good night to everybody. Tobi --> New PDF Uploaded |
1 Attachment(s)
I have recently written a document about the derivation of the enthalpy equation from the total energy equation and the handling of source terms. I figured it might be of some interest here so I'm posting it. Please let me know what you think and if there are errors.
Edit: Some updates to the document. Edit 2: Added heat conduction term which arises when h=h(p,T). |
Has anyone checked the derivation for errors? I recently learned in a discussion with mkraposhin that there is also an additional heat conduction term when the enthalpy function depends on pressure. I have updated the document to reflect this.
I have done some tests to investigate the influence of the additional mass and momentum source terms in the energy equation as well as the additional heat conduction term. In my case they provide small but visible differences so I would suggest to include them. Edit: Actually the inclusion of the E*S_M term in the enthalpy equation looks to be significant for my case at later times in the simulation. |
Hey Chris,
I checked your summary and its fine. Just a few hints. You never mentioned what the term stand for. Of course it is the mass source term but you should mention that it is zero. Normally we are not dealing with fusion or sth. like that. Additional, people who are not familiar with the mathematic would not know why you multiply the continuity equation by the energy E eqn. (5). Therefore (it is my opinion) the derivation is in the wrong direction. For me it would be clear to derive the conserved energy equation and use the conti to go to the non-conserved form. You did it vice versa and hence, people can get confused why you e.g. multiply the conti by E. Nontheless, nice stuff. PS: A lot of authors use the total derivative to derive conserved equations. |
Thanks for your comment!
Quote:
Quote:
Quote:
|
Quote:
and the total derivative: Till now everything is clear for everybody. Next step is to add the continuity equation to the total derivative like: Now (maybe) some people are wondering why you multiply the conti by . For me it is clear why you do this and why we have to multiply by . Everybody who is familiar with the mathematic background will not complain about that but beginners or non-familiar math guys get confused or do not know why has to be added ;) Thats the reason why I said (in my opinion) the better way would be to derive the conservative form first and then do simplifications or not. Why I tell you this, because I got really confused about all the equations. Everywhere and everybody uses other derivations, start from integrals, total derivatives etc. It like you read this book and this and you get more confused about the equations. Of course maybe I am a stupid guy who need a strict forward line (maybe); that was the reason why I derived everything out of a volume element. Then you really get the conserved equations, which can be simplified using the conti to non-conserved equations. If you did this once, of course you can do it vice versa (: Anyway :) Well done. |
Dear all,
I investigated time to extend the paper / summary as follow:
The document is now 45 pages big. Further improvements: speech and logical structure. I will need a bit more time to get it ready but I will keep you updated. Notice that the derivations are done using a volume element. Therefore we get the conservative forms straight forward. |
|
Dear Matvey
I am pretty sure that most of us know that OF uses the finite volume approach. It is fairly straight forward to transform an integral equation into a differential one. See for example p. 387 in my PhD thesis @ http://ntnu.diva-portal.org/smash/re...2:124984&rvn=1 Also, when programming a solver, a differential approach is used (e.g. UEqn.H in interFoam), which OF transforms into an integral approach (in this case, by the fvm::div(), fvm::laplacian(), fvm::grad() and etc -class)), thus in the end, it is nicer to have the equations in its differential state, rather than in integral state. Hope this helps cheers J. |
Dear all,
I am happy to announce that I have published the new paper. A lot of changes are done and can not compared to the original (: The document has 45 pages and include the following:
The equations are given in the following forms in the first part:
Finally I added the literature I used and gave some cites. After I restarted working on the stuff, I realized that a lot of stuff is not straight forward and rearranged a lot. Furthermore the english speak was improved and checked. A few mathematic errors were found and corrected. Everything can be found on my updated page www.holzmann-cfd.de Feedback, error-report, etc. is welcomed, |
Quote:
|
All times are GMT -4. The time now is 04:21. |