palarcon |
July 18, 2019 04:58 |
Compilation error in OpenFOAM in WSL when using #calc
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
Last error:
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.
The blockMeshDict file is the following
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
(
);
// ************************************************************************* //
|