|
[Sponsors] |
December 1, 2016, 03:39 |
volScalarField on Mac
|
#1 |
New Member
Xavier Lamboley
Join Date: Jan 2015
Location: Bordeaux, France
Posts: 13
Rep Power: 11 |
Hi,
I'm having a very weird issue about compilation in OpenFoam 3&4, hope you guys can help me. I'm developing my own turbulence model in OF and I have different results under Linux and Mac on the following line : Code:
volScalarField F_wake = Foam::exp(-Foam::pow(Rew / 1e5, 2.0)); Code:
../turbulenceModels/lnInclude/sstTransitionBase.C:620:20: error: conversion from 'tmp<GeometricField<scalar, fvPatchField, Foam::volMesh> >' (aka 'tmp<GeometricField<double, fvPatchField, Foam::volMesh> >') to 'volScalarField' (aka 'GeometricField<double, fvPatchField, Foam::volMesh>') is ambiguous volScalarField F_wake = Foam::exp(-Foam::pow(Rew / 1e5, 2.0)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $WM_PROJECT_DIR/src/OpenFOAM/lnInclude/tmp.H:153:16: note: candidate function inline operator const T&() const; ^ $WM_PROJECT_DIR/src/OpenFOAM/lnInclude/GeometricField.H:374:9: note: candidate constructor GeometricField ^ If I replace the F_wake definition by Code:
volScalarField F_wake(Foam::exp(-Foam::pow(Rew / 1e5, 2.0))); Code:
$ clang --version Apple LLVM version 8.0.0 (clang-800.0.42.1) Target: x86_64-apple-darwin16.1.0 Thread model: posix |
|
December 1, 2016, 08:17 |
|
#2 |
Senior Member
|
Hi,
Foam::exp(...) returns tmp<volScalarField>. So Code:
volScalarField F_wake(Foam::exp(-Foam::pow(Rew / 1e5, 2.0))); Code:
volScalarField F_wake = Foam::exp(-Foam::pow(Rew / 1e5, 2.0)); Not sure if this behaviour is Mac-specific, guess, clang on Linux will also emit the error. |
|
December 1, 2016, 08:47 |
|
#3 |
New Member
Xavier Lamboley
Join Date: Jan 2015
Location: Bordeaux, France
Posts: 13
Rep Power: 11 |
Thank you for your quick reply, I understand better now
Have a nice day! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compressible 2D airfoil rhoSimpleFoam fatal error volScalarField none | jfournier | OpenFOAM Running, Solving & CFD | 4 | September 28, 2017 06:28 |
execFlowFunctionObjects - unknown field problem | Toorop | OpenFOAM Post-Processing | 16 | March 14, 2016 03:25 |
using chemkin | JMDag2004 | OpenFOAM Pre-Processing | 2 | March 8, 2016 22:38 |
make a dimensionedScalar to be volScalarField | sharonyue | OpenFOAM Programming & Development | 4 | April 2, 2014 05:44 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 06:16 |