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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2020, 09:47
Default Attempt to cast type zeroGradient to type nutWallFunction
  #1
New Member
 
Anon
Join Date: Dec 2020
Posts: 8
Rep Power: 2
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, 11: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: 903
Rep Power: 10
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.
HPE is offline   Reply With Quote

Old   December 17, 2020, 13:35
Default
  #3
New Member
 
Anon
Join Date: Dec 2020
Posts: 8
Rep Power: 2
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, 13: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: 903
Rep Power: 10
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, 12:47
Default
  #5
New Member
 
Anon
Join Date: Dec 2020
Posts: 8
Rep Power: 2
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
CfdUser5855 is offline   Reply With Quote

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

have you solved this?
HosamAlrefaie is offline   Reply With Quote

Reply

Tags
pimplefoam, turbulent

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


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