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

PtrList of the volScalarField& in OF4.1

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2019, 03:26
Default PtrList of the volScalarField& in OF4.1
  #1
New Member
 
Yeongshin Jeong
Join Date: Jul 2015
Posts: 1
Rep Power: 0
ysjeong is on a distinguished road
Hi everyone,

I'd like to ask all you guys in OpenFOAM4.1 new solver development, combining cht solver (chtMultiRegionFoam) and VOF solver (interPhaseChangeFoam).

For alpha 1 and alpha2 declared in createFields.H of interPhaseChangeFoam,
autoPtr<phaseChangeTwoPhaseMixture> mixture =
phaseChangeTwoPhaseMixture::New(U, phi);
volScalarField& alpha1(mixture->alpha1());
volScalarField& alpha2(mixture->alpha2());

I want to declare the PtrList for chtMultiRegionFoam as;
PtrList<autoPtr<phaseChangeTwoPhaseMixture>> mixtureFluid(fluidRegions.size());
PtrList<volScalarField> alpha1Fluid(fluidRegions.size());
PtrList<volScalarField> alpha2Fluid(fluidRegions.size());

then,
autoPtr<phaseChangeTwoPhaseMixture> mixtureFluid[i]= myphaseChangeTwoPhaseMixture::New(UFluid[i],phiFluid[i]);

alpha1Fluid.set
(
i,
new volScalarField
(
IOobject
(
"alpha1",
runTime.timeName(),
fluidRegions[i],
IOobject::READ_IF_PRESENT
),
mixtureFluid[i]->alpha1()
)
);

At this moment, compiling is perfectly working but when I want to run the case, I got the error message at the early stage of running as;

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2 ? in "/lib/x86_64-linux-gnu/libc.so.6"
#3 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary::Boundary(Foam:imension edField<double, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::Boundary const&) at ??:?
#4 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::IOobject const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#5 ? at ??:?
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? at ??:?



Does anyone have some ideas on solving this problem?
And, is there any differences in declaring the volScalarField and volScalarField& for pointer list form?

Any comments are welcome!!
ysjeong is offline   Reply With Quote

Reply

Tags
mixture, openfoam, ptrlist

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
How to address a certain region in solver? mizo OpenFOAM Programming & Development 3 September 11, 2019 11:03
[OpenFOAM.org] Problems installing OF4.1 in Kubuntu 14.04 Outbound OpenFOAM Installation 5 February 2, 2017 07:54
Temperature linearly rising after restarting a simulation Gennaro OpenFOAM Programming & Development 2 September 2, 2014 07:58
Newbie Question on PtrList usage chyczewski OpenFOAM Programming & Development 6 October 1, 2013 16:39
PtrList of surfaceScalarFields -> destructor problem? dohnie OpenFOAM Programming & Development 3 October 28, 2011 17:16


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