|
[Sponsors] |
March 5, 2020, 13:09 |
Structure of momentum equation in mhdFoam
|
#1 |
New Member
Edmund Teller
Join Date: Feb 2020
Posts: 12
Rep Power: 6 |
Hi,
I was just looking at the momentum equation for an incompressible MHD flow online (https://www.openfoam.com/documentati...utorialse4.php) and saw that is was slightly different in mhdfoam.C: The equation in that link is: Code:
fvm::ddt(U) + fvm::div(U, U) - fvc::div(B, 2.0*DBU*B) - fvm::div(nu, U) + fvc::grad(DBU*magSqr(B)) == -fvc::grad(p)); While the one in mhdFoam is Code:
fvm::ddt(U) + fvm::div(phi, U) - fvc::div(phiB, 2.0*DBU*B) - fvm::laplacian(nu, U) + fvc::grad(DBU*magSqr(B)) == -fvc::grad(p)); I know I'm just being stupid, but why is phi and phiB used instead of U and B? And why is the vicosity term a laplacian operator rather than a divergence? Thanks! Edmund |
|
March 5, 2020, 13:26 |
|
#2 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73 |
To be honest, I would say an error the use of "phi". See https://www.openfoam.com/documentati...utorialse4.php
However, I suggest to post in the OF forum. The viscous term in the momentum reduces to the laplacian of the velocity when the velocity is divergence-free. |
|
March 5, 2020, 13:35 |
|
#3 |
New Member
Edmund Teller
Join Date: Feb 2020
Posts: 12
Rep Power: 6 |
Oh sorry! I thought I had posted in the Openfoam forum, I guess I forgot to check. Is it worth re-posting?
|
|
March 5, 2020, 13:54 |
|
#4 |
Senior Member
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,746
Rep Power: 66 |
In OpenFOAM phi is preferred for the fluxes even for incompressible cases where rho doesn't exist. phi is a face flux interpolated/constructed from U and is a surfaceScalarField whereas U is a volumeVectorField. So even though mathematically div(UU) and div(phi*U) are in principle the same for the incompressible case, there's lot of practical programming reasons to still use phi and not U.
tl;dr phi appearing in the governing equations for incompressible cases is not an error in OpenFOAM The other question on the laplacian term is answered already. The choice of taking the full divergence of the viscous stress and applying the the divergence free velocity constraint or choosing instead to just use the laplacian has different implications for numerical stability. |
|
March 5, 2020, 14:08 |
|
#5 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,849
Rep Power: 73 |
Quote:
I am not expert in OF, I wonder what is the issue in the fact that UU is a tensor and phi*U is a vector... |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Setting the height of the stream in the free channel | kevinmccartin | CFX | 12 | October 13, 2022 22:43 |
How to Include particle implicit and EXPLICIT source terms in VOF momentum equation | ali_atrian | OpenFOAM Programming & Development | 2 | January 12, 2016 05:01 |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 07:27 |
Question on the discretization of momentum equation in icoFoam | MPJ | OpenFOAM | 3 | October 4, 2011 10:44 |
Discretization of momentum equation query | siw | CFX | 0 | June 20, 2011 09:38 |