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

crazy problem with #calc and blockMeshDict

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 15, 2021, 16:06
Default crazy problem with #calc and blockMeshDict
  #1
Senior Member
 
Alan w
Join Date: Feb 2021
Posts: 288
Rep Power: 6
boffin5 is on a distinguished road
Hi,
Initially I had a problem with getting #calc to work in a blockMeshDict file. But with suggestions from this forum regarding sudo apt-get updates, I got it to work.
But then, I copied blockMeshDict to a run directory for a different simulation, and it fails again:


"creating block mesh from "system/blockMeshDict" using #calcEntry at line 31 in file "....blockMeshDict" --> FOAM FATAL ERROR
(line 31 is the one with lx #calc, below)


The same Dict file works in one run directory, but not in another one!



This is truly perplexing! I even ran the updates in the new directory, but it didn't help. Any ideas as to this inconsistency?
Here are the lines in blockMeshDict in question:


xmin -3;
xmax 5;
ymin -2;
ymax 2;
zmin 0;
zmax 2;
deltax 0.1; //cell size in meters
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)";

Thanks in advance, Alan





























table {mso-displayed-decimal-separator:"\."; mso-displayed-thousand-separator:"\,";}tr {mso-height-source:auto;}col {mso-width-source:auto;}br {mso-data-placement:same-cell;}td {padding-top:1px; padding-right:1px; padding-left:1px; mso-ignoreadding; color:black; font-size:12.0pt; font-weight:400; font-style:normal; text-decoration:none; font-family:Calibri, sans-serif; mso-font-charset:0; mso-number-format:General; text-align:general; vertical-align:bottom; border:none; mso-background-source:auto; mso-pattern:auto; mso-protection:locked visible; white-space:nowrap; mso-rotate:0;}.xl65 {font-weight:700;}.xl66 {color:#0563C1; text-decoration:underline; text-underline-style:single;}
boffin5 is offline   Reply With Quote

Old   May 15, 2021, 16:12
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Please completely abandon "#calc" and start using "#eval" directive (link) which is faster, cleaner and stable.

I don't see any lexical or semantic problem in the #calcs.

May be the actual problem is that #calc could not be compiled due to some sudo rights, because the error message indicates the first #calc? If that's the case just use #eval since it does not need any compilation (or if you insist on #calc, please ensure that you have proper file rights allowing compilations).

Hope this helps a bit.
HPE is offline   Reply With Quote

Old   July 14, 2023, 08:00
Default
  #3
Member
 
Join Date: Jun 2019
Posts: 41
Rep Power: 7
Voulet is on a distinguished road
Hi.


In case it may help future generations : I had the following error while using #calc :


Code:
--> FOAM FATAL IO ERROR: 
Failed wmake "dynamicCode/_88c28f6ea7aee10af5a41c01cc48ce917ab7d4a3/platforms/linux64GccDPInt32Opt/lib/libcodeStream_88c28f6ea7aee10af5a41c01cc48ce917ab7d4a3.so"


file: /home/user/testOF/testNewSolver/test1:1/system/blockMeshDict from line 17 to line 17.

    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 211.
And it was because the name of my case folder contain "regular like expressions" as it was named test1:1.

I've just named it more normally and it now works.
__________________
« Debugging is what CFD is about. 5 minutes to modify your code, 5 months to find why it does not work anymore. »
Voulet 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
Mass flow rate issue parthigcar OpenFOAM Running, Solving & CFD 2 April 12, 2021 12:03
Simulation of a small element of a Hydrodynamic Journal Bearing in Wind Energy Appln Anuraag OpenFOAM 0 February 24, 2021 10:03
[BlockMesh] Problem with blockMesh internal faces parthigcar Main CFD Forum 0 January 20, 2021 07:10
[blockMesh] Creating an axisymmetric piston cylinder in blockMeshDict foadsf OpenFOAM Meshing & Mesh Conversion 9 August 23, 2018 08:54
[blockMesh] blockMesh with parametric mesh. Unusual and unseen problem 13msmemusman OpenFOAM Meshing & Mesh Conversion 1 June 13, 2016 03:25


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