CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

--> FOAM FATAL IO ERROR: (openfoam-2012) Cannot find patchField entry for testCube

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2023, 07:38
Default --> FOAM FATAL IO ERROR: (openfoam-2012) Cannot find patchField entry for testCube
  #1
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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.
DCanas is offline   Reply With Quote

Old   July 7, 2023, 07:56
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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
Yann is offline   Reply With Quote

Old   July 7, 2023, 08:14
Default
  #3
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
Thanks for the fast reply but how do I define the boundary condition?
You mean do this?
cubeGroup
{
type slip;
}
DCanas is offline   Reply With Quote

Old   July 7, 2023, 09:08
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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
Yann is offline   Reply With Quote

Old   July 7, 2023, 10:37
Default
  #5
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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?
DCanas is offline   Reply With Quote

Old   July 7, 2023, 11:02
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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
Yann is offline   Reply With Quote

Old   July 7, 2023, 11:05
Default
  #7
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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?
DCanas is offline   Reply With Quote

Old   July 7, 2023, 12:22
Default
  #8
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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: How to give enough info to get help)

Regards,
Yann
Yann is offline   Reply With Quote

Old   July 7, 2023, 13:47
Default
  #9
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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.
Attached Files
File Type: txt checkMesh.txt (3.4 KB, 1 views)
File Type: txt interFoam.txt (2.1 KB, 3 views)
File Type: txt fvSchemes.txt (1.3 KB, 1 views)
File Type: txt fvSolution.txt (2.1 KB, 1 views)
File Type: txt blockMeshDict.txt (1.5 KB, 1 views)
DCanas is offline   Reply With Quote

Old   July 8, 2023, 06:51
Default
  #10
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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?
Yann is offline   Reply With Quote

Old   July 10, 2023, 04:47
Default
  #11
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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
DCanas is offline   Reply With Quote

Old   July 10, 2023, 08:28
Default
  #12
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
OK then try running this instead:
Code:
interFoam > interFoam.log 2>&1
Your original command redirects the standard output to your log file, but not the standard error, so errors won't show up in your log file.
(Have a look there for more information about that: https://www.cyberciti.biz/faq/redire...err-to-stdout/)
Yann is offline   Reply With Quote

Old   July 10, 2023, 10:27
Default
  #13
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
The attached file is the result of the command u sent.
There don't seem to be any differences.
Attached Files
File Type: txt interFoam.txt (2.1 KB, 3 views)
DCanas is offline   Reply With Quote

Old   July 11, 2023, 15:25
Default
  #14
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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?
Yann is offline   Reply With Quote

Old   July 19, 2023, 11:13
Default
  #15
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
Thank you for your help but I've been on holidays and I'll only be able to send the files next week.
DCanas is offline   Reply With Quote

Old   July 24, 2023, 04:50
Default
  #16
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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
DCanas is offline   Reply With Quote

Old   July 24, 2023, 05:21
Default
  #17
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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
{
    RASModel        kOmegaSST;
    turbulence      on;
    printCoeffs     on;
    alphaK1         0.85;
    alphaK2         1;
    alphaOmega1     0.5;
    alphaOmega2     0.856;
    gamma1          0.555556;
    gamma2          0.44;
    beta1           0.075;
    beta2           0.0828;
    betaStar        0.09;
    a1              0.31;
    b1              1;
    c1              10;
    F3              false;
    decayControl    false;
    kInf            0;
    omegaInf        0;
}

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::sigFpe::sigHandler(int) at ??:?
#2  ? in /lib/x86_64-linux-gnu/libpthread.so.0
#3  Foam::divide(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4  void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#5  Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&, Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > const&) at ??:?
#6  Foam::kOmegaSSTBase<Foam::eddyViscosity<Foam::RASModel<Foam::IncompressibleTurbulenceModel<Foam::transportModel> > > >::F2() const at ??:?
#7  Foam::kOmegaSSTBase<Foam::eddyViscosity<Foam::RASModel<Foam::IncompressibleTurbulenceModel<Foam::transportModel> > > >::F23() const at ??:?
#8  Foam::kOmegaSSTBase<Foam::eddyViscosity<Foam::RASModel<Foam::IncompressibleTurbulenceModel<Foam::transportModel> > > >::correctNut(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9  Foam::RASModels::kOmegaSST<Foam::IncompressibleTurbulenceModel<Foam::transportModel> >::correctNut() at ??:?
#10  ? at ??:?
#11  ? at ??:?
#12  __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
#13  ? at ??:?
This indicates there is some math going wrong (often related to dividing by 0) somewhere.
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
Yann is offline   Reply With Quote

Old   July 24, 2023, 06:41
Default
  #18
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
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?
DCanas is offline   Reply With Quote

Old   July 24, 2023, 07:06
Default
  #19
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,207
Rep Power: 28
Yann will become famous soon enough
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;

maxCo           60;
maxAlphaCo      60;
maxDeltaT       1;
This is most likely due to high velocity in a relatively small cell. It can be physical if the order of magnitude of the velocity is reasonable for the case you are simulating. Or it can be a numerical error with an unrealistic velocity being computed somewhere due to... something! (like bad quality cell(s))

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
Yann is offline   Reply With Quote

Old   July 24, 2023, 07:36
Default
  #20
New Member
 
Canas
Join Date: Jul 2023
Posts: 11
Rep Power: 3
DCanas is on a distinguished road
I've tried changing the value in meshQualityDict but it doesn't seem to work.
And how do I use the fieldMinMax function?

Last edited by DCanas; July 24, 2023 at 13:28.
DCanas is offline   Reply With Quote

Reply

Tags
boundary field, snappyhesmesh


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"FOAM FATAL IO ERROR: Cannot find patchField entry for NACA6409_patch24311" Pavlidis Chariton OpenFOAM Running, Solving & CFD 0 October 7, 2019 05:57
InterDyMFoam+simpleFunctionObject Elham OpenFOAM Running, Solving & CFD 5 July 10, 2017 12:59
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 10:56
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug unoder OpenFOAM Installation 11 January 30, 2008 21:30
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 09:19


All times are GMT -4. The time now is 01:42.