--> FOAM FATAL IO ERROR: (openfoam-2012) Cannot find patchField entry for testCube
I am trying to simulate a river flow so i'm using snappyhexmesh and blockMesh.
When running "interFoam" to start the simulation it gives me the error in the title followed by this: "file: /river/0/U.boundaryField at line 25." Here is my U file /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField uniform (1 0 0); boundaryField { inlet { type flowRateInletVelocity; //line 25 volumetricFlowRate constant 350; } walls { type noSlip; } atmosphere { type pressureInletOutletVelocity; value uniform (0 0 0); } outlet { type inletOutlet; inletValue uniform (0 0 0); value $internalField; } } // ************************************************** *********************** // On another test where I didn't use snappyhexmesh so I only had the outer box it worked just fine but i need it to get the river simulation. If you know anything that can fix my problem please reply. |
Hello,
You mesh contains a patch named "testCube" and the solver complains there is no boundary condition defined for this patch. If you do expect to have a testCube patch, then you need to define a boundary condition for it for each variable in the 0 directory. If you don't expect to have a testCube patch, it means something is wrong with your mesh. You need to check it and fix it to get your expected mesh. Regards, Yann |
Thanks for the fast reply but how do I define the boundary condition?
You mean do this? cubeGroup { type slip; } |
Yes, and choose the appropriate condition for each variable.
(If necessary you can have a look to the user guide: https://www.openfoam.com/documentati...ary-conditions) Cheers, Yann |
Thank you for answering.
I did try a few but I don't seem to find the right one. Do you know what would be the best one for a river simulation? |
I cannot really answer that without knowing what you are trying to simulate. I don't know what is "testCube" and I don't know what conditions you tried. There are not enough information to help you.
Have a look at the interFoam tutorials and search for something close to what you want to simulate. Run it and see how it works, what boundary conditions are used, etc... Cheers, Yann |
Thanks for the help it seems to have solved the error using "fixed value" but now when I do run it, it works for awhile but then stops the simulation without giving any errors do you now what could be happening?
|
Unfortunately no I cannot really help without having more information about your case. (at least the log file of the simulation)
(you can have a look there: https://www.cfd-online.com/Forums/op...-get-help.html) Regards, Yann |
5 Attachment(s)
Ok I'm sorry for not providing all the information needed previously.
I've attached the checkMesh and the interFoam logs and both fvSchemes and fvSolution plus the blockMeshDict file. Additional info, the object for the snappyHexMesh is just a 5x5x4 cube to be replaced with the 3D terrain model of the river once I can do it with the cube. |
Nothing bad in the files you've posted, but the solver stops before starting time loop so probably there is an error somewhere in your case setup.
It's a bit weird you don't get any error though. What command do you use to start the solver, and how do you create your log file? |
I start solver using: mpirun interFoam (I also tried with just interFoam and it also didn't give any errors)
And I got the log file using: interFoam > interFoam.log |
OK then try running this instead:
Code:
interFoam > interFoam.log 2>&1 (Have a look there for more information about that: https://www.cyberciti.biz/faq/redire...err-to-stdout/) |
1 Attachment(s)
The attached file is the result of the command u sent.
There don't seem to be any differences. |
Well, at this point I cannot really help.
The solver stops during initialization, it doesn't even get to start time loop. The next step should be to read the g file to set gravity. Do you have a properly defined g file in constant? Also, can you post your whole case setup? |
Thank you for your help but I've been on holidays and I'll only be able to send the files next week.
|
The ZIP file was too large so I put it on a google drive and here is the link.
https://drive.google.com/drive/folde...usp=share_link |
Hello,
I don't know why you don't get an error message when running the solver. Here is the error message I get when running your case: Code:
RAS The message leads to the kOmegaSST model and something wrong with the correctNut function. Having a look at your boundary conditions, I see you set a fixedValue 0 on the testCubeGroup patch for nut, k and omega. This might be the source of the issue. Setting omega to a small value rather than 0 solves the issue. (I tried with 1e-6 and the solver starts properly. Didn't check the results though, but this is another story) Cheers! Yann |
Thanks for all the help it already works with the cube.
When I change the model to the terrain (a simplified version of the final) it starts the simulation but after one second the courant number is already at 1e-7 which also decreases the deltaT, do you know how to fix this? |
You have to check what is going on in your case. The deltaT drops to respect the max Courant number defined in your controlDict:
Code:
adjustTimeStep yes; To help diagnose your case you can save timeStep and investigate the results in paraView, or use some function objects to monitor your case. For instance the fieldMinMax function object is handy to monitor maximum velocity values (or min/max value of other variables of interest): https://develop.openfoam.com/Develop.../fieldMinMax.H Yann |
I've tried changing the value in meshQualityDict but it doesn't seem to work.
And how do I use the fieldMinMax function? |
All times are GMT -4. The time now is 22:28. |