CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

meaning of HbyA

Register Blogs Community New Posts Updated Threads Search

Like Tree37Likes
  • 1 Post By Tobi
  • 31 Post By Cyp
  • 4 Post By Cyp
  • 1 Post By ooo

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 6, 2013, 14:14
Default meaning of HbyA
  #1
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

I am not clear about the variable HbyA
Code:
volVectorField HbyA("HbyA", U);
HbyA = rAU*UEqn().H();
Can someone tell me what that variable is for?

In the 1.6-ext version I found the same declaration:
Code:
U = rUA*UEqn().h();
So I think its the same, but why the different names?

Thanks in advance
Tobi
nepomnyi likes this.
Tobi is offline   Reply With Quote

Old   June 6, 2013, 16:07
Default
  #2
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
Dear Toby,

As you noticed, both lines are similiar. Actually, the notation HbyA has been spread over all the solvers since the latest OF version (OF 2.2.0) for a sake of clarity.

Keep in mind that for the computation of Naviers-Stokes equation, OF uses either PISO or SIMPLE algorithms. The semi-discretized form of the momentum is :

a_{P} \textbf{U}_{P} = \textbf{H}(\textbf{U}) - \nabla p

where a_{P} is the diagonal coefficients of the matrix resulting from the discretization of the momentum equation. \textbf{H}(\textbf{U}) stands for the non-diagonal coefficient (mainly composed by convective and diffusive terms) and the source terms (the source part of the transient term and other source that appear in UEqn) apart from the pressure gradient.

Once this equation has been implicitly solved (the momentum predictor step), the predicted velocity does not satisfy the continuity equation. Moreover, in the previous equation, the pressure field result from the previous time step. Therefore, we are looking for (U,p) that obeys

\textbf{U}_{P} = \frac{\textbf{H}(\textbf{U})}{a_{P} } - \frac{1}{a_{P} } \nabla p
and
\nabla \cdot \textbf{U}_{P} = 0

Assembling this two equations, you can form the pressure equation:
\nabla \cdot \left( \frac{1}{a_{P}}\nabla p \right) = \nabla \cdot \left(\frac{\textbf{H}(\textbf{U})}{a_{P} }   \right)

and then you reconstruct the velocity with:
\textbf{U}_{P} = \frac{\textbf{H}(\textbf{U})}{a_{P} } - \frac{1}{a_{P} } \nabla p

You clearly remark in this procedure that you use H divided by A or.. HbyA ;-)


PS: in OF, rAU is the notation for the diagonal coeff of the matrix

Best regards,
Cyp
Tushar@cfd, Tobi, armyou and 28 others like this.
Cyp is offline   Reply With Quote

Old   June 6, 2013, 16:23
Default
  #3
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
I made slides some times ago to explain the PISO loops in OpenFOAM : http://fr.scribd.com/doc/143414962/P...on-in-OpenFOAM

They are in French but understandable. It uses old OpenFOAM version, that means without the HbyA notation.
Cyp is offline   Reply With Quote

Old   July 5, 2013, 02:45
Default
  #4
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
Quote:
Originally Posted by Cyp View Post

Assembling this two equations, you can form the pressure equation:
\nabla \cdot \left( \frac{1}{a_{P}}\nabla p \right) = \nabla \cdot \left(\frac{\textbf{H}(\textbf{U})}{a_{P} }   \right)

Best regards,
Cyp
Hi, about this, why it is not
Code:
fvScalarMatrix pEqn
                (
                    fvm::laplacian(rAU, p) == fvc::div(rAU&HbyA)
                );
Thanks in advance.
sharonyue is offline   Reply With Quote

Old   July 5, 2013, 06:24
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi all,

as I understand from Cyp 's comment:

\frac{\bf{H}(U)}{a_P} = \text{HbyA}

So your last line should be:

Code:
fvScalarMatrix pEqn
                (
                    xxx == fvc::div(HbyA)
                );
I am not able to have a look into the code at the moment.

Last edited by Tobi; July 6, 2013 at 05:41.
Tobi is offline   Reply With Quote

Old   November 15, 2013, 15:30
Default
  #6
Cyp
Senior Member
 
Cyprien
Join Date: Feb 2010
Location: Stanford University
Posts: 299
Rep Power: 18
Cyp is on a distinguished road
the same doc, in English with OF2.2

http://www.scribd.com/doc/181588911/...ion-of-icoFoam
dokeun, Tobi, pixarzhang and 1 others like this.
Cyp is offline   Reply With Quote

Old   December 24, 2013, 02:41
Default thx
  #7
New Member
 
enzhen zhang
Join Date: Dec 2013
Location: Shanghai,China
Posts: 10
Rep Power: 12
pixarzhang is on a distinguished road
Quote:
Originally Posted by Cyp View Post
the same doc, in English with OF2.2

http://www.scribd.com/doc/181588911/...ion-of-icoFoam
it's very clear for me
pixarzhang is offline   Reply With Quote

Old   March 14, 2014, 15:26
Default
  #8
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 14
ooo is on a distinguished road
Dear Guys,

I'm using the 3step runge-kutta scheme to solve Navier Stokes equation.
There are some differences in the equations must be solved, but the main equations are same.you can see the equations in the attachment(those equations are put in a for loop, from k=1 to k=3)
Also, below you can see my summarized code to solve that, but i don't know how to use coefficients(same as piso loop of icoFoam) !
I would appreciate any idea on how to change my code to something like the piso loop of icoFoam :

Code:
while (runTime.loop())
{
for (int i = 1 ;  i<=3 ; ++i)
{
U = U + runTime.deltaT() *
        (
         + 2*alpha*fvc::laplacian(nu,U)
         - 2*alpha*fvc::grad(p)
         - gamma*fvc::div(phi, U)
         - zeta*fvc::div(phiOld2, UOld2)
        );

      solve(alpha*runTime.deltaT()*fvm::laplacian(nu,Unew) - fvm::Sp(1.,Unew)  == //(alpha*runTime.deltaT())  ==
      (-1.)*(U) + alpha*runTime.deltaT()*fvc::laplacian(nu,U) );

      solve (fvm::laplacian(pPhi) == fvc::div(U)/(2.*alpha*runTime.deltaT()));// pPhi is a pseudo pressure without physical meaning

      U =  Unew - (2.*alpha*runTime.deltaT()*fvc::grad(pPhi));
      p += pPhi - alpha*runTime.deltaT()*nu*(fvc::laplacian(pPhi));

      adjustPhi(phi, U, p);
      U.correctBoundaryConditions();
}
} //alpha,gamma and zeta change in each of those 3 steps
Attached Images
File Type: png RungeKutta3step.png (9.0 KB, 147 views)
hua1015 likes this.
ooo is offline   Reply With Quote

Old   March 27, 2016, 06:17
Default
  #9
Senior Member
 
Saideep
Join Date: Apr 2015
Location: INDIA
Posts: 203
Rep Power: 12
Saideep is on a distinguished road
Thanks guys for sharing this information!!

I am just going through the implementation of PISO/ PIMPLE in interFoam solver. I could understand and link most part of what is discussed here but confused at parts.
Hope you can help me out!!

Starting with UEqn.H:
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U)
==
fvOptions(rho, U)
);
Over here we already have a solution for velocity without influence of pressure.{solving NSE excluding variables of pressure and body forces that dont have an explicit U term}. We extract the diagonal{UEqn.A()} and off- diagonal portions {UEqn.H()}.

Now passing to pEqn.H:
We find and link velocity to flux over cell faces.(U -> phi)
Additionally due to surface tension force induced flux, we add flux to the above calculated flux. {Even here pressure isnt included till now}.

Now the pressure corection is directly applied as follows:
fvm::laplacian(rAUf, p_rgh) == fvc::div(phiHbyA)
/*we are finding for p_rgh*/

From this further correction to flux and U from the found out pressure is calculated to get the conservative velocity.

My question,
1. In all explanations I have had browsed through, they explicitly mention usage of pressure twice. One as an approximate and one found as a real value.
But from interFoam solver I see only once the usage of pressure and it is the corrected pressure that we are solving for. {above equation, laplacian pressure}

2. What are nOuterCorrectors, nCorrectors variablels? I see their default definitions but where are we specifying the loop? I guess it has something to do with pimple.correct() loop but how are the variables being used?

Thanks and interested to hear your views,
Saideep
Saideep is offline   Reply With Quote

Old   March 27, 2016, 18:24
Default
  #10
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
For nouter and ncorr See my blog
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   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
Meaning of Ychar and Ypmma aylalisa OpenFOAM Pre-Processing 2 October 20, 2013 05:49
what is the meaning of this?!??!!? adambarfi OpenFOAM Running, Solving & CFD 9 September 13, 2013 10:53
What's meaning of UDF FUNCTION zhaoxinyu Fluent UDF and Scheme Programming 0 March 31, 2010 08:04
want to know meaning Sangamesh Siemens 0 May 15, 2007 05:15
What's the meaning of "combustion scalar"and.... cfdbeginner CFX 0 November 27, 2003 09:02


All times are GMT -4. The time now is 08:13.