# Question about the Porosity model using DarcyForchheimer Equation

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 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]); } where user defined values of D and f from the fvOptions dictionary are stored in the diagonal elements of the tensor and 0.5*f in . 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. vitto likes this. 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]); 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

September 29, 2020, 20:17
#3
New Member

Chaoran Guan
Join Date: Aug 2019
Posts: 5
Rep Power: 6
Quote:
 Originally Posted by 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).

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

Last edited by Chaoran; September 29, 2020 at 20:23. Reason: modified to reply

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post CFXer CFX 4 July 16, 2020 23:44 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 Tarak OpenFOAM 1 February 11, 2020 16:32 Miguel Baritto CFX 4 August 31, 2006 12:02

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

 Contact Us - CFD Online - Privacy Statement - Top