|
[Sponsors] |
January 10, 2019, 21:19 |
Error while compiling perturbU
|
#1 |
New Member
Gareth
Join Date: Apr 2010
Location: Sydney Aus
Posts: 14
Rep Power: 16 |
Hello everyone,
I am trying to use perturbU to run a precursor simulation for a channel flow, so that I get the required turbulence before I can use the results to initialise a main run. I received the following error while compiling perturbU: perturbU.C: In function ‘int main(int, char**)’: perturbU.C:173:49: error: ‘class Foam::Random’ has no member named ‘GaussNormal’ scalar deviation=1.0 + 0.2*perturbation.GaussNormal(); I am using Openfoam 6. Thanks, Gary |
|
January 13, 2019, 19:22 |
|
#2 |
New Member
Abhishek Mukherjee
Join Date: Nov 2018
Posts: 6
Rep Power: 7 |
Hi, I am also facing the same issue, my OpenFoam version 6.0 and while compiling perturbU, I am getting same error
error: ‘class Foam::Random’ has no member named ‘GaussNormal’; did you mean ‘scalarNormal’? scalar deviation=1.0 + 0.2*perturbation.GaussNormal(); |
|
December 17, 2019, 09:33 |
|
#3 |
New Member
Erik
Join Date: Sep 2019
Posts: 4
Rep Power: 7 |
For future users: I was able to solve this issue in OF7.0 by changing GaussNormal to scalarNormal in perturbUChannel/perturbU.C and perturbUGeneric/perturbU.C.
After trying to compile another error comes up indicating that headerOk is not a member etc in perturbUCylinder/perturbU.C. This can be fixed by borrowing from $FOAM_SRC/conversion/meshTables/boundaryRegion.C where IOMap<dictionary> ioObj is defined. Simply change the definition in the perturbU.C file from previously Code:
IOobject Uheader ( "U", runTime.timeName(), mesh, IOobject::MUST_READ ); Code:
IOMap<dictionary> ioObj ( IOobject Uheader ( "U", runTime.timeName(), mesh, IOobject::MUST_READ ) ); Maybe this could be updated in the git repository for more recent OF versions? |
|
March 1, 2020, 03:33 |
|
#4 |
Senior Member
Gerry Kan
Join Date: May 2016
Posts: 360
Rep Power: 11 |
As the compiler error suggests, Foam::Random’ no longer has a member function ‘GaussNormal’ from OF 6 onwards. The new member 'scalarNormal' also returns a random scalar between 0 and 1. It is sufficient to substitute the offending member with this renamed member and not significantly alter the behavior of perturbU.
Gerry. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Getting error both interpreting and compiling | serene6390 | Fluent UDF and Scheme Programming | 1 | October 27, 2017 00:49 |
All files present. but solver not compiling | saddy | OpenFOAM Programming & Development | 1 | July 29, 2017 09:50 |
[OpenFOAM.org] Trouble Compiling OpenFOAM-dev using Intel Compiler 15 for use on Xeon Phi | foamer123 | OpenFOAM Installation | 9 | August 20, 2015 14:03 |
is PerturbU there in OpenFOAM 2.1? | turbfoam | OpenFOAM Running, Solving & CFD | 3 | December 26, 2012 15:18 |
Help with KIVA4 source code compiling | geothokar | Main CFD Forum | 0 | September 3, 2010 05:40 |