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

Error: Invalid Initialization

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By matari

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   September 3, 2012, 05:45
Default Error: Invalid Initialization
  #1
New Member
 
Join Date: Jul 2012
Posts: 11
Rep Power: 13
matari is on a distinguished road
Hi,

I have a mesh with multiple regions and need to solve different chemical reactions in different fluid regions. Therefore I would like to modify the chtMultiRegionFoam solver in a way that it solves chemical reactions in fluid regions. I got the following error during the compilation:


In file included from rhoPorousMultiRegionReactingFoam.C:107:0:
fluid/setRegionFluidFields.H:6:65: error: invalid initialization of reference of type ‘Foam:imensionedField<double, Foam::volMesh>&’ from expression of type ‘double’
make: *** [Make/linux64GccDPOpt/rhoPorousMultiRegionReactingFoam.o] Error 1

In my createFluidFields.H I have for chemistrySh:

PtrList<DimensionedField<scalar, volMesh> > chemistrySh(fluidRegions.size());

forAll(fluidRegions, i)
{
...

chemistrySh.set
(
i,
new DimensionedField<scalar, volMesh>
(
IOobject
(
"chemistry::Sh",
runTime.timeName(),
fluidRegions[i],
IOobject::NO_READ,
IOobject::NO_WRITE
),
fluidRegions[i],
dimensionedScalar("chemistrySh", dimEnergy/dimTime/dimVolume, 0.0)
)
);
...
}

In my setRegionFluidFields.H I added this line that seems to be wrong:

DimensionedField<scalar, volMesh>& chemistrySh = chemistrySh[i];

Can anybody help me to overcome this problem? Thanks in advance for any suggestions,

Matari
matari is offline   Reply With Quote

 


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
FMG initialization query Mohsin FLUENT 6 November 2, 2016 02:02
Initialization problem when using Axisymmetry BC Eduardo FLUENT 0 August 4, 2008 09:23
Initialization a student Siemens 2 May 19, 2006 12:55
compressor initialization paglia FLUENT 0 February 1, 2006 15:14
Mesh Initialization shakked Main CFD Forum 2 August 7, 2004 22:50


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