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

Attempt to cast type zeroGradient to type nutWallFunction

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By HPE
  • 1 Post By CfdUser5855

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2020, 08:47
Default Attempt to cast type zeroGradient to type nutWallFunction
  #1
New Member
 
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5
CfdUser5855 is on a distinguished road
Hi all,

I'm running a pimpleFoam case, and the error

'--> FOAM FATAL ERROR:
Attempt to cast type zeroGradient to type nutWallFunction

From function To& Foam::refCast(From&) [with To = const Foam::nutWallFunctionFvPatchScalarField; From = const Foam::fvPatchField<double>]
in file /home/ubuntu/OpenFOAM/OpenFOAM-7/src/OpenFOAM/lnInclude/typeInfo.H at line 114'

appears after initially solving for ux, uy, and uz. I have tried a number of different types for the patch to see if it will run, but the error appears each time with the different type used substituted into it.

A search for this error provides a link to people saying they have this problem, but no solution is working for me

My nut case is shown below

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

internalField uniform 0;

boundaryField
{
#include "include/ABLConditions"

inlet
{
type zeroGradient;
//value uniform 0.0;
}

outlet
{
type zeroGradient;
//value uniform 0;
}

top
{
type zeroGradient;
//value uniform 0;
}

NiliDuneField
{
type nutkAtmRoughWallFunction;
z0 0.03;
value uniform 0;
}
}

If anyone is able to help with this, that would be greatly appreciated
CfdUser5855 is offline   Reply With Quote

Old   December 17, 2020, 10:50
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
The reason of that error is bad class hierarchy change. Spilled from OpenFOAM.org...

Please just use a nut wall function in 0/nut file.

For example, if you have `fixedValue` for a patch inside 0/nut, please change it to `nutLowReWallFunction`. Then it should run.
govind_IITD likes this.
HPE is offline   Reply With Quote

Old   December 17, 2020, 12:35
Default
  #3
New Member
 
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5
CfdUser5855 is on a distinguished road
Thanks for the advice, however the error then throws up that the patch type for inlet must be wall, which isn't correct for this simulation

Do you know which nut type would resolve that issue, without changing the wall type?
CfdUser5855 is offline   Reply With Quote

Old   December 17, 2020, 12:36
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
would you mind to share the boundary condition files as well as constant/polyMesh/boundar*, please?
HPE is offline   Reply With Quote

Old   December 18, 2020, 11:47
Default
  #5
New Member
 
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5
CfdUser5855 is on a distinguished road
Sorry for being late getting back to you. I tried remaking the case to see if it was a redundant line that was causing the issue but no joy

My constant/polymesh/boundary is as follows

4
(
outlet
{
type patch;
nFaces 33775;
startFace 29542772;
}
inlet
{
type patch;
nFaces 28497;
startFace 29576547;
}
top
{
type patch;
nFaces 450;
startFace 29605044;
}
DuneField
{
type wall;
inGroups List<word> 1(wall);
nFaces 459920;
startFace 29605494;
}
)

p is as follows:

#include "include/initialConditions"

dimensions [0 2 -2 0 0 0 0];

internalField uniform $pressure;

boundaryField
{
inlet
{
type zeroGradient;
}

outlet
{
type uniformFixedValue;
uniformValue constant $pressure;
}

top
{
type zeroGradient;
}

DuneField
{
type zeroGradient;
}

ground
{
type zeroGradient;
}


u is as follows

#include "include/initialConditions"

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

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type atmBoundaryLayerInletVelocity;
#include "include/ABLConditions"
}

outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value $internalField;
}

top
{
type zeroGradient;

}

DuneField
{
type uniformFixedValue;
value uniform (0 0 0);
uniformValue constant (0 0 0);
}

k is as follows

#include "include/initialConditions"

dimensions [0 2 -2 0 0 0 0];

internalField uniform $turbulentKE;

boundaryField
{
outlet
{
type inletOutlet;
inletValue uniform $turbulentKE;
value $internalField;
}

inlet
{
type atmBoundaryLayerInletK;
#include "include/ABLConditions"
}

top
{
type kqRWallFunction;
value uniform 0.375;
}
DuneField
{
type zeroGradient;
}
}

nut is as follows

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

internalField uniform 0;

boundaryField

{
#include "include/ABLConditions"

inlet
{
type nutLowReWallFunction;
value uniform 0.0;
}

outlet
{
type nutLowReWallFunction;
value uniform 0;
}

top
{
type nutLowReWallFunction;
value uniform 0;
}

DuneField
{
type nutkAtmRoughWallFunction;
z0 0.03;
value uniform 0;
}
}

epsilon is as follows


dimensions [0 2 -3 0 0 0 0];

#include "include/initialConditions"

internalField uniform $turbulentEpsilon;

boundaryField
{
inlet
{
type fixedValue;
value uniform 0.01;
}
outlet
{
type inletOutlet;
inletValue uniform $turbulentEpsilon;
value $internalField;
}
top
{
type epsilonWallFunction;
value uniform 0.01;
}
DuneField
{
type zeroGradient;
}
}


Thank you very much for looking at this
govind_IITD likes this.
CfdUser5855 is offline   Reply With Quote

Old   October 24, 2021, 10:03
Default
  #6
New Member
 
Hosam Alrefaie
Join Date: Jul 2021
Posts: 24
Rep Power: 4
HosamAlrefaie is on a distinguished road
Hi CfdUser5855,

have you solved this?
HosamAlrefaie is offline   Reply With Quote

Old   January 29, 2022, 20:57
Default
  #7
New Member
 
Join Date: Jan 2022
Posts: 3
Rep Power: 4
sunafegon is on a distinguished road
Hi everyone,

I've encountered this issue as well. Has anyone found a solution?

Much appreciated.
sunafegon is offline   Reply With Quote

Old   January 30, 2022, 10:40
Default
  #8
Senior Member
 
Join Date: Sep 2013
Posts: 353
Rep Power: 20
Bloerb will become famous soon enough
Check your polyMesh boundary file. Make sure that walls are of type wall and not patch.
Bloerb is offline   Reply With Quote

Old   January 30, 2022, 11:56
Default
  #9
New Member
 
Join Date: Jan 2022
Posts: 3
Rep Power: 4
sunafegon is on a distinguished road
Quote:
Originally Posted by Bloerb View Post
Check your polyMesh boundary file. Make sure that walls are of type wall and not patch.
Hi Bloerb, I think that aspect of the issue has already been solved. It's now turned to the issue of it demanding that the inlet and outlet patches be of type wall instead of type patch, which isn't correct for the study type. I'm not sure if it makes a difference to the calculation, however. Maybe it doesn't matter if the inlet or outlet are type patch or type wall given the equations used to define the conditions. Any thoughts?

Thanks.
sunafegon is offline   Reply With Quote

Old   July 11, 2023, 12:40
Default
  #10
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 237
Rep Power: 16
vonboett is on a distinguished road
I had the same problem... so here is the simple solution:


just still use:

type calculated; value uniform 0.0


for a patch and wallFunctions for walls.
vonboett is offline   Reply With Quote

Reply

Tags
pimplefoam, turbulent


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
natural convection in square cavity having inlet and outlet sujeet OpenFOAM Running, Solving & CFD 1 November 2, 2019 02:17
time step continuity error increases with time_SRFSimplefoam mostafa kamal OpenFOAM Running, Solving & CFD 7 October 2, 2019 02:00
rhoPimpleFoam hardship petrus OpenFOAM Running, Solving & CFD 0 October 7, 2016 02:41
LES supersonic free jet martyn88 OpenFOAM 22 April 17, 2015 06:00
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 09:28


All times are GMT -4. The time now is 10:48.