|
[Sponsors] |
[blockMesh] Compilation error in OpenFOAM in WSL when using #calc |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 18, 2019, 04:58 |
Compilation error in OpenFOAM in WSL when using #calc
|
#1 |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Good afternoon everybody
Today something strange happened to me. I tried to launch blockMesh in a simple mesh that uses #calc to compute some coordinates and I got the error showed below. The strange part is that I was able to compile the exact same mesh until this morning, without any modifications. Also, I'm able to use blockMesh in a cluster, namely, the problem only arises in my personal laptop. If any of you has a clue related to this problem I will be enormously grateful. Thank you in advance First error: Code:
/opt/openfoam5/src/OpenFOAM/lnInclude/scalar.H:44:15: error: ‘Scalar’ was not declared in this scope class pTraits<Scalar> ^ /opt/openfoam5/src/OpenFOAM/lnInclude/scalar.H:44:21: error: template argument 1 is invalid Code:
--> FOAM FATAL IO ERROR: Failed wmake "dynamicCode/_9432dc904ef3d3e0c82b64892ec6b07a02820e92/platforms/linux64GccDPInt32Opt/lib/libcodeStream_9432dc904ef3d3e0c82b64892ec6b07a02820e92.so" file: /mnt/c/Users/pablo/OneDrive/Recherche/Code/OpenFOAM/pablo-5.0/run/plate/system/blockMeshDict from line 17 to line 23. From function static void (* Foam::functionEntries::codeStream::getFunction(const Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&) in file db/dictionary/functionEntries/codeStream/codeStream.C at line 218. Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 5 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 0.001; xmax 50; ymax 50; delta 5; // elements per milimeter e 2; // channel thickness y1 5; // distance from the border y2 #calc "$y1 + $e"; y3 #calc "$ymax - $y1 - $e"; y4 #calc "$ymax - $y1"; ycell1 #calc "$y1*$delta"; ycell2 #calc "$e*$delta"; ycell3 #calc "($ymax - 2*$y2)*$delta"; xcell #calc "$xmax*$delta"; vertices ( (0 0 0) // P0 ($xmax 0 0) // P1 ($xmax $y1 0) // P2 ($xmax $y2 0) // P3 ($xmax $y3 0) // P4 ($xmax $y4 0) // P5 ($xmax $ymax 0) // P6 (0 $ymax 0) // P7 (0 $y4 0) // P8 (0 $y3 0) // P9 (0 $y2 0) // P10 (0 $y1 0) // P11 (0 0 0.1) // P12 ($xmax 0 0.1) // P13 ($xmax $y1 0.1) // P14 ($xmax $y2 0.1) // P15 ($xmax $y3 0.1) // P16 ($xmax $y4 0.1) // P17 ($xmax $ymax 0.1) // P18 (0 $ymax 0.1) // P19 (0 $y4 0.1) // P20 (0 $y3 0.1) // P21 (0 $y2 0.1) // P22 (0 $y1 0.1) // P23 ); blocks ( hex (0 1 2 11 12 13 14 23) ($xcell $ycell1 1) simpleGrading (1 1 1) hex (11 2 3 10 23 14 15 22) ($xcell $ycell2 1) simpleGrading (1 1 1) hex (10 3 4 9 22 15 16 21) ($xcell $ycell3 1) simpleGrading (1 1 1) hex (9 4 5 8 21 16 17 20) ($xcell $ycell2 1) simpleGrading (1 1 1) hex (8 5 6 7 20 17 18 19) ($xcell $ycell1 1) simpleGrading (1 1 1) ); edges ( ); boundary ( inlet { type patch; faces ( (9 21 20 8) ); } outlet { type patch; faces ( (2 3 15 14) ); } otherWalls { type wall; faces ( (8 20 19 7) (10 22 21 9) (11 23 22 10) (0 12 23 11) (0 1 13 12) (1 2 14 13) (3 4 16 15) (4 5 17 16) (5 6 18 17) (6 7 19 18) ); } frontAndBack { type empty; faces ( (0 11 2 1) (11 10 3 2) (10 9 4 3) (9 8 5 4) (8 7 6 5) (12 13 14 23) (23 14 15 22) (22 15 16 21) (21 16 17 20) (20 17 18 19) ); } ); mergePatchPairs ( ); // ************************************************************************* // Last edited by palarcon; July 19, 2019 at 09:29. Reason: Addition of supplementary information |
|
November 9, 2019, 17:07 |
|
#2 |
New Member
Ali Amarloo
Join Date: Aug 2018
Posts: 9
Rep Power: 7 |
I have the same problem
I have a blockMesh which has "#calc" operator in it. I used it before without any problem. Even if I run the blockMesh with old made folder of dynamicCode, there is still no error. If I remove the old folder of "dynamicCode" and try to run BlockMesh again. I confront to error that it cannot compile it: Code:
--> FOAM FATAL IO ERROR: Failed wmake "dynamicCode/_9dc7a3e8288492d7641ba6678db9c67e97ea139c/platforms/linux64GccDPInt32Opt/lib/libcodeStream_9dc7a3e8288492d7641ba6678db9c67e97ea139c.so" file: /home/aligiw/Desktop/d/shockTube_mine/system/blockMeshDict from line 17 to line 32. From function static void (* Foam::functionEntries::codeStream::getFunction(const Foam::dictionary&, const Foam::dictionary&))(Foam::Ostream&, const Foam::dictionary&) in file db/dictionary/functionEntries/codeStream/codeStream.C at line 218. FOAM exiting it will be appreciated if anyone could help. |
|
November 9, 2019, 17:19 |
Update
|
#3 |
New Member
Ali Amarloo
Join Date: Aug 2018
Posts: 9
Rep Power: 7 |
Update:
After a little search reinstalling "make" worked for me: Code:
sudo apt-get remove make sudo apt-get install make or: sudo apt-get install --reinstall make |
|
November 12, 2019, 04:35 |
|
#4 | |
Member
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8 |
Quote:
To fix it, I had to re-install OpenFOAM and after that everything worked perfectly without further changes on the code itself. |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] blockMesh with parametric mesh. Unusual and unseen problem | 13msmemusman | OpenFOAM Meshing & Mesh Conversion | 1 | June 13, 2016 02:25 |
Drag force coefficient too high for a flow past a cylinder using komega sst | Scabbard | OpenFOAM Running, Solving & CFD | 37 | March 21, 2016 16:16 |
cannot converge a pimpleFoam simulation | iper88 | OpenFOAM Running, Solving & CFD | 1 | November 26, 2015 08:04 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 09:04 |
using #calc in parallel with openFOAM 2.2.2 | Pascal_doran | OpenFOAM Bugs | 5 | April 8, 2014 12:44 |