CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Programming & Development

Error: Invalid Initialization

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

Like Tree1Likes
  • 1 Post By matari

LinkBack Thread Tools Display Modes
Old   September 3, 2012, 05:45
Default Error: Invalid Initialization
New Member
Join Date: Jul 2012
Posts: 11
Rep Power: 7
matari is on a distinguished road

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)

new DimensionedField<scalar, volMesh>
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 is offline   Reply With Quote

Old   September 3, 2012, 09:12
New Member
Join Date: Jul 2012
Posts: 11
Rep Power: 7
matari is on a distinguished road
Hi again,

I modified the line in my setRegionFluidFields.H:

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

Now it compiles without errors.
Hanzo likes this.
matari is offline   Reply With Quote

Old   November 14, 2012, 01:48
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 8
Hanzo is on a distinguished road
Hey Matari,

I also currently work on different chemical reactions for different regions.
I am still wondering if I should use the chtMultiRegionFoam because I am not interested in fluid-solid but only fluid-fluid coupling. I simply need the multi region feature.

Let's assume one has two fluid zones with different reactions. How do you define the interface boundaries between the regions for the species?
Hanzo is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
FMG initialization query Mohsin FLUENT 6 November 2, 2016 03: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 16:14
Mesh Initialization shakked Main CFD Forum 2 August 7, 2004 22:50

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