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

OpenFoam 4.1 - writing force coefficients

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2016, 11:48
Default OpenFoam 4.1 - writing force coefficients
  #1
New Member
 
Robbie Collison
Join Date: Apr 2013
Posts: 3
Rep Power: 13
robbiecollison is on a distinguished road
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);
}
}
}

// ************************************************** *********************** //
robbiecollison is offline   Reply With Quote

Old   November 25, 2016, 15:02
Default
  #2
Senior Member
 
shereez234's Avatar
 
M Sereez
Join Date: Jan 2014
Location: England
Posts: 352
Blog Entries: 1
Rep Power: 13
shereez234 is on a distinguished road
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
shereez234 is offline   Reply With Quote

Old   November 26, 2016, 03:05
Default
  #3
Member
 
Vu
Join Date: Nov 2016
Posts: 42
Rep Power: 9
DoQuocVu is on a distinguished road
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!
DoQuocVu is offline   Reply With Quote

Old   November 28, 2016, 04:43
Default
  #4
Member
 
jey
Join Date: Nov 2016
Location: Greece
Posts: 30
Rep Power: 9
jeytsav is on a distinguished road
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
jeytsav is offline   Reply With Quote

Old   November 28, 2016, 05:38
Default
  #5
New Member
 
Robbie Collison
Join Date: Apr 2013
Posts: 3
Rep Power: 13
robbiecollison is on a distinguished road
Thank you very much Shereez, after amending my transportProperties file as you suggested, the drag coefficients are now exported.
robbiecollison 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
[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


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