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

Error on setFields

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2020, 03:29
Default Error on setFields
  #1
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Hello

When I run setFields I get the error:

--> FOAM FATAL IO ERROR:
Cannot find patchField entry for tank_patch20083

file: /home/josh/Desktop/cases/ICF4/full/case/0/alpha.water.boundaryField from line 26 to line 43.

Prior to this error, I first run snappyHexMesh, which runs error free. Then the issue shouldn't be meshing. Many of these forums suggest this error should be a syntax error. However, I cannot find it. Here's my setFieldsDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  6.0                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

defaultFieldValues
(
    volScalarFieldValue alpha.water 0//only air in the domain
);

regions
(
    boxToCell
    {
        box (0 2 0) (1 5 10);
        fieldValues
        (
            volScalarFieldValue alpha.water 1//we set our block of water into the domain
        );
    }
);


// ************************************************************************* //
and here is my alpha.water

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.0                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      alpha.water;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];//kg m s K mol A cd

internalField   uniform 0;//initially air in the entire domain - we will change that with setFields!

boundaryField
{

    lid
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }

    outlet
    {
        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }

    tank
    {
        type            constantAlphaContactAngle;
	theta0		0;
	limit		gradient;
	value		uniform 0;
    }
}

// ************************************************************************* //
Shouldn't the error be in one of these two files? You're help is greatly appreciated!
joshmccraney is offline   Reply With Quote

Old   April 1, 2020, 04:30
Default
  #2
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,290
Rep Power: 30
Yann will become famous soon enoughYann will become famous soon enough
Hello Josh,

setFields is throwing an error because there is a patch named "tank_patch20083" in the mesh, and there is no boundary condition defined in the alpha.water file for this patch.

You can check what are the patches in your domain in the constant/polyMesh/boundary file :
  • at the root of your case if you meshed in serial
  • in one of the processor* directories if you meshed in parallel
Another solution is to load your mesh in paraView and check the "Mesh Regions" panel to see the patches list and load the ones you want to see.


Cheers,
Yann
joshmccraney likes this.
Yann is offline   Reply With Quote

Old   April 1, 2020, 14:58
Default
  #3
Senior Member
 
Josh McCraney
Join Date: Jun 2018
Posts: 220
Rep Power: 9
joshmccraney is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hello Josh,

setFields is throwing an error because there is a patch named "tank_patch20083" in the mesh, and there is no boundary condition defined in the alpha.water file for this patch.

You can check what are the patches in your domain in the constant/polyMesh/boundary file :
  • at the root of your case if you meshed in serial
  • in one of the processor* directories if you meshed in parallel
Another solution is to load your mesh in paraView and check the "Mesh Regions" panel to see the patches list and load the ones you want to see.


Cheers,
Yann
Wow thanks! I would never have thought to check here! Fort some reason SHM appended all BCs with "_patch20083", which was evidenced in the constant/polyMesh/boundary file. This was different than those listed in the /0 folder. Thanks again Yann!
joshmccraney is offline   Reply With Quote

Old   April 2, 2020, 03:11
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,290
Rep Power: 30
Yann will become famous soon enoughYann will become famous soon enough
You're welcome, I'm glad I could help.


The name "patch20083" is probably coming from your STL file. If this is an ASCII STL, you can open it in a text editor and search for the "solid" keyword. Next to "solid", you will see the name(s) of the surface(s) contained in the file (probably coming from the CAD tool you used to create the geometry)


SHM will read the STL file, use the name you provide (tank) and append the surface names contained in the STL file to it (tank_patch20083) which allows to differentiate surfaces in order to use different surface refinement, patch types or layers specifications for each surface.



Cheers,
Yann
Yann is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Manual decomposition using setFields RL-S OpenFOAM Pre-Processing 8 July 3, 2023 08:51
SetFields SigSegV bug. Archoncomando OpenFOAM Pre-Processing 4 January 4, 2019 18:23
setFields not working dsanza OpenFOAM 4 October 18, 2018 09:43
rhoSimplecFoam with setFields sino75 OpenFOAM Pre-Processing 0 March 11, 2015 04:08
Problems with the execution of the setFields utility. foamer OpenFOAM Pre-Processing 5 June 3, 2013 12:24


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