CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Initialization of IOobject

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

LinkBack Thread Tools Display Modes
Old   January 14, 2013, 16:55
Default Initialization of IOobject
New Member
Join Date: May 2012
Posts: 17
Rep Power: 7
boeleman is on a distinguished road
Dear FOAMers,

I am working to implement the pinning force on a droplet resulting from contact angle hysteresis. With this force implemented it would, for example, be possible to simulate a small droplet sticking to an inclined or vertical wall. However, I am having problems with the implementation and I am hoping some one knows what I am doing wrong. The equation I want to add has the form F = sigma (cos(Theta) - cos(Theta_e)), where sigma is the surface tension, Theta is the actual contact angle, and Theta_e is the equilibrium contact angle. To this end I decided to define a parameter called cosTheta in the interfaceProperties library, which will be used in my solver. I decided to model this new parameter after the existing parameter K (curvature) and added the following lines:


volScalarField cosTheta_;

const volScalarField& cosTheta() const
return cosTheta_;



dimensionedScalar("cosTheta", dimless, 0.0)

I.e. I exactly copied the lines for K and K_, but replaced K with cosTheta and made it dimensionless. This code compiles fine but crashes at the end when running it. Running my code with Valgrind gives the error: "Uninitialised value was created by a stack allocation". This makes me thing that my variable is not initialized, and that OpenFoam tries to destruct an uninitialized value and crashes. Does anyone have any idea how an IOobject gets initialized and how I can get rid of this crash?


boeleman is offline   Reply With Quote

Old   January 15, 2013, 15:27
New Member
Join Date: May 2012
Posts: 17
Rep Power: 7
boeleman is on a distinguished road
Found the solution. I compiled my library with wmake lib instead of wmake libso.
boeleman is offline   Reply With Quote


constructor, contact angle hysteresis, destructor, initialize, ioobject

Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
FMG initialization query Mohsin FLUENT 6 November 2, 2016 03:02
reconstructParMesh not working with an axisymetric case francesco OpenFOAM Bugs 4 May 8, 2009 05:49
Saving Patch cell centres as an IOobject jaswi OpenFOAM Running, Solving & CFD 4 June 27, 2007 10:01
Saving patch motion as an IOobject jaswi OpenFOAM Running, Solving & CFD 1 June 26, 2007 13:07
compressor initialization paglia FLUENT 0 February 1, 2006 16:14

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