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

How can I refer to gas constant?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 5, 2016, 00:44
Default How can I refer to gas constant?
  #1
Member
 
Join Date: Jul 2015
Posts: 33
Rep Power: 10
KeiJun is on a distinguished road
Dear Sir,

I am trying customizing the reactingFoam solver that I put an equation including gas constant R() in the YEqn.H.

I think gas constant R() and molecular weight W() are in "specieI.H",
so I discribe the equation to "specie->R()".

However, when I compile my new solver,
the message "'specie' was not declared in this scope" has occur and cannot compile.

How can I do to refer to gas constant?


Sincerely,
KeiJun
KeiJun is offline   Reply With Quote

Old   January 5, 2016, 04:40
Default
  #2
Member
 
Yan Wang
Join Date: May 2015
Location: Beijing
Posts: 41
Rep Power: 10
wayne14 is on a distinguished road
Quote:
Originally Posted by KeiJun View Post
Dear Sir,

I am trying customizing the reactingFoam solver that I put an equation including gas constant R() in the YEqn.H.

I think gas constant R() and molecular weight W() are in "specieI.H",
so I discribe the equation to "specie->R()".

However, when I compile my new solver,
the message "'specie' was not declared in this scope" has occur and cannot compile.

How can I do to refer to gas constant?


Sincerely,
KeiJun
Hi,

Have you tried the methods in this thread?

Regards,
Yan
wayne14 is offline   Reply With Quote

Old   January 5, 2016, 19:40
Default
  #3
Member
 
Join Date: Jul 2015
Posts: 33
Rep Power: 10
KeiJun is on a distinguished road
Hi Yan,

I have never read the thread you show, and now read it.
But I don't understand the thread very much.

Tentatively, I write the following code to createFields.H of my new solver:
#include "specie.H"
specie theSpecie(thermoProps.subDict("mixture"));

When I compile it, the following message are shown:
~/specieI.H:30.1: error: 'namespace' definition is not allowed here
namespace Foam

createFields.H: error: 'specie' was not declared in this scope
specie theSpecie(thermoProps.subDict("mixture"));

What should I do?


KeiJun
KeiJun is offline   Reply With Quote

Old   January 7, 2016, 18:54
Default
  #4
Member
 
Join Date: Jul 2015
Posts: 33
Rep Power: 10
KeiJun is on a distinguished road
Dear Sir,

I keep trying making my solver, but cannot compile.

Now I customize the source code like this:
・put #include "specie.H" to myReactionFoam.C
  ・put equations including R or W to createFields.H
  ・the R or W are written such as specie::R() or specie::W()

However, when I compile this solver, the error message
cannot call member function 'Foam::scalar Foam::specie::R() const' without object
has come.

Here, the equations I want to add are the partial pressures of each component.
Then, each partial pressure is defined such as volScalarField pN2 in the createFields.H, and these are calculated from the total pressure p, the partial density ρN2 (= ρ*Y[i]), R and the temperature T at each time and each cell.

I think R and W are calculated in specieI.H and the class of which is specie, so I descibe specie::R(), but the error mensioned above has come.


Could you teach me how to describe?
I am really looking forward to your reply.


Sincerely,

KeiJun
KeiJun 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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 05:38
mass flow in is not equal to mass flow out saii CFX 12 March 19, 2018 05:21
fluid flow but temperature raises from nowhere? mxcfd STAR-CCM+ 5 September 16, 2014 05:46
Ideal gas problem Atze CFX 12 March 20, 2014 15:56
Error message when model as constant gas Anna Tian FLUENT 0 January 14, 2014 05:33


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