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

Reaction rate depending on the temperature field

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   January 9, 2014, 04:48
Default Reaction rate depending on the temperature field
  #1
Member
 
Thamali
Join Date: Jul 2013
Posts: 67
Rep Power: 12
Thamali is on a distinguished road
Hi all,
I am trying to apply a reaction rate depending on the temperature of the solid phase for my new solver.
After runnig "wmake" it shows some errors.Can someone help me on finding the error.
my code is to calculate the "dryingRate" depending on the temperature.
  • when temperature(ts)<373K
dryingRate=scalar(6)*massTransCoeff*(Ymoist*rhos]-YH2O*rho)/F;

  • when temperature =373K
dryingRate=scalar(6)*(convectiveHeatTransCoeff *(tg -ts)+scalar(0.9)*stephBoltz*(pow(298.15,4)-pow(ts ,4)))/(F*VapHeat);
  • when temperature >373K
dryingRate=0

my code is as follows,

forAll(ts,celli) //ts is a volScalarField
{
if(ts[celli]<hunderdCel.value()) //this is 373K
{dimensionedScalar dryingRate[celli]=scalar(6)*massTransCoeff[celli]*(Ymoist[celli]*rhos[celli]-YH2O[celli]*rho)/F;
//return dryingRate[celli];
}
else if(ts[celli]=(hunderdCel.value()))
{

dimensionedScalar dryingRate[celli]=scalar(6)*(convectiveHeatTransCoeff[celli] *(tg[celli] -ts[celli] )+scalar(0.9)*stephBoltz*(pow(298.15,4)-pow(ts[celli] ,4)))/(F*VapHeat);
//return dryingRate[celli];
}
//else(ts[celli]>hunderdCel.value());
else
{dimensionedScalar dryingRate=Zero;}
//return dryingRate[celli];}

}


please see whether can someone find the error.The error is as follows,

createFields.H:1046:115: error: variable-sized object ‘dryingRate’ may not be initialized
{dimensionedScalar dryingRate[celli]=scalar(6)*massTransCoeff[celli]*(Ymoist[celli]*rhos[celli]-YH2O[celli]*rho)/F;
^
createFields.H:1046:21: warning: unused variable ‘dryingRate’ [-Wunused-variable]
{dimensionedScalar dryingRate[celli]=scalar(6)*massTransCoeff[celli]*(Ymoist[celli]*rhos[celli]-YH2O[celli]*rho)/F;
^
createFields.H:1049:40: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
else if(ts[celli]=(hunderdCel.value()))
^
createFields.H:1052:174: error: variable-sized object ‘dryingRate’ may not be initialized
dimensionedScalar dryingRate[celli]=scalar(6)*(convectiveHeatTransCoeff[celli] *(tg[celli] -ts[celli] )+scalar(0.9)*stephBoltz*(pow(298.15,4)-pow(ts[celli] ,4)))/(F*VapHeat);
^
createFields.H:1052:20: warning: unused variable ‘dryingRate’ [-Wunused-variable]
dimensionedScalar dryingRate[celli]=scalar(6)*(convectiveHeatTransCoeff[celli] *(tg[celli] -ts[celli] )+scalar(0.9)*stephBoltz*(pow(298.15,4)-pow(ts[celli] ,4)))/(F*VapHeat);
^

Thanks in advance.

Thamali 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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
field function for reaction rate Mr.Hack STAR-CCM+ 3 June 3, 2016 03:29
Mass Flow Rate Custom Field Function AJoubert FLUENT 2 March 23, 2013 08:50
write forward, reverse reaction coefficient, reaction rate in ChemFoam hismother OpenFOAM Running, Solving & CFD 3 November 7, 2012 03:33
surface reaction rate plot at diffusiion limit cas Jason FLUENT 1 August 22, 2003 04:54


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