|
[Sponsors] |
August 8, 2006, 04:29 |
If I declare a variable like:
|
#1 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
If I declare a variable like:
const fvPatchVectorField& Up = lookupPatchField<volvectorfield,>("U"); I get Up value from inlet. But it seems like there is no such declaration for heat capacity Cp so that I can also obtain its values at inlet. My question is how I can get Cp values(inlet)? Thanks! |
|
August 8, 2006, 08:59 |
Sorry, here the question chang
|
#2 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
Sorry, here the question changes. If I use janafThermo, the Cp is computed by a function about T. In the code of specieThermo.H, I found:
inline scalar Cp(const scalar T) const; I guess this Cp is computed from T, right? So how do I access Cp(const scalar T)? Thanks! |
|
August 8, 2006, 10:46 |
Here's how I figured it out.
|
#3 |
Member
Fabian Peng Karrholm
Join Date: Mar 2009
Posts: 61
Rep Power: 17 |
Here's how I figured it out.
Go to the solves directory, /OpenFOAM-1.3/applications/solvers Surely, some of the solvers use Cp(T), so let's see if one does with this command: grep Cp * -RI Oh, it turns out, alot of them also use Cpu time, so lets remove those hits: grep Cp * -RI | grep -v Cpu Ahh, the solve dieselEngineFoam uses Cp (which sounds natural), so if you go to combustion/dieselEngineFoam/hEqn.H you'll see an example of how it's used in the code. the chemistryModel chemistry is defined in createFields.H of the same solver. /Fabian |
|
August 9, 2006, 02:43 |
Thanks for your information. B
|
#4 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
Thanks for your information. By the way, I'm using sonicTurbFoam which doesn't have anything to do with combustion. Is there other possibility to get Cp(T)?
If dieselEngineFoam is helpful to my case, but I don't know how to import this chemistry stuff into my code due to my poor C++ knowledge. Could you advise me more, if I want to access Cp(T)? Thank you for your help! |
|
August 9, 2006, 03:31 |
you have to instance an approp
|
#5 |
Member
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 17 |
you have to instance an appropiate (see http://foam.sourceforge.net/doc/Doxygen/html/d2/d3e/classFoam_1_1basicThermo.htm l#a16) 'thermo' object which has a member function 'Cp'
example: autoPtr<hthermo> thermo ( hThermo::New(mesh) ); The class hThermo comes with the following member function: tmp<scalarfield> Cp (const scalarField &T, const label patchi) hth |
|
August 9, 2006, 03:48 |
Thanks! I know what you meant
|
#6 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
Thanks! I know what you meant here. But this Cp is scalarField, I also tried this before, what I got is the Cp values at inlet. I want to use the scalar Cp which I think is defined in specieThermo.H:
inline scalar Cp(const scalar T) const; Is there any way to get this Cp? Thanks again! |
|
August 10, 2006, 03:35 |
I am aware of that this is a C
|
#7 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
I am aware of that this is a C++ problem: given the class template, how to access its member? It is kind of hard for me to handle due to my poor C++ skill. Can somebody show me how to manage to do that? Thanks!
|
|
August 10, 2006, 09:41 |
I tried my way to define an ob
|
#8 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
I tried my way to define an object whose type is specieThermo<class>, that is what I did so far:
first include "specieThermo.H", and declare an object: specieThermo<scalar> test(scalar); I expected the object "test" has the member Cp(T). But it doesn't behave the way I hoped. The error message is: error: request for member 'Cp' in 'Foam::test', which is of non-class type 'Foam::specieThermo<double> ()(Foam::scalar)' Then I tried to output the object "test" to see what I can get. Then the warning showed up: warning: the address of 'Foam::specieThermo<double> Foam::testing(Foam::scalar)', will always evaluate as 'true' What does that mean? I think I did something wrong. So what mistake I did? Please give me some information. Thank you! |
|
August 14, 2006, 04:17 |
I found that there is an examp
|
#9 |
Member
Dihao Tang
Join Date: Mar 2009
Posts: 78
Rep Power: 17 |
I found that there is an example about how to define thermo type in equilibriumFlameT.C, which is:
typedef specieThermo<janafthermo<perfectgas> > thermo; I think that is the thermo type I need to input when I declare an object specieThermo<thermo> test(thermo); So I guess the next step would be declare a thermo object in order to access Cp(T) value. The format is in my opinion: test(objectOfThermo).Cp(T); Am I right? But I don't understand how to create this objectOfThermo and the mechanism behind this. I just guess objectOfThermo should be related to "thermophysicalProperties". I'm very eager to know if I am on the right way, please give some tips! Thanks! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
units for inlet values of contaminant in star-ccm+ | judge | Siemens | 0 | August 13, 2008 08:29 |
How to initialise values for two inlet boundary comndition | 21kalee | OpenFOAM Running, Solving & CFD | 0 | December 26, 2007 05:40 |
Getting Inlet Velocity Values through CCL or User | Shraman | CFX | 3 | May 1, 2007 15:58 |
updating values at inlet boundaries | Stefano | Siemens | 3 | March 20, 2007 11:13 |
Extract Values from ensight formatted data | Fabian | EnSight | 8 | September 13, 2005 14:14 |