|
[Sponsors] |
January 14, 2013, 16:55 |
Initialization of IOobject
|
#1 |
New Member
Join Date: May 2012
Posts: 17
Rep Power: 14 |
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: $(LIB_SRC)/transportModels/interfaceProperties/interfaceProperties.H: volScalarField cosTheta_; const volScalarField& cosTheta() const { return cosTheta_; } and $(LIB_SRC)/transportModels/interfaceProperties/interfaceProperties.C: cosTheta_ ( IOobject ( "cosTheta", alpha1_.time().timeName(), alpha1_.mesh() ), alpha1_.mesh(), 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? Thanks, Arnout |
|
January 15, 2013, 15:27 |
|
#2 |
New Member
Join Date: May 2012
Posts: 17
Rep Power: 14 |
Found the solution. I compiled my library with wmake lib instead of wmake libso.
|
|
Tags |
constructor, contact angle hysteresis, destructor, initialize, ioobject |
|
|
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 06:49 |
Saving Patch cell centres as an IOobject | jaswi | OpenFOAM Running, Solving & CFD | 4 | June 27, 2007 11:01 |
Saving patch motion as an IOobject | jaswi | OpenFOAM Running, Solving & CFD | 1 | June 26, 2007 14:07 |
compressor initialization | paglia | FLUENT | 0 | February 1, 2006 16:14 |