CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.com] can't use #calc functions after installation W10 (https://www.cfd-online.com/Forums/openfoam-installation/226321-cant-use-calc-functions-after-installation-w10.html)

otaolafr April 23, 2020 14:00

can't use #calc functions after installation W10
 
hello,
new in OpenFOAM i have installed OF in W10 following the guide from József Nagy (guide).
i was trying to use a parametric blockMesh, (I am copying the code at the end of the post) where I use #calc in it and I gives me error when using it:
https://i.ibb.co/ZNBtwt4/Captura.png
I am completly new to linux and from the error, if i understand correctly i have no writes or i have missing files... and dont know how to solve it.
if anyone could help i would appreciate it :)
Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  7
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}


convertToMeters 0.001; //This gives you the scale: 0.001 would mean all units in this file are [mm] / 1 units in the stl [m]





xmin 0;
xmax 8;
ymin 0;
ymax 8;
zmin 0;
zmax 51;





deltax 0.1;
deltay 0.1;
deltaz 0.1;

lx #calc "$xmax - $xmin";
ly #calc "$ymax - $ymin";
lz #calc "$zmax - $zmin";

xcells #calc "round( $lx / $deltax )";
ycells #calc "round( $ly / $deltay )";
zcells #calc "round( $lz / $deltaz )";


vertices
(
//BLOCK 0
($xmin $ymin $zmin) //0
($xmax $ymin $zmin) //1
($xmax $ymax $zmin) //2
($xmin $ymax $zmin) //3
($xmin $ymin $zmax) //4
($xmax $ymin $zmax) //5
($xmax $ymax $zmax) //6
($xmin $ymax $zmax) //7
);


blocks
        (
        hex (0 1 2 3 4 5 6 7) ($xcells $ycells $zcells) simpleGrading (1 1 1)
        );

edges
        (
        );
boundary
(
symmetryPlane_1 //buttom
        {
        type symmetryPlane;
        faces
        (
            (4 5 1 0)
        );
        }
symmetryPlane_2 //back
        {
        type symmetryPlane;
        faces
        (
            (7 4 0 3)
        );
        }
wall_1  //front
        {
        type wall;
        faces
        (
            (2 1 5 6)
        );
        }
wall_2  //top
        {
        type wall;
        faces
        (
            (3 2 6 7)
        );
        }
outlet //Right
        {
        type patch;
        faces
        (
            (7 6 5 4)
        );
        }
inlet //left
        {
        type patch;
        faces
        (
            (2 3 0 1)
        );
        }
);

well with some help, i found the solution! i leave the post for anyone else that has this issue:
I installed some things for ubuntu and solved everything:
sudo apt-get update -y

sudo apt-get install -y make

sudo apt-get install build-essential

TommyLW October 21, 2022 05:20

I've met the same problem today, and the re-installation of make didn't help.

I solved this issue by using ' #eval{ }; ' expression replacing all the ' #calc " "; ' expressions in blockMeshDict.

otaolafr October 21, 2022 05:26

Quote:

Originally Posted by TommyLW (Post 837953)
I've met the same problem today, and the re-installation of make didn't help.

I solved this issue by using ' #eval{ }; ' expression replacing all the ' #calc " "; ' expressions in blockMeshDict.

uff.... quiet old thread... forgot to post the solution, yes i did the same. nevertheless, it is important to notice that #eval is only for the .com version
best regards


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