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

Error while compiling perturbU

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 10, 2019, 21:19
Default Error while compiling perturbU
  #1
New Member
 
Gareth
Join Date: Apr 2010
Location: Sydney Aus
Posts: 14
Rep Power: 16
gharek is on a distinguished road
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
gharek is offline   Reply With Quote

Old   January 13, 2019, 19:22
Default
  #2
New Member
 
Abhishek Mukherjee
Join Date: Nov 2018
Posts: 6
Rep Power: 7
absrocks007 is on a distinguished road
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();
absrocks007 is offline   Reply With Quote

Old   December 17, 2019, 09:33
Default
  #3
New Member
 
Erik
Join Date: Sep 2019
Posts: 4
Rep Power: 6
FlameSlave is on a distinguished road
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
);
To
Code:
IOMap<dictionary> ioObj
(
    IOobject Uheader
    (
        "U",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ
    )
);
and you should be good to go.


Maybe this could be updated in the git repository for more recent OF versions?
FlameSlave is offline   Reply With Quote

Old   March 1, 2020, 03:33
Default
  #4
Senior Member
 
Gerry Kan's Avatar
 
Gerry Kan
Join Date: May 2016
Posts: 347
Rep Power: 10
Gerry Kan is on a distinguished road
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.
Gerry Kan is offline   Reply With Quote

Reply


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
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


All times are GMT -4. The time now is 19:31.