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

[OpenFOAM.com] can't use #calc functions after installation W10

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By TommyLW

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2020, 15:00
Unhappy can't use #calc functions after installation W10
  #1
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compičgne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
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:

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

Last edited by otaolafr; April 24, 2020 at 04:35. Reason: solve the issue...
otaolafr is offline   Reply With Quote

Old   October 21, 2022, 06:20
Default
  #2
New Member
 
Jinghan WANG
Join Date: Mar 2022
Posts: 2
Rep Power: 0
TommyLW is on a distinguished road
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 likes this.
TommyLW is offline   Reply With Quote

Old   October 21, 2022, 06:26
Default
  #3
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compičgne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by TommyLW View Post
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
otaolafr is offline   Reply With Quote

Reply

Tags
blockmesh, openfoam instalation

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[SOWFA] SOWFA installation OpenFOAM 2.4.x OpenFAST mörli OpenFOAM Community Contributions 6 July 29, 2020 13:48
Objective functions khavart SU2 Shape Design 3 June 11, 2019 08:01
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
Installation problems shellbell1999 OpenFOAM Installation 9 April 6, 2006 14:29
N-S equations:divergence free functions? D. Puigjaner Main CFD Forum 1 July 27, 2000 13:43


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