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

Calling twophasemixture member function

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

Like Tree2Likes
  • 2 Post By styleworker

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2013, 12:43
Default Calling twophasemixture member function
  #1
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 14
styleworker is on a distinguished road
Hello foamers!

I'm quite familiar with using OpenFoam, but now I want to go further and learn more about programming in OF. At the moment I'm playing around with MRconjugateHeatFoam. I tried to extend it to a two phase flow solver, but I'm not able to call the twoPhaseProperties function.

This part of the boundary function is of interest:
HTML Code:
Foam::tmp<Foam::scalarField>
Foam::regionCoupleTemperatureFvPatchScalarField::flux() const
{

    const dimensionedScalar& rho1 = twoPhaseProperties.rho1();

    const fvPatchScalarField& T = *this;

    return rho1.value()*T.snGrad();
}
At the beginning of the file, the header file twoPhaseMixture.H is included. Somehow I'm getting the error: »twoPhaseProperties« is not defined

Did I included the wrong header file?
styleworker is offline   Reply With Quote

Old   September 25, 2013, 20:01
Default
  #2
Senior Member
 
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17
sharonyue is on a distinguished road
I think you should construct transportProperties like this :
Code:
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi);
If I am wrong correct me pls.
sharonyue is offline   Reply With Quote

Old   September 26, 2013, 08:43
Default
  #3
Member
 
Join Date: May 2012
Posts: 55
Rep Power: 14
styleworker is on a distinguished road
Thank you for your reply. Indeed you're right.

It seems incompressibleTwoPhaseMixture was renamed to twoPhaseMixture in OF. In my case (OF-2.2.0) it should be:

Code:
twoPhaseMixture twoPhaseProperties(U, phi,"alpha1");
Certainly the U-, and phi-field has to be defined/read:
Code:
const volVectorField& U = db().lookupObject<volVectorField>("U");
const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>("phi");
The complete code-snippet:
Code:
Foam::tmp<Foam::scalarField>
Foam::regionCoupleTemperatureFvPatchScalarField::flux() const
{
    const volVectorField& U = db().lookupObject<volVectorField>("U");
    const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>("phi");    
    twoPhaseMixture twoPhaseProperties(U, phi,"alpha1");

    const dimensionedScalar& rho1 = twoPhaseProperties.rho1();
    const fvPatchScalarField& T = *this; 
    return rho1.value()*T.snGrad();
}
sharonyue and ahmmedshakil like this.

Last edited by styleworker; September 26, 2013 at 14:01.
styleworker is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 08:53
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51
[OpenFOAM] LibvtkFoamso fred ParaView 2 November 18, 2005 19:01


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