|
[Sponsors] |
November 25, 2016, 11:48 |
OpenFoam 4.1 - writing force coefficients
|
#1 |
New Member
Robbie Collison
Join Date: Apr 2013
Posts: 3
Rep Power: 13 |
Hi, I've recently got back into using OpenFOAM from a 4 year break. Just getting to grips with some simple cases before moving on.
I have a working case using icoFoam for flow around a 2D cylinder. When I introduce forceCoeffs logging on the cylinder within the controlDict, icoFoam will solve until it attempts to write the forceCoeffs values when it fails. The error below comes on Time = 0.1 (note, simulation timestep = 0.01). It seems odd to me but the error occurs when the transportProperties file is executed. Please note the simulation runs with no errors when I do not attempt to log the forceCoeffs. Any thoughts on this would be great. Thanks. --> FOAM FATAL IO ERROR: wrong token type - expected word, found on line 20 the punctuation token '[' file: /home/ubuntu/OpenFoam_Tutorials/cylinder_flow/2Dico/constant/transportProperties.nu at line 20. From function Foam::Istream& Foam:perator>>(Foam::Istream&, Foam::word&) in file primitives/strings/word/wordIO.C at line 74. FOAM exiting My controlDict is as follows: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.6 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object controlDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // application icoFoam; startFrom startTime; startTime 0; stopAt endTime; endTime 1.5; deltaT 0.01; writeControl timeStep; writeInterval 10; purgeWrite 0; writeFormat ascii; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable true; functions { forceCoefficients { type forceCoeffs; writeControl timeStep; writeInterval 10; libs ("libforces.so"); patches (cylinder); rho rhoInf; rhoInf 1025; log yes; CoR (0 0 0); dragDir (1 0 0); liftDir (0 1 0); pitchAxis (0 0 1); magUInf 1.0; lRef 1.0; Aref 50.26548246; origin (0 0 0); coordinateRotation { type EulerRotation; degrees true; rotation (0 0 0); } } } // ************************************************** *********************** // |
|
November 25, 2016, 15:02 |
|
#2 |
Senior Member
|
I think in your transportProperties File you have:
nu [ 0 2 -1 0 0 0 0] 1e-05; // or similar when it really should be: nu nu[ - 2 -1 0 0 0 0] 1e-05; Basically you are missing one "nu", I think. Regards Shereez |
|
November 26, 2016, 03:05 |
|
#3 |
Member
Vu
Join Date: Nov 2016
Posts: 42
Rep Power: 9 |
what version of OF are you using?
Last time when i imported forces function into controlDict, using OF4.0, i encountered the error "rho not found" eventhough that case ran smoothly on OF3.0.0. So your problem is possibly caused by OF version i guess, since the transportProperties is so simple and it is not supposed to be wrong. You should try another version of OF! |
|
November 28, 2016, 04:43 |
|
#4 |
Member
jey
Join Date: Nov 2016
Location: Greece
Posts: 30
Rep Power: 9 |
Hello robbiecollison
Could you please post the transportProperties file? Could you also consider changing the density you are using into the forceCoeffs cause it seems that by mistake you have entered a too high value. Can not be sure if that is the problem but I think that nu is somehow connected with rho. Kind regards |
|
November 28, 2016, 05:38 |
|
#5 |
New Member
Robbie Collison
Join Date: Apr 2013
Posts: 3
Rep Power: 13 |
Thank you very much Shereez, after amending my transportProperties file as you suggested, the drag coefficients are now exported.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[mesh manipulation] How to write cellSet for different regions in constant/polyMesh/sets | Struggle_Achieve | OpenFOAM Meshing & Mesh Conversion | 3 | June 17, 2019 09:29 |
OpenFOAM v3.0+ ?? | SBusch | OpenFOAM | 22 | December 26, 2016 14:24 |
OpenFOAM 4.1 Released | CFDFoundation | OpenFOAM Announcements from OpenFOAM Foundation | 0 | October 13, 2016 06:42 |
Suggestion for a new sub-forum at OpenFOAM's Forum | wyldckat | Site Help, Feedback & Discussions | 20 | October 28, 2014 09:04 |
Density for calculating Force Coefficients | ste_lakey | CFX | 2 | September 19, 2005 04:35 |