CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [Publications] Darcy-Forchheimer Online Calculator (https://www.cfd-online.com/Forums/openfoam-community-contributions/222195-darcy-forchheimer-online-calculator.html)

Tobi November 14, 2019 18:01

Darcy-Forchheimer Online Calculator
 
Hi all,


I just want to inform you, that I implemented an Darcy-Forchheimer Calculator on my website. It is not yet finished and I have to check the results but the next days I will finish it. Nevertheless, the first indications seems to work fine.

https://holzmann-cfd.com/community/b...cy-forchheimer

MTomić July 24, 2022 06:17

Hello Tobias,

I checked out your calculator tool for the Darcy-Forchheimer coefficients. I am unable to obtain the Darcy contribution identical to your calculator, for a 1D case. I am trying to model a heat exchanger with a certain porosity. It would be nice to see how your tool calculates the Darcy contribution.

D_{\mathrm{Matej}} = 2.82 \cdot 10^{7}\ 1/\mathrm{m}^{2}
D_{\mathrm{Tobias}} = 2.56 \cdot 10^{-3}\ 1/\mathrm{m}^{2}


Regards,
Matej

Tobi August 2, 2022 07:56

Its still crap and buggy. I had not time to check everything in detail.

Matej = Matej Forman? So its my colleague. Do you have the calculation base from him? (community@holzmann-cfd.com).
Otherwise you can tell me the material-name and I can check it myself.

Thanks, Tobi

MTomić August 30, 2022 05:18

1 Attachment(s)
Hello Tobi,

Funny coincidence, although I must state that I am in no way, shape or form affiliated with Matej Forman. Inspired by your calculator tool, I made a similar one (only with the help of MATLAB). In order to compare the results with your calculator tool, please use the following info:

v_{1} = 0.471\ \mathrm{m/s},\  \Delta p_{1} = 6.16\ \mathrm{Pa}
v_{2} = 11.26\ \mathrm{m/s},\  \  \Delta p_{2} = 1007.04\ \mathrm{Pa}



When inserting aforementioned inputs into your calculator, the Darcy contribution output differs severely.

Tobi September 2, 2022 15:57

Hey. Nice and thanks for your feedback.

Using your darcy and forchheimer values by using the equation given on my website (first one right hand side: https://holzmann-cfd.com/community/b...cy-forchheimer), we end up with the graph attached:

  • Darcy Holzmann: 0.0013535060215094123
  • Forchheimer Holzmann: 171.6287292707513


  • Darcy Matej: 2.927e7
  • Forchheimer Matej: 258.2

dp = (D*U+F*U^2)*dx using dx = 0.073 m


http://holzmann-cfd.com/forum/DarcyCompare.png


So with your extreme linear contribution, its clear that you will get such an offset. However, my curve is not fitting too good either. Shame on me that I still have that buggy guy available.

MTomić September 3, 2022 09:12

Hello Tobi,

Thanks for taking time and looking into this topic.

The deviation of the Forchheimer contribution is self-explanatory, as your tool only takes into account two data points. Therefore, the curve fit is of lower fidelity.

However, I think that there is some underlying mystery about the Darcy contribution.

If we assume that the \Delta p = aU + bU^{2}, then the Darcy and Forchheimer contributions are determined in the following manner:

D = \frac{a}{\mu \Delta x}
F = \frac{2b}{\rho \Delta x}

Just by looking at the expression for the Darcy contribution, we can note that in the case of air (dynamic viscosity in the vicinity of 1.73e-5 Pa s) that the Darcy contribution should be a rather large number.

So to return to the actual point of my question, how does your tool determine the Darcy contribution?

Tobi September 3, 2022 14:22

The main problem in the whole calculation is that I need (or we need) to avoid negative numbers as they are treated differently by OpenFOAM (a negative number means blockage).

I second your statement and if you only take the Darcy-Calculation into account (in my tool), you will get D to be around 119246891. Hence, a very large number as you have.

My tool is doing some magic :)
No, its simply some derivation - need to recheck but its in the javascript that you can checkout manually if you go through my source-code of the website (view-source:https://holzmann-cfd.com/modules/mod...Forchheimer.js)

Code:


                /* OLD
                var f =
                    parseFloat(dp1)/parseFloat(dx)
                  /(
                      (
                          (
                              parseFloat(dp1)*parseFloat(u2)*parseFloat(u2)
                            -parseFloat(dp2)*parseFloat(u1)*parseFloat(u1)
                          )
                          /
                          (
                            parseFloat(dp2)*parseFloat(u1)
                          -parseFloat(dp1)*parseFloat(u2)
                          )
                      )*u1+parseFloat(u1)
                  );

                var r =
                    (
                        parseFloat(dp2)/parseFloat(dx)
                      -parseFloat(f)*parseFloat(u2)*parseFloat(u2)
                    )/parseFloat(u2);
                */

                var f =
                    (
                        parseFloat(dp2)*parseFloat(u1)*parseFloat(dx)
                      - parseFloat(dp1)*parseFloat(u2)*parseFloat(dx)
                    )
                    /
                    (
                        (-1 * parseFloat(u1)*parseFloat(dx)*parseFloat(u2)*parseFloat(dx))
                      + (parseFloat(u2)*parseFloat(u2)*parseFloat(dx)*parseFloat(dx)*parseFloat(u1))
                    );

                var r =
                    (
                        parseFloat(dp1) - parseFloat(f)*parseFloat(u1)*parseFloat(dx)
                    )
                    /
                    (
                        parseFloat(u1)*parseFloat(dx)
                    );

                // 10 % more than the given datapoint
                var largerU = 0;
                var largerdp = 0;

                if (parseFloat(dp1) > parseFloat(dp2)) { largerdp = dp1 } else { largerdp = dp2; }
                if (parseFloat(u1) > parseFloat(u2)) { largerU = u1 } else { largerU = u2; }

                xGiven = largerU;
                yGiven = largerdp;

                console.log("xGiven = " + xGiven);
                console.log("yGiven = " + yGiven);

                xTotal = xGiven * 1.1;
                deltax = xTotal / 20;

                var i;
                for (i = 0; i < 50; i++)
                {
                    xValue.push(i*deltax);
                    yValue.push(r*i*deltax*dx+f*(i*deltax)*(i*deltax)*dx);
                }
            }

I wanted to introduce some square-root calculation (while giving the opportunity to have a lot of measurement data available and built the best fit here). However, doing so lead to negative values for the linear contribution (D) which is not supported by FOAM at the moment. I had some discussions about that behavior with my colleague Kutalmis and he would also agree. Nevertheless, having only the Darcy contribution, a negative value does not make sense at all.

MKdoubleB May 11, 2023 05:58

Quote:

Originally Posted by Tobi (Post 835218)

My tool is doing some magic :)
No, its simply some derivation - need to recheck but its in the javascript that you can checkout manually if you go through my source-code of the website (view-source:https://holzmann-cfd.com/modules/mod...Forchheimer.js)


Hey Tobi,


first of all, thanks for making your contributions and the tool available to us all!
I just checked out the source code, since i was confused comparing the online calculators small result for the darcy contribution with the very large value i came up with in my own calculations. In Line 397 of the code the coefficients are calculated as:

D.value = r*mu.value;
F.value = 2*f/rho.value;


Isn't there a little mistake here? r gets multiplied by mu, yet per definition the Darcy coefficient is:
D = r/mu
as Matej stated above. F seems correct to me. Or is this the "magic" you speak of? Im not very experienced with Porous zones in OpenFOAM so please let me know if i am missing anything!


Best regards,


Markus

Tobi May 11, 2023 11:59

Hey Markus,


you are excellent. I love people who are investigating into the code and know how to get to the simple javascript. (EDIT: I saw that I posted the link :) - but anyway - nice that you checked it).


I agree - as it is already postulated on my website - D = r / mu.

In the code I have D = r * mu for the Darcy-Forchheimer calculation. We also see that the pure Darcy calculation is correct hence, for any reason, I made a mistake here.

Thanks for your hint and investigation. Code is already corrected.
Tobi

MKdoubleB May 11, 2023 16:38

Stuff like this happens to me all the time - youre a legend for already having the corrected one up and running.



Good yard,


Markus

Tobi May 12, 2023 15:55

Do your results look better now?

MKdoubleB May 24, 2023 11:24

Hey,


scusi for the late reply. Up to that point i hadnt even set up my porous model. However, initial tests with the coefficients seem to produce results which are in the expected ball park. At a later time, i will need to check against some velocity measurements of the prototype to see how far we are off.


Cheers


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