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

How to convert psiChemistryModel for multi Zone?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 21, 2012, 03:17
Default How to convert psiChemistryModel for multi Zone?
  #1
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 15
Hanzo is on a distinguished road
Hello,

I am currently working on a code to use chemistry in different zones. I started with chtMultiRegionFoam solver as basis source code. I basically try to realize chemFoam behavior for all fluid zones (solid zones are removed completely).

So far, I managed to read initial conditions, chemKin input files and chemistry properties for each region. The next step is to create an instance of psiChemistryModel for each region. In chemFoam (or rhoReactionFoam) this is done doing the following:

http://foam.sourceforge.net/docs/cpp/a03249_source.html
Code:
00026     Info<< nl << "Reading thermophysicalProperties" << endl;
00027     autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(mesh));
So in a regional context the variable mesh should be replaced by the mesh of the current region which is stored as fluidRegions[i]
Code:
autoPtr<psiChemistryModel> pChemistry(psiChemistryModel::New(fluidRegions[i]));
Compiling works fine but when OpenFoam initiates the chemistryReader I get a floating point exception:

Code:
Reading initial conditions.

    Adding to YdefaultFluid

Selecting psiChemistryModel ODEChemistryModel<gasThermoPhysics>

Selecting thermodynamics package hsPsiMixtureThermo<reactingMixture<gasThermoPhysics>>

Selecting chemistryReader chemkinReader

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/libc.so.6"
#3  Foam::fvPatchField<double>::operator/=(Foam::fvPatchField<double> const&) in "/home/florian/OpenFOAM/florian-2.0.x/platforms/linux64GccDPOpt/bin/multiRegionChemFoam"
#4  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::operator/=(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#5  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > >::correctMassFractions() in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#6  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > >::multiComponentMixture(Foam::dictionary const&, Foam::List<Foam::word> const&, Foam::HashPtrTable<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > >, Foam::word, Foam::string::hash> const&, Foam::fvMesh const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#7  Foam::reactingMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > >::reactingMixture(Foam::dictionary const&, Foam::fvMesh const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#8  Foam::hsPsiMixtureThermo<Foam::reactingMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > > >::hsPsiMixtureThermo(Foam::fvMesh const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#9  Foam::hsCombustionThermo::addfvMeshConstructorToTable<Foam::hsPsiMixtureThermo<Foam::reactingMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > > > >::New(Foam::fvMesh const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#10  Foam::hsCombustionThermo::NewType(Foam::fvMesh const&, Foam::word const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libreactionThermophysicalModels.so"
#11  Foam::psiChemistryModel::psiChemistryModel(Foam::fvMesh const&, Foam::word const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#12  Foam::ODEChemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > >::ODEChemistryModel(Foam::fvMesh const&, Foam::word const&, Foam::word const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#13  Foam::ode<Foam::ODEChemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > > >::ode(Foam::fvMesh const&, Foam::word const&, Foam::word const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#14  Foam::psiChemistryModel::addfvMeshConstructorToTable<Foam::ode<Foam::ODEChemistryModel<Foam::psiChemistryModel, Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > > > >::New(Foam::fvMesh const&, Foam::word const&, Foam::word const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#15  Foam::psiChemistryModel::New(Foam::fvMesh const&) in "/opt/OpenFOAM/OpenFOAM-2.0.x/platforms/linux64GccDPOpt/lib/libchemistryModel.so"
#16  
 in "/home/florian/OpenFOAM/florian-2.0.x/platforms/linux64GccDPOpt/bin/multiRegionChemFoam"
#17  __libc_start_main in "/lib/libc.so.6"
#18  
 in "/home/florian/OpenFOAM/florian-2.0.x/platforms/linux64GccDPOpt/bin/multiRegionChemFoam"
浮動小数点例外
I assume that the call psiChemistryModel::New(fluidRegions[i]) uses the appropriate region mesh but does not load T,p, and Y fields from the $CASE_DIR/0/region/ folder.

In chtMultiRegionFoam there is an analog line where the current region mesh is plugged into a constructor of similar type (it only takes a const mesh as input):

http://foam.sourceforge.net/docs/cpp/a02601_source.html
Code:
00029         thermoFluid.set
00030 (
00031             i,
00032             basicRhoThermo::New(fluidRegions[i]).ptr() 
00033         );
except that here the result is stored in a pointer list.

So I wonder if anybody has an idea why I cannot do this in the same manner for the psiChemistryModel constructor.

Any hints or comments are highly appreciated.
Hanzo is offline   Reply With Quote

Old   November 21, 2012, 05:16
Default Reason found
  #2
Member
 
Join Date: Nov 2010
Location: Tokyo / Japan
Posts: 40
Rep Power: 15
Hanzo is on a distinguished road
Looks like I found the reason for my floating point error

First of all, the constructor for psiChemistryModel can be used for zonal calculations in the same way as for example basicRhoThermo.

What actually caused the problems were zero boundary values. On the interface boundary between my regions, I had zero values for the species in the field Ydefault.
So setting this to zeroGradient or any nonzeroValue solved the problem.

I realised that for a boundary I cannot define all species to be zero.
Looking at line 5 of my previously posted error message
Code:
#5  Foam::multiComponentMixture<Foam::sutherlandTransport<Foam::specieThermo<Foam::janafThermo<Foam::perfectGas> > > >::correctMassFractions()
At a certain point in the code the sum of all Yi is taken and then Y are corrected by a similar computation like Yi = Yi/Ytot.
Hanzo is offline   Reply With Quote

Reply

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
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 11:52
[ICEM] Export ICEM mesh to Gambit / Fluent romekr ANSYS Meshing & Geometry 1 November 26, 2011 13:11
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 18:51
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 02:08
Sliding mesh error Karl Kevala FLUENT 4 February 21, 2001 16:52


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