getting a annoying error when simulating flow over porous media
Dear all,
Recently I've started the ultimate fight against my serenity: Try to simulate transient flow over porous media on OpenFOAM. When running porousInterFoam in version 2.3.0 i've reached the following error message: Code:
--> FOAM FATAL ERROR: Please, help me! Thank all of you in advance, and apologize me for the long post. |
Hello Hanniel.
I obtain exactly the same error with the porousInterFoam solver. I tested several other OpenFOAM version (v.2.2.1, v.2.2.2) but the error persists. What do you use o generate your porous medium? A "porousProperties" file in the "constant" folder or "fvOptions" file in the "system" folder? The error that we get is that the "thermo:mu" volScalarField is not declared in the 0 folder, but this variable is a part of thermo class and I don't understant why the porousInterFoam solver needed! I hope someone other than us will read this post and can help us... ;) Kind regards, Florent |
Hi,
As the error occurs in explicitPorositySource, you can take a look at its constructor: Code:
Foam::fv::explicitPorositySource::explicitPorositySource I guess your source is described like Code:
explicitPorositySourceCoeffs Code:
explicitPorositySourceCoeffs |
Hi Alexei. It works!!! Thank you very mutch, you are the Boss!! ^^
|
Hi all,
I've got the same error, but unfortuately, I can’t get rid of it by following the advice of alexeym. I tried to attach the complete input files. What I want to do is a two-phase transient simulation of a flow though a porous zone. Basically a simulation of the RTM process (http://compositeswiki.org/what-is-rt...sfer-moulding/) I think the porousInterFoam solver is the best choice in order to do so (?) As there is no tutorial available, I used the damBreak tutorial and added a porous zone on top of the obstacle. I'd like it to look similar to this: http://www.youtube.com/watch?v=DcDB5mO4CF8 I copied the porosity data from the angledDuctimplicit tutorial. (You may notice at this point: I’m a complete rookie to openFoam, cfd, and C++) Additionally to alexeym’s advice, I added different versions of the statement “thermo:mu mu”, “muName mu” and so on to different positions in the input files. Without any success. The terminal message I get is this: Code:
|
Hi,
as your porosity is actually porosityModel class and not fvOption, you need to look at src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C: Code:
Foam::porosityModels::DarcyForchheimer::DarcyForchheimer And so, you need to add to this dictionary Code:
mu mu; And if we return to the files of angledDuctImplicit tutorial case, your porosityProperties should be something like: Code:
porosity1 |
IT WORKS !!! GREAT !!! :D
Thank you very much for the quick and helpful anser. Merci beaucoup. Kind regards, cordialement, Peter |
Hey guys,
I'm almost giving up. Using OpenFOAM v.2.3, my simulations with the solver interFoam seems to ignore the porous medium. There's no resistance exerted due to the porous medium, however I've declared everything as alexeym suggested, and even could get rid of the "termo::mu" error. The solvers seems to recognize the fvOptions declaration of a porous medium, however no observable effect on the velocity/pressure profile is observed... Using porousInterFoam the solver seems to recognize the porous media, and the results in U/p shows some evidence of resistance due to the porous media. However, my results are very wrong concerning the mold filling time. Someone experimented similar issue? Using OpenFOAM v.2.1.1 the filling time seems ok, however I need to use the newer version. Thanks in advance, Freitas |
Hi,
it's quite obvious but you need to be more specific. How do you add porosity source (i.e. show your dictionaries)? If you attach your case files it'll be even easier. The only difference between interFoam and porousIterFoam (except creation of porosity zones) is addition of two lines in UEqn.H file: Code:
pZones.addResistance(UEqn); As you compare with 2.1.1 (where fvOption mechanism was not added yet), I guess you're setting up porosity with porosityProperties file, and it's not surprising that interFoam ignores it. |
1 Attachment(s)
Thanks for the quick reply alexeym,
Here are the fies. I'm sending the whole case folder in a zip file. Using the interFoam solver, the deltaT becomes very small (<1E-6) but before 1s of simulated time, the mold is already filled. Using porousInterFoam the deltaT is ok, but there's some error in the mold filling time. According to the literature, the filling time for the simulated RTM process is 180s. Using porousInterFoam from v.2.1.1 shows accurate results. Version 2.2.2 shows some divergence (less than 5%) but version 2.3 shows about 30% of error. CORRECTION: The version 2.2.2 shows the same divergence of the version 2.3, about 30% of error. I'm also publishing my porousProperties and fvOptions dictionaries as follows. I would like also to ask you about the coordinateSystem subDict. I've searched all aroud but could not understand its function. Here is the fvOptions dict: Code:
porosity1 Code:
Thanks in advance for the attention. Freitas |
1 Attachment(s)
Hi,
1. Well, it seems that interFoam is really incapable to use fvOptions to add porosity into simulation domain. So the rest will be about porousInterFoam. The reason for very small time step with interFoam is very high velocity inside the domain (as there's no porosity). 2. One of the most common reasons for error in simulations is not fully converged solution. So I've modified your fvSolution to use residualControl instead of fixed number of outer iterations, now it looks like this: Code:
PIMPLE 3. About coordinateSystem. I guess this functionality is necessary if you have porous block rotated relative to simulation domain. If you look at DarcyForchheimer.C file, you'll find this piece of code there: Code:
... I've attached case files with modifications I've made to the message. |
Alexeym,
man, you are awesome. However, no change in the results, they keep diverging a lot from the theoretical predictions. Even imposing a tolerance of 1e-8 in the residual control, there are no change in the results :mad: The mold should be completely filled in 180 s (alpha = 1 - the resin - in whole domain). What I can't understand is that in the version 2.1.1 of the OpenFOAM the solver produces accurate results, with no modifications required. You don't have even to turn on the momentum predictor :( I don't know what to do anymore. |
Hi,
I've just run the case I've posted in the previous message with 2.3.0, and domain is completely filled with resin at t=180 s (well, maybe except the cell near outlet where value of alpha is 0.458). And if I switch off momentumPredictor simulation runs even faster (2 outer corrector iterations), value of alpha in the cell near outlet is 0.533). Also I've compared implementations of porousInterFoam/porousZone in 2.1.1 and 2.3.0. Wasn't able to find any difference in physical sense (surely names of classes are different, certain implementation details are different, but equations are the same). |
Alexey, many thanks for all your effort to ellucidate this problem.
Even with the changes proposed by you, the simulation still diverging. After many hours comparing my simulation (already corrected) to yours, still no clue about the error. I've copied all definitions (fvSolution, fvSchemes, etc) to my case, but nothing seems to fix the error. After a whole day pursuing the error, I've stumbled with the cause of the strange divergence: I let a fvOptions file inside the system/ folder of the simulation. I guess that reading that file, the solver failed to create properly the momentum resistance due to the porous media. It's always the simplest thing that fool our eyes, doesn't? :rolleyes: Anyways, I thought it may be important to be shared with the forum. Thanks again. |
Dear All,
Sorry to ressurect the thread. I would like to thank you for your attention. With your help, I've managed to simulate the mold filling case (initially filled with air, later resin is injected and makes the air goes out). However, by now I need to simulate an additional particle phase, so I've change to the multiphaseEulerFoam solver ( the particle drag is important, so I cannot use the single fluid approach). The problem is that I set the mold (to help to imagine the problem, lets approximate the mold to a pipe section) filled with air (alpha.air = 1). As no air enters trough the left open section, I've set the velocity of the air phase (U.air) to zeroGradient. How can I set the proper boundary conditions (for alpha and U) for the exit so the air can exit trough the right open section as the resin and particle are injected in the left? My previous uploaded case has the proper configuration to ensure that air exits the domain as expected. But it was configured to porousInterFoam. When I try to change to multiphaseEulerFoam using the same strategy (defined pressure on the inlet, zero pressure in the inlet, velocity defined tru the pression in the inlet, zeroGradient velocity in the outlet) the air don't exit the domain. Anybody has any clue about the problem? Many thanks! |
Quote:
|
Quote:
|
Quote:
As you mentioned above, porousInterFoam doesn't honor the porosity value mentioned in the porosityProperties Dict. I have also checked in the src folder that there is no member function that reads the porosity. I have also checked test case attached by you above by modifying the "porosity" value in porosityProperties. It is does change the results. Do you have any idea/hint how to modify the solver to take the porosity input. |
Hi Santhosh,
of course, porousInterFoam reads the porosity values you specify in the porousityProperties document in the constant-folder. The source code file of the porousInterFoam solver includes a file called “createPorousZones.H” (You can find it in …/applications/solvers/multiphase/interFoam/porousInterFoam) Furthermore, if you take a look at some of the videos of simulations created with this solver, you will find that it is working pretty well: http://www.youtube.com/results?search_query=porousInterFoam interFoam obviously doesn’t take any porosity into account. Otherwise, the porousInterFoam solver would be redundant. Which version of openFoam do you use? Maybe your changes in porosity values were not huge enough. Best Regards, Peter |
Hi Peter,
I use OpenFOAM 2.3.0. I know that interFOAM does not need porousity values. I meant that basic porous media treatment is missing the functionality to read the porosity values. In the previous version, porosity we supply is used in calculating the temporal derivative of momentum equation. (gamma). you may look at http://www.cfd-online.com/Forums/ope...-porosity.html for more understanding. I could not find any video showing difference the results with different porosity values. You may look at for yourself by downloading the test case attached above and change the value of porosity in constant/porosityProperties. (I have compared the log files with porosity of 0.4 and 0.7) Hope I am little more clear now. Regards, Santhosh |
All times are GMT -4. The time now is 02:01. |