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

Error when executing simpleFoam - FOAM FATAL ERROR:(openfoam-2206) cannot find file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2022, 12:18
Default Error when executing simpleFoam - FOAM FATAL ERROR:(openfoam-2206) cannot find file
  #1
New Member
 
astri anindya
Join Date: Nov 2022
Posts: 3
Rep Power: 3
astri is on a distinguished road
Hi all,

I am running a case of natural ventilation of a simple building (box) with open windows. I created it as an outdoor case inside the wind tunnel, write the case in Butterfly then trying to run it in openFoam. Everything is fine when I execute blockMesh and snappyHexMesh. However, when I execute simpleFoam I've got an error message:


--> FOAM FATAL ERROR: (openfoam-2206)
cannot find file "/mnt/c/Users/astri/butterfly/boxexplode_45/2/p"

From virtual Foam::autoPtr<Foam::ISstream> Foam::fileOperations::uncollatedFileOperation::rea dStream(Foam::regIOobject&, const Foam::fileName&, const Foam::word&, bool) const
in file global/fileOperations/uncollatedFileOperation/uncollatedFileOperation.C at line 540.

FOAM exiting

I am trying different setting, but It always goes the same way. Would anyone share a thought why this is happen? Any advice would be very much appreciated

Best regards,

Astri
astri is offline   Reply With Quote

Old   November 16, 2022, 03:32
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
Hello Astri,

You get this error because the solver does not find the files containing the boundary conditions for each variable (p, U, ...) as stated in the error message:

Code:
cannot find file "/mnt/c/Users/astri/butterfly/boxexplode_45/2/p"
Posting the whole log file would help to know exactly what is going on, but my best guess is that you ran snappyHexMesh without the -overwrite option and snappy created new timeStep folders (1, 2) to write the castellated and snapped mesh.

I'm quoting the documentation (https://www.openfoam.com/documentati...yhexmesh-usage)

Quote:
By default, each of snappyHexMesh's phases, i.e castellation, snapping and layer addition will write a complete mesh in time folders. This behaviour can be suppressed by using the option

snappyHexMesh `-overwrite`
To solve this issue you can use the overwrite option or manually move folders:
  • move the polyMesh folder from 2/constant to constant/
  • remove folders 1 and 2
  • run simpleFoam

Let us know if it solves the issue!

Regards,
Yann

Last edited by Yann; November 17, 2022 at 09:52. Reason: fixed link
Yann is offline   Reply With Quote

Old   November 16, 2022, 18:24
Default
  #3
New Member
 
astri anindya
Join Date: Nov 2022
Posts: 3
Rep Power: 3
astri is on a distinguished road
Hi Yann,

Thank you very much for your kind response.
I've already done it as per your suggestion (the snappyHexMesh -overwrite), but another error message appears.



--> FOAM FATAL IO ERROR: (openfoam-2206)
Missing or invalid PatchFunction1 entry: d


file: 0/U.boundaryField.inlet at line 81.

From static Foam::autoPtr<Foam::PatchFunction1<Type> > Foam::PatchFunction1<Type>::New(const Foam:olyPatch&, const Foam::word&, const Foam::entry*, const Foam::dictionary&, bool, bool) [with Type = double]
in file /usr/src/packages/BUILD/src/meshTools/lnInclude/PatchFunction1New.C at line 124.

FOAM exiting
------------------------------------------------------

I really want to upload the U file from folder 0 to the attachment, but I always failed. It says invalid file. I don't know If I did it wrong, I am new to this forum.

What is written in line 81 of the script U is
type atmBoundaryLayerInletVelocity;


and this is I copy also the whole script.

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1706+ |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
/* Butterfly 0.0.4 https://github.com/ladybug-tools/butterfly *\
\*---------------------------------------------------------------------------*/
FoamFile
{
version 4.0;
format ascii;
class volVectorField;
location "0";
object U;
}

dimensions [0 1 -1 0 0 0 0];

#include "initialConditions";

internalField uniform $flowVelocity;

boundaryField
{

right_side
{

type slip;

}

box
{

type fixedValue;

value uniform (0 0 0);

}

outlet
{

type inletOutlet;

inletValue uniform (0 0 0);

value $internalField;

}

left_side
{

type slip;

}

top
{

type slip;

}

ground
{

type fixedValue;

value uniform (0 0 0);

}

inlet
{

type atmBoundaryLayerInletVelocity;

#include "ABLConditions";

}

}





Do you know what happened, and could you advise me on what should I do?

Anyway, I can't open the documentation that you quoted in your reply. Is there any way for me to open it?

Thank you very much for your help.
Best regards,

Astri
Attached Images
File Type: jpg 0-u capture.jpg (30.9 KB, 14 views)
astri is offline   Reply With Quote

Old   November 17, 2022, 05:14
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
Hello,

It complains about your inlet boundary condition, more specifically about the d parameter.

Code:
--> FOAM FATAL IO ERROR: (openfoam-2206)
Missing or invalid PatchFunction1 entry: d


file: 0/U.boundaryField.inlet at line 81.
Your current condition:

Code:
inlet
{

type atmBoundaryLayerInletVelocity;

#include "ABLConditions";

}
You must have a file named ABLConditions in your 0 directory. Is there a parameter d defined there?

Regards,
Yann

EDIT: I fixed the dead link in my previous post.

Last edited by Yann; November 17, 2022 at 09:53.
Yann is offline   Reply With Quote

Old   November 17, 2022, 19:10
Default
  #5
New Member
 
astri anindya
Join Date: Nov 2022
Posts: 3
Rep Power: 3
astri is on a distinguished road
Hi Yann, thank you so much!

Yes, you're right, there's no parameter d defined in my ABLConditions file.
Here's what's written in the file:


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1706+ |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
/* Butterfly 0.0.4 https://github.com/ladybug-tools/butterfly *\
\*---------------------------------------------------------------------------*/

Uref 2.97;

Zref 10;

z0 uniform 1.0;

flowDir (0.0 1.0 0.0);

zDir (0 0 1);

zGround uniform -0.10000000149;

value $internalField;


-------------------------------------------------------------------

I have no idea how to define the parameter d. I've checked the OpenFOAM user guide, the example of ABLConditions in this link https://www.openfoam.com/documentati...daryLayer.html



inlet
{
// Mandatory and other optional entries
...

// Mandatory (inherited) entries (runtime modifiable)
flowDir (1 0 0);
zDir (0 0 1);
Uref 10.0;
Zref 0.0;
z0 uniform 0.1;
d uniform 0.0;
-----------------------------------------------------------

Should I just copy the definition for parameter d just like the example?
Thank you so very much Yann for your advice.

Best regards,
astri
astri is offline   Reply With Quote

Old   November 18, 2022, 03:11
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,085
Rep Power: 26
Yann will become famous soon enough
Hi Astri,

You're welcome. About the d parameter, I have no idea since I never used this boundary condition.
There is a note about it in the documentation:

Quote:
d is the displacement height, and "is relevant for flows over forests and cities" ([17], p. 28). "The displacement height gives the vertical displacement of the entire flow regime over areas which are densely covered with obstacles such as trees or buildings" ([17], p. 28).
Up to you to decide how to define this parameter. Checking the cited reference might help.

Cheers,
Yann
Yann is offline   Reply With Quote

Reply

Tags
error


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
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 09:07
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 21:53
Problem compiling a custom Lagrangian library brbbhatti OpenFOAM Programming & Development 2 July 7, 2014 11:32
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 03:23
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 13:41.