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

Problem declaring PtrList<autoPtr<phaseChangeTwoPhaseMixture> >

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By zhengzh5

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 17, 2014, 18:43
Default Problem declaring PtrList<autoPtr<phaseChangeTwoPhaseMixture> >
  #1
Member
 
Jace
Join Date: Oct 2012
Posts: 77
Rep Power: 15
zhengzh5 is on a distinguished road
Hi,

Does anyone have experience combining chtMultiRegionFoam with InterPhaseChangeFoam?

Following outlines what I have done so far:
1. replace the source codes within chtMultiRegionFoam/fluid with the source codes from interPhaseChangeFoam
2. change interPhaseChangeFoam.C to solveFluid.C and cleaned up some header and makefile entries
3. In createFluidFields.H I have:

Code:
PtrList<volScalarField> p_rghFluid(fluidRegions.size());
PtrList<volVectorField> UFluid(fluidRegions.size());
PtrList<surfaceScalarField> phiFluid(fluidRegions.size());
PtrList<autoPtr<phaseChangeTwoPhaseMixture> > twoPhasePropertiesFluid(fluidRegions.size());

PtrList<volScalarField> rhoFluid(fluidRegions.size());

forAll(fluidRegions, i)
{
  Info<<"Reading field p_rgh\n" <<endl;
 p_rghFluid.set
   (
    i,
    new volScalarField
    (
     IOobject
     (
      "p_rgh",
      runTime.timeName(),
      fluidRegions[i],
      IOobject::MUST_READ,
      IOobject::AUTO_WRITE
      ),
     fluidRegions[i]
     )
    );
//define other fields as needed
4. In setRegionFluidFields.H I have:
Code:
fvMesh& mesh = fluidRegions[i];
pimpleControl pimple(mesh);

volScalarField& p_rgh = p_rghFluid[i];
volVectorField& U = UFluid[i];
surfaceScalarField& phi = phiFluid[i];

autoPtr<phaseChangeTwoPhaseMixture> twoPhaseProperties = twoPhasePropertiesFluid[i];

volScalarField& alpha1 = twoPhaseProperties->alpha1();
volScalarField& alpha2 = twoPhaseProperties->alpha2();
const dimensionedScalar rho1 = twoPhaseProperties->rho1();
const dimensionedScalar rho2 = twoPhaseProperties->rho2();
volScalarField& rho = rhoFluid[i];
The problem is, when I compile the code, I get the following error:
Code:
In file included from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/tmp.H:143:0,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/PtrListI.H:29,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/PtrList.H:321,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/List.C:30,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/List.H:259,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/labelList.H:48,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/UPstream.H:43,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/Pstream.H:42,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/parRun.H:35,
                 from /home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/finiteVolume/lnInclude/fvCFD.H:4,
                 from chtMultiRegionInterFoam.C:37:
/home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/tmpI.H: In destructor ‘Foam::tmp<T>::~tmp() [with T = Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>]’:
./fluid/createFluidFields.H:83:5:   instantiated from here
/home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/tmpI.H:108:9: error: ‘class Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>’ has no member named ‘okToDelete’
/home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/tmpI.H:115:13: error: ‘class Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>’ has no member named ‘operator--’
/home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/tmpI.H: In member function ‘T* Foam::tmp<T>::ptr() const [with T = Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>]’:
/home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/PtrListI.H:116:47:   instantiated from ‘Foam::autoPtr<T> Foam::PtrList<T>::set(Foam::label, const Foam::tmp<T>&) [with T = Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>, Foam::label = int]’
./fluid/createFluidFields.H:83:5:   instantiated from here
/home/gandalf/OpenFOAM/OpenFOAM-2.2.x/src/OpenFOAM/lnInclude/tmpI.H:159:10: error: ‘class Foam::autoPtr<Foam::phaseChangeTwoPhaseMixture>’ has no member named ‘resetRefCount’
then I thought maybe I'm not supposed to use PtrList and autoPtr together, so I tried:
Code:
In createFluidFields.H
PtrList<phaseChangeTwoPhaseMixture> twoPhasePropertiesFluid(fluidRegions.size());

and setRegionFluidFields.H
phaseChangeTwoPhaseMixture& twoPhaseProperties = twoPhasePropertiesFluid[i];
instead, but this gives me problem with

Code:
interfaceProperties interface(alpha1, U, twoPhaseProperties());

autoPtr<incompressible::turbulenceModel> turbulence
(
 incompressible::turbulenceModel::New(U, phi, twoPhaseProperties())
 );
because it doesn't recognize the twoPhaseProperties() anymore.

Does anyone have any suggestions related to how I can go about solving this problem. Thanks for your helps in advance!

Regards,

Jace
mizzou likes this.
zhengzh5 is offline   Reply With Quote

Old   August 16, 2015, 17:22
Default
  #2
Member
 
Mahdi
Join Date: Jul 2012
Posts: 53
Rep Power: 13
Mahdi2010 is on a distinguished road
Did you already find the solution for this issue?
Mahdi2010 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
area does not match neighbour by ... % -- possible face ordering problem St.Pacholak OpenFOAM 10 February 7, 2024 21:50
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 04:43
Problem in implementing cht tilek CFX 3 May 8, 2011 08:39
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 06:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 19:13


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