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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 3, 2012, 06:45
Default Error: Invalid Initialization
  #1
New Member
 
Join Date: Jul 2012
Posts: 11
Rep Power: 14
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

Old   September 3, 2012, 10:12
Default
  #2
New Member
 
Join Date: Jul 2012
Posts: 11
Rep Power: 14
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
Default
  #3
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 15
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

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


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