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

Compilation error in OpenFOAM in WSL

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2019, 10:27
Default Compilation error in OpenFOAM in WSL
  #1
Member
 
Pablo Alarcón
Join Date: Mar 2018
Location: Liège
Posts: 59
Rep Power: 8
palarcon is on a distinguished road
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.
He 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
(
);

// ************************************************************************* //

Last edited by palarcon; July 19, 2019 at 09:29. Reason: Addition of supplementary information
palarcon 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 Started with OpenFOAM wyldckat OpenFOAM 25 August 14, 2022 13:55
[OpenFOAM.org] OpenFOAM 5.0: sudden new compilation error on on the Titan supercomputer (Cray) wildfire230 OpenFOAM Installation 1 July 15, 2018 10:06
UNIGE February 13th-17th - 2107. OpenFOAM advaced training days joegi.geo OpenFOAM Announcements from Other Sources 0 October 1, 2016 19:20
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin cfd.direct OpenFOAM Announcements from Other Sources 0 September 21, 2016 11:50
OpenFoam 2.1.x /2.2.0 compilation failed on Ubuntu 12.04/10 64bit keepfit OpenFOAM Installation 2 March 26, 2013 09:43


All times are GMT -4. The time now is 00:21.