CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Structure of momentum equation in mhdFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 5, 2020, 12:09
Default Structure of momentum equation in mhdFoam
  #1
New Member
 
Edmund Teller
Join Date: Feb 2020
Posts: 12
Rep Power: 6
edmund32 is on a distinguished road
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
edmund32 is offline   Reply With Quote

Old   March 5, 2020, 12:26
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,770
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
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.
FMDenaro is online now   Reply With Quote

Old   March 5, 2020, 12:35
Default
  #3
New Member
 
Edmund Teller
Join Date: Feb 2020
Posts: 12
Rep Power: 6
edmund32 is on a distinguished road
Oh sorry! I thought I had posted in the Openfoam forum, I guess I forgot to check. Is it worth re-posting?
edmund32 is offline   Reply With Quote

Old   March 5, 2020, 12:54
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,675
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
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.
LuckyTran is offline   Reply With Quote

Old   March 5, 2020, 13:08
Default
  #5
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,770
Rep Power: 71
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by LuckyTran View Post
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.





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...
FMDenaro is online now   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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 21:43
How to Include particle implicit and EXPLICIT source terms in VOF momentum equation ali_atrian OpenFOAM Programming & Development 2 January 12, 2016 04:01
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Question on the discretization of momentum equation in icoFoam MPJ OpenFOAM 3 October 4, 2011 09:44
Discretization of momentum equation query siw CFX 0 June 20, 2011 08:38


All times are GMT -4. The time now is 16:05.