|
[Sponsors] |
Attempt to cast type zeroGradient to type nutWallFunction |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
New Member
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 12 ![]() |
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.
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
![]() |
![]() |
![]() |
![]() |
#3 |
New Member
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5 ![]() |
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? |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 12 ![]() |
would you mind to share the boundary condition files as well as constant/polyMesh/boundar*, please?
__________________
The OpenFOAM community is the biggest contributor to OpenFOAM: User guide/Wiki-1/Wiki-2/Code guide/Code Wiki/Journal Nilsson/Guerrero/Holzinger/Holzmann/Nagy/Santos/Nozaki/Jasak/Primer Governance Bugs/Features: OpenFOAM (ESI-OpenCFD-Trademark) Bugs/Features: FOAM-Extend (Wikki-FSB) Bugs: OpenFOAM.org How to create a MWE New: Forkable OpenFOAM mirror |
|
![]() |
![]() |
![]() |
![]() |
#5 |
New Member
Anon
Join Date: Dec 2020
Posts: 20
Rep Power: 5 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#6 |
New Member
Hosam Alrefaie
Join Date: Jul 2021
Posts: 24
Rep Power: 5 ![]() |
Hi CfdUser5855,
have you solved this? ![]() |
|
![]() |
![]() |
![]() |
![]() |
#7 |
New Member
Join Date: Jan 2022
Posts: 3
Rep Power: 4 ![]() |
Hi everyone,
I've encountered this issue as well. Has anyone found a solution? Much appreciated. |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Join Date: Sep 2013
Posts: 353
Rep Power: 20 ![]() |
Check your polyMesh boundary file. Make sure that walls are of type wall and not patch.
|
|
![]() |
![]() |
![]() |
![]() |
#9 | |
New Member
Join Date: Jan 2022
Posts: 3
Rep Power: 4 ![]() |
Quote:
Thanks. |
||
![]() |
![]() |
![]() |
![]() |
#10 |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 238
Rep Power: 17 ![]() |
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. |
|
![]() |
![]() |
![]() |
Tags |
pimplefoam, turbulent |
|
|
![]() |
||||
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 |