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

Boundary field error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 24, 2022, 08:44
Default Boundary field error
  #1
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
Hello, I am trying to put an inlet and outlet in a box, and i am trying to model the air ventilation in a room, however my simulation when it runs keeps on giving me this error: test/0/T.boundaryField at line 27. However line 27 is still okay i would say there are no parenthesis error too. What maybe causing this error then the blockMesh dict file looks like this, am i doing something wrong with the blockMesh file?
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object blockMeshDict;
}

// Exported by SnappyHexMesh GUI add-on for Blender v1.0
// Source file: G:\wsl-ubuntu20.04\rootfs\home\ms\OpenFOAM\ms-v2006\covidVenNew\constant\triSurface\fannew.blend
// Export date: 2021-04-06 18:40:32.642516

convertToMeters 1;

vertices
(
( 0.0 0.0 0.0 )
( 7.8 0.0 0.0 )
( 7.8 7.8 0.0 )
( 0.0 7.8 0.0 )
( 0.0 0.0 3.1 )
( 7.8 0.0 3.1 )
( 7.8 7.8 3.1 )
( 0.0 7.8 3.1 )
);

blocks
(
hex (0 1 2 3 4 5 6 7) (100 100 50) simpleGrading (1 1 1)
//hex (0 1 2 3 4 5 6 7) (96 64 64) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
world
{
type patch;
faces
(
(3 7 6 2)
(0 4 7 3)
(2 6 5 1)
(1 5 4 0)
(0 3 2 1)
(4 5 6 7)
);
}
);
R786 is offline   Reply With Quote

Old   November 24, 2022, 09:03
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hi,
  1. Does blockMesh run properly?
  2. You are having an error with your boundary condition but you are not posting the full error message nor the content of your T file which makes it pretty hard to help you. Can you post both please?

Yann
Yann is offline   Reply With Quote

Old   November 24, 2022, 09:04
Default
  #3
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
This is the T file
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 0 0 1 0 0 0];


internalField uniform 297.15;

boundaryField
{
body
{
type fixedValue;
value uniform 299.75;
}

hands
{
type fixedValue;
value uniform 299.75;
}
head
{
type fixedValue;
value uniform 304.95;
}
mouth
{
type fixedValue;
value uniform 304.95;
}

sidewalls
{
type fixedValue;
value uniform 297.15;
}
inlet
{
type fixedValue;
value uniform 283.15;
}
outlet
{
type fixedValue;
value $internalField ;
}

}
R786 is offline   Reply With Quote

Old   November 24, 2022, 09:06
Default
  #4
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
yes blockmesh runs properly
R786 is offline   Reply With Quote

Old   November 24, 2022, 09:07
Default
  #5
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
This is the error message
--> FOAM FATAL IO ERROR: (openfoam-2106 patch=211215)
Cannot find patchField entry for world

file: /home/rabia/RabiaOpenFOAM/test/0/T.boundaryField at line 27.

From void Foam::GeometricField<Type, PatchField, GeoMesh>::Boundary::readField(const Foam:imensionedField<TypeR, GeoMesh>&, const Foam::dictionary&) [with Type = double; PatchField = Foam::fvPatchField; GeoMesh = Foam::volMesh]
in file /usr/lib/openfoam/openfoam2106/src/OpenFOAM/lnInclude/GeometricBoundaryField.C at line 172.

FOAM exiting
R786 is offline   Reply With Quote

Old   November 24, 2022, 09:23
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Thanks!

How do you create your mesh? With blockMesh only or blockMesh+snappyHexMesh?

From the files you have posted: blockMesh creates a domain and all patches are named world.

In your T file you have boundary conditions defined for a lot bunch of patches which probably do not exist in the mesh if you just ran blockMesh (hands, head, mouth etc...) but there is no boundary condition for the patch world and this is what the solver complains about.

Yann
Yann is offline   Reply With Quote

Old   November 24, 2022, 09:25
Default
  #7
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
I am using snappyHexMesh. However, the model worked before when there was no inlet and outlet. It worked with the patch world and now its not working when i have introduced inlet and outlet into the model.
R786 is offline   Reply With Quote

Old   November 24, 2022, 09:30
Default
  #8
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
How do we know which patch number matches which vertice because i think i need to amend the blockmesh file maybe but i dont know what patch my inlet and outlet is at
R786 is offline   Reply With Quote

Old   November 24, 2022, 09:37
Default
  #9
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
have a look at the boundary file:
  • serial: constant/polyMesh/boundary
  • parallel: processor*/constant/polyMesh/boundary

This is the list of the boundaries of your mesh. Each boundary needs a boundary condition. If there are missing boundary names or additional ones, it means something goes wrong with snappyHexMesh, blockMesh, or the STL files you are using with snappyHexMesh.

Yann
Yann is offline   Reply With Quote

Old   November 24, 2022, 09:39
Default
  #10
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Quote:
Originally Posted by R786 View Post
How do we know which patch number matches which vertice because i think i need to amend the blockmesh file maybe but i dont know what patch my inlet and outlet is at
Have a look at the blockMesh documentation: https://www.openfoam.com/documentati...ckmesh-utility
Yann is offline   Reply With Quote

Old   November 24, 2022, 09:55
Default
  #11
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
Thanks, i also have another issue with the postprocessing, when i postprocess the results and use reconstructPara command from parrallel computing, then i open a.foam in paraview, for some reason it does not start from 0 time, why this maybe the case, it directly starts from the second time instance for example if i did 5 seconds interval the paraview starts showing from 5 seconds and not at 0 seconds. I need this because i would want to animate my simulation so it must start from 0. Here is the command:
reconstructPar -time '0,5,10,15,20,25'
R786 is offline   Reply With Quote

Old   November 24, 2022, 11:18
Default
  #12
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
When loading your .foam file in paraview, uncheck the "skip zero time" option.
Yann is offline   Reply With Quote

Old   November 28, 2022, 09:56
Default
  #13
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
Thanks, I can now see the simulation from 0, i have another question about, the blockMesh, I have this example block mesh in which there are coordinates, x y and z and then i believe the 0 , 1 , 2 etc. is the patch number, but what are these coordinates then if i was to match these to my .stl file block?
vertices
(
(0.0 0.0 0.4) //0
(0.0 0.4 0.4) //1
(0.8 0.4 0.4) //2
(0.8 0.0 0.4) //3
(0.0 0.0 0.38) //4
(0.0 0.18 0.38) //5
(0.0 0.22 0.38) //6
(0.0 0.4 0.38) //7
(0.8 0.4 0.38) //8
(0.8 0.22 0.38) //9
(0.8 0.18 0.38) //10
(0.8 0.0 0.38) //11
(0.0 0.0 0.34) //12
(0.0 0.18 0.34) //13
(0.0 0.22 0.34) //14
(0.0 0.4 0.34) //15
(0.8 0.4 0.34) //16
(0.8 0.22 0.34) //17
(0.8 0.18 0.34) //18
(0.8 0.0 0.34) //19
(0.0 0.0 0.06) //20
(0.0 0.18 0.06) //21
(0.0 0.22 0.06) //22
(0.0 0.4 0.06) //23
R786 is offline   Reply With Quote

Old   November 28, 2022, 10:20
Default
  #14
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Quote:
Originally Posted by R786 View Post
vertices
(
(0.0 0.0 0.4) //0
(0.0 0.4 0.4) //1
(0.8 0.4 0.4) //2
(0.8 0.0 0.4) //3
(0.0 0.0 0.38) //4
(0.0 0.18 0.38) //5
(0.0 0.22 0.38) //6
(0.0 0.4 0.38) //7
(0.8 0.4 0.38) //8
(0.8 0.22 0.38) //9
(0.8 0.18 0.38) //10
(0.8 0.0 0.38) //11
(0.0 0.0 0.34) //12
(0.0 0.18 0.34) //13
(0.0 0.22 0.34) //14
(0.0 0.4 0.34) //15
(0.8 0.4 0.34) //16
(0.8 0.22 0.34) //17
(0.8 0.18 0.34) //18
(0.8 0.0 0.34) //19
(0.0 0.0 0.06) //20
(0.0 0.18 0.06) //21
(0.0 0.22 0.06) //22
(0.0 0.4 0.06) //23
As you can see at the first line, those are vertices coordinates. The comment is just here to illustrate how vertices are numbered. Both blocks and faces are defined by their vertices numbers and the vertices order matters.

Have a look at the documentation for more details: https://www.openfoam.com/documentati...ckmesh-utility


Quote:
Originally Posted by R786 View Post
if i was to match these to my .stl file block
I don't understand your statement. What do you mean by matching it to your stl file block?

The usual strategy is to use blockMesh to create a bakground mesh for snappyHexMesh to work with. The blockMesh mesh has to be larger than the geometry you want to mesh (your stl file)
Yann is offline   Reply With Quote

Old   November 28, 2022, 10:43
Default
  #15
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
My .stl file is a block which has an inlet and an outlet, so what i dont understand is that the vertices in this blockMesh file are vertices of what, I understand my blockMesh has to be larger than the stl file block, so my block measures 7.4 x 7.4 x 3 m.........now in this blockMesh files the vertices are showing perhaps blocks and then at the end these get merged by this command

mergePatchPairs

also if i need to use blockMesh, do i really need the stl file? Or this is not possible for openFOAM to be able to apply blockMesh without the stl file
R786 is offline   Reply With Quote

Old   November 28, 2022, 11:25
Default
  #16
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
I cannot really answer without knowing what geometry you are trying to mesh.

blockMesh allows to create meshes for pretty simple cases by defining vertices, edges and blocks.

For more complex geometries you won't be able to use blockMesh alone so you need to switch to snappyHexMesh which will allow to create a volume mesh based on an initial background mesh (usually created with blockMesh) and a surface mesh of the geometry you want to mesh as a STL file.

Maybe the documentation can help you to understand how snappy works:https://www.openfoam.com/documentati...exmesh-utility
Yann is offline   Reply With Quote

Old   November 28, 2022, 12:27
Default
  #17
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
its just a box with an inlet and outlet thats all. I am using snappyHexMesh too.
R786 is offline   Reply With Quote

Old   November 28, 2022, 12:34
Default
  #18
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Then in blockMesh you need to define a block larger than your STL file. You know your STL size and position, in blockMeshDict you have to define the vertices coordinates accordingly.
Yann is offline   Reply With Quote

Old   November 29, 2022, 07:39
Default
  #19
Member
 
West Midlands
Join Date: Aug 2022
Posts: 63
Rep Power: 4
R786 is on a distinguished road
Thanks a lot for this, I also have another question about animation of the simulation, i have been able to follow untick the zero time in paraview but how will i show the time when animating my solution ?
R786 is offline   Reply With Quote

Old   November 29, 2022, 08:17
Default
  #20
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
In paraView, you can use the "annotate time filter" to display time.

Yann
Yann is offline   Reply With Quote

Reply


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
Gmsh reports an OpenCascade exception when opening a .geo file algc Main CFD Forum 2 October 24, 2022 06:59
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 20:43
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Errors in UDF shashank312 Fluent UDF and Scheme Programming 6 May 30, 2013 21:30
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 18:38


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