CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   FOAM Warning : (https://www.cfd-online.com/Forums/openfoam-solving/251053-foam-warning.html)

Amirthaa July 24, 2023 03:00

FOAM Warning :
 
I've been working on the WindAroundBuildings tutorial and have been trying to just replace the geometry for start. I have replaced the original geometry with a .stl file. Now, when I run the snappyHexMesh, I get the following warning:

Reading refinement surfaces...
--> FOAM Warning :
From function Foam::refinementSurfaces::refinementSurfaces(const Foam::searchableSurfaces&, const Foam::dictionary&, Foam::label)
in file refinementSurfaces/refinementSurfaces.C at line 215
Reading "/home/amirthaa/OpenFOAM/amirthaa-10/run/WABEx2/system/snappyHexMeshDict/castellatedMeshControls/refinementSurfaces" from line 49 to line 50
Not all entries in refinementSurfaces dictionary were used. The following entries were not used : 1(av1)

My snappyHexMeshDict code:

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 10
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#includeEtc "caseDicts/mesh/generation/snappyHexMeshDict.cfg"

castellatedMesh on;
snap on;
addLayers off;

geometry
{
av1.stl
{
type triSurfaceMesh;
file "av1.obj";
}

refinementBox
{
type searchableBox;
min ( 0 0 0);
max (250 180 90);
}
};

castellatedMeshControls
{
features
(
{ file "av1.obj"; level 1; }
);

refinementSurfaces
{
av1
{
level (3 3);
patchInfo { type wall; }
}
}

refinementRegions
{
refinementBox
{
mode inside;
level 2;
}
}

insidePoint (1 1 1);
}

snapControls
{
explicitFeatureSnap true;
implicitFeatureSnap false;
}

addLayersControls
{
layers
{
stlSurface
{
nSurfaceLayers 2;
}
}

relativeSizes true;
expansionRatio 1.2;
finalLayerThickness 0.5;
minThickness 1e-3;
}

meshQualityControls
{}

writeFlags
(
// scalarLevels
// layerSets
// layerFields
);

mergeTolerance 1e-6;

// ************************************************** *********************** //

It would be useful if someone can guide me on the cause of this warning.

Yann July 24, 2023 03:39

Hello,

In the geometry section of your snappyHexMeshDict, you geometry is named "av1.stl" but in the refinementSurfaces section you define refinement levels for "av1". You can either rename your geometry or modify your refinementSurfaces but names have to be consistent.

You can have a look at the tutorials using snappyHexMesh to have some examples. For instance here: https://github.com/OpenFOAM/OpenFOAM...ppyHexMeshDict

Cheers,
Yann

Amirthaa July 24, 2023 04:52

Thank you, that was helpful.
I also had and have another warning following the earlier one as :

--> FOAM Warning :
From function Foam::treeBoundBox::treeBoundBox(const Foam::UList<Foam::Vector<double> >&)
in file meshes/treeBoundBox/treeBoundBox.C at line 136
cannot find bounding box for zero-sized pointField, returning zero

Would you know what causes this?

Yann July 24, 2023 05:24

Quote:

Originally Posted by Amirthaa (Post 853910)
Would you know what causes this?

Not with that few information. But you can post the full snappy log file (or at least the beginning of the log, up to the part where you get the warning) which would be more helpful to have an idea about what is happening.

Regards,
Yann

Amirthaa July 24, 2023 05:36

Sure. Below is the log from start until the warning:

Create time

Create mesh for time = 0

Read mesh in = 0.013785 s
Reading "snappyHexMeshDict"


Overall mesh bounding box : (-20 -50 0) (330 230 140)
Relative tolerance : 1e-06
Absolute matching distance : 0.000469574

Reading refinement surfaces...
Read refinement surfaces in = 0.001651 s

Reading refinement regions...
Refinement level 2 for all cells inside refinementBox
Read refinement regions in = 0.000121 s

Reading features...
Read edgeMesh av1.obj
points : 0
edges : 0
boundingBox : (0 0 0) (0 0 0)

Refinement level according to distance to "av1.obj" (0 points, 0 edges).
level 1 for all cells within 0 metre.
--> FOAM Warning :
From function Foam::treeBoundBox::treeBoundBox(const Foam::UList<Foam::Vector<double> >&)
in file meshes/treeBoundBox/treeBoundBox.C at line 136
cannot find bounding box for zero-sized pointField, returning zero

Do let me know, if you'd require any additional information.

Yann July 24, 2023 05:51

OK, I think this is related to your features refinement:

Code:

Reading features...
Read edgeMesh av1.obj
points : 0
edges : 0
boundingBox : (0 0 0) (0 0 0)

Refinement level according to distance to "av1.obj" (0 points, 0 edges).
level 1 for all cells within 0 metre.
--> FOAM Warning :
From function Foam::treeBoundBox::treeBoundBox(const Foam::UList<Foam::Vector<double> >&)
in file meshes/treeBoundBox/treeBoundBox.C at line 136
cannot find bounding box for zero-sized pointField, returning zero

As you can see, there is nothing detected here (0 points, edges, and bounding box).
In the features section, you are not supposed to provide your geometry obj file, but a file containing the feature edges of your geometry (extension eMesh or extendedFeatureEdgeMesh).
You create this file using the surfaceFeatures utility.

Have a look at the tutorial I've linked in my previous post, especially the Allrun script to see the workflow, and the surfaceFeaturesDict and snappyHexMeshDict to check syntax: https://github.com/OpenFOAM/OpenFOAM...HexMesh/flange

Amirthaa July 24, 2023 08:31

Thank You! I have made the required change with your help.

I have an issue in post processing. I'm not able to view my geometry in ParaView. Am not certain of what can be the reason. Would you be able to guide me on this? Do let me know of what files you may require if you have to check on it.

Yann July 25, 2023 03:17

Hello,

I cannot help if I don't know what you are doing :D
  1. Are you running in serial or parallel?
  2. Did snappy complete without error?
  3. How do you load your case in paraView?
  4. What are you visualizing in ParaView?

Yann

Amirthaa July 25, 2023 04:45

1 Attachment(s)
Yes, I understand.
1) I am running in serial.
2) Yes, snappyHexMesh had run without any error
3) By executing paraFoam after executing surfaceFeatures, blockMesh and snappyHexMesh
4) Currently am only able to visualise the mesh

I have attached the main directory for your reference.

Yann July 25, 2023 05:04

1 Attachment(s)
If you ran snappyHexMesh without the -overwrite option, you should see additional timeStep directories written in your case directory.
When loading the case in ParaView, you need to display the last timeStep to see the final mesh.

Also, I'm not sure what you mean by "only able to visualize the mesh".
If you want to display your geometry surfaces rather than the internal mesh, you need to load it in the "Mesh Regions" section in ParaView (something like in the screenshot attached). By default it only loads the internalMesh.

Yann

Amirthaa July 25, 2023 05:38

Got it. I realise I was missing the step to load geometry seperately. Am able to visualise now.
Thanks for guiding me through =)

Amirthaa July 26, 2023 08:22

Hello. So, I'm visualising my geometry and domain in paraview but my U values are wrong. They are high. I wonder what can be the error as I have merely made any changes to the base files except changing the geometry.

Yann July 26, 2023 08:31

Then probably it is related to the new geometry and/or mesh. ;)

have you run checkMesh on your last mesh?

Amirthaa July 26, 2023 08:36

No, I have not in my trials. But I just did and it has run without errors. What should one check in it?

Yann July 26, 2023 09:08

If checkMesh does not report any errors, you'll have to investigate your case to know what's wrong.
Have you check boundary conditions are properly defined for your new geometry?
What wrong with the flow? High velocity everywhere or only locally?
Did your simulation converge? Have you checked the residuals?

Amirthaa July 27, 2023 00:27

Yes, Boundary conditions are properly defined for my geometry. (It's a simple cuboid block)
Yes, I can see that it shows high velocity throughout the domain in paraview.
I just checked the residuals properly and the simulation has not converged.

Amirthaa July 27, 2023 07:30

I'm not able to figure out the reason as to of why the solutions are not converging. What can be the reason?

Yann July 27, 2023 07:41

Hello,

It's impossible to tell without knowing the details of your case. It can be pretty much anything: mesh, boundary conditions, numerical setup, or even physics itself...

Yann

Amirthaa July 27, 2023 07:44

Will you be able to check if I attach the files?
I have attached the main directory in one of my previous messages for your reference.

Yann July 27, 2023 08:11

I dont know if the case you have uploaded here is your latest setup, but the locationInMesh in your snappyHexMeshDict is wrong: you are meshing the inside of your geometry rather than the outside.

Nothing happens during the simulation because there is nothing to do and the velocity is 0 everywhere (it's basically an enclosure with nothing to create a flow)

Since you mentioned high velocities, I guess you must be doing something different than me. Please provide your latest setup and a script to run the case as you are doing it.

Thanks,
Yann


All times are GMT -4. The time now is 12:22.