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

Question about the Porosity model using DarcyForchheimer Equation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Chaoran
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 12, 2020, 00:21
Default Question about the Porosity model using DarcyForchheimer Equation
  #1
New Member
 
Chaoran Guan
Join Date: Aug 2019
Posts: 5
Rep Power: 6
Chaoran is on a distinguished road
I'm confused about the implementation of the DarcyForchheimer equation in Openfoam. As I found in openfoam wiki https://openfoamwiki.net/index.php/DarcyForchheimer
the source term was like
S_m = - (\mu \bf{D}+\frac{1}{2}\rho tr(\bf{U}\cdot\bf{I})\bf{F})\bf{U}
or
\Delta p = -(\mu \bf{D}_i \bf{u}_i - \frac{1}{2} \bf{F}_i |u_{kk}|u_i)
But when I dig into the source code in DarcyForchheimer.H. I found something like
Code:
 forAll(cells, i)
         {
             const label celli = cells[i];
             const label j = this->fieldIndex(i);
             const tensor Cd =
                 mu[celli]*dZones[j] + (rho[celli]*mag(U[celli]))*fZones[j];
 
             const scalar isoCd = tr(Cd);
 
             Udiag[celli] += V[celli]*isoCd;
             Usource[celli] -= V[celli]*((Cd - I*isoCd) & U[celli]);
         }
where user defined values of D and f from the fvOptions dictionary are stored in the diagonal elements of the tensor \emph{dZones[j]} and 0.5*f in \emph{fZones[j]}.
I just can't understand the relations between the source code and the above equation. Why use the \emph{isoCd} trace of tensor \emph{Cd} and the term \emph{(Cd - I*isoCd)}.

And I want to implement a source term like
S_m = -(A + B*|\bf{u}|^{0.9})\bf{u}
Can anybody help? Thanks in advance.
vitto likes this.

Last edited by Chaoran; September 12, 2020 at 00:59. Reason: typing mistake
Chaoran is offline   Reply With Quote

Old   September 29, 2020, 06:33
Default
  #2
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 Chaoran, well this is not trivial out of the box but is related to numerical stabilization. What is the Darcy-Forchheimer actually? It is a source term in the momentum equation, right? So putting the source term directly to the source (RHS) does make the system more explicit and as you can see here, we extract some part from the source term to add it implicitly to the matrix (it is actually the trace part).

So what we see is that we do create the source Cd. Then we extract the implicit part and put that to the matrix. However, the explicit part does now have to be modified by removing the already added implicitly part which lead to the (Cd - I*isoCd) term.

However, sure, you can re-implement the following:
Code:
             const label celli = cells[i];
             const label j = this->fieldIndex(i);
             const tensor Cd =
                 mu[celli]*dZones[j] + (rho[celli]*mag(U[celli]))*fZones[j];
 
             Usource[celli] -= V[celli]*(Cd  & U[celli]);
but this is 100 % explicit and requires more outer corrections because the source is dependent on the velocity.

Thatīs it. Even without making the mathematicial proof. The explanation abvoe should be fine.
Origami likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   September 29, 2020, 20:17
Smile
  #3
New Member
 
Chaoran Guan
Join Date: Aug 2019
Posts: 5
Rep Power: 6
Chaoran is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Hi Chaoran, well this is not trivial out of the box but is related to numerical stabilization. What is the Darcy-Forchheimer actually? It is a source term in the momentum equation, right? So putting the source term directly to the source (RHS) does make the system more explicit and as you can see here, we extract some part from the source term to add it implicitly to the matrix (it is actually the trace part).


Hi, Tobias. Your explanations help me out. Really appreciate it.

Last edited by Chaoran; September 29, 2020 at 20:23. Reason: modified to reply
Chaoran is offline   Reply With Quote

Reply

Tags
darcy-forchheimer, fvoptions,momentum source, porosity model


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
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 16, 2020 23:44
Porosity and the energy equation shock77 OpenFOAM Running, Solving & CFD 11 May 9, 2020 15:52
[swak4Foam] swakExpression not writing to log alexfells OpenFOAM Community Contributions 3 March 16, 2020 18:19
Identification of the porous region in powerLawLopesdaCosta porosity model Tarak OpenFOAM 1 February 11, 2020 16:32
Two-Phase Buoyant Flow Issue Miguel Baritto CFX 4 August 31, 2006 12:02


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