|
[Sponsors] |
September 25, 2013, 12:43 |
Calling twophasemixture member function
|
#1 |
Member
Join Date: May 2012
Posts: 55
Rep Power: 14 |
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();
}
Did I included the wrong header file? |
|
September 25, 2013, 20:01 |
|
#2 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 838
Rep Power: 17 |
I think you should construct transportProperties like this :
Code:
incompressibleTwoPhaseMixture twoPhaseProperties(U, phi); |
|
September 26, 2013, 08:43 |
|
#3 |
Member
Join Date: May 2012
Posts: 55
Rep Power: 14 |
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"); Code:
const volVectorField& U = db().lookupObject<volVectorField>("U"); const surfaceScalarField& phi = db().lookupObject<surfaceScalarField>("phi"); 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(); } Last edited by styleworker; September 26, 2013 at 14:01. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |