|
[Sponsors] |
Question about the Porosity model using DarcyForchheimer Equation |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 12, 2020, 00:21 |
Question about the Porosity model using DarcyForchheimer Equation
|
#1 |
New Member
Chaoran Guan
Join Date: Aug 2019
Posts: 5
Rep Power: 6 |
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 or 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]); } I just can't understand the relations between the source code and the above equation. Why use the trace of tensor and the term . And I want to implement a source term like Can anybody help? Thanks in advance. Last edited by Chaoran; September 12, 2020 at 00:59. Reason: typing mistake |
|
September 29, 2020, 06:33 |
|
#2 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
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]); Thatīs it. Even without making the mathematicial proof. The explanation abvoe should be fine.
__________________
Keep foaming, Tobias Holzmann |
|
September 29, 2020, 20:17 |
|
#3 | |
New Member
Chaoran Guan
Join Date: Aug 2019
Posts: 5
Rep Power: 6 |
Quote:
Hi, Tobias. Your explanations help me out. Really appreciate it. Last edited by Chaoran; September 29, 2020 at 20:23. Reason: modified to reply |
||
Tags |
darcy-forchheimer, fvoptions,momentum source, porosity model |
|
|
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 |