CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

DimensionedFieldor thermo stuff

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

Reply
 
LinkBack Thread Tools Display Modes
Old   January 29, 2008, 05:40
Default Hi, How can I get hold of t
  #1
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
Hi,

How can I get hold of the boundaryField for the type
const DimensionedField<scalar,volmesh>& T_;

...now why do I want that you ask?
In (for instance)
void fixedEnthalpFvPatchScalarField::updateCoeffs()

there is a lookupObject call for the basicThermo from the database from which it pulls the temperature to
calculate the enthalpy that I would like to get rid of.

const basicThermo& thermo = db().lookupObject<basicthermo>
(
"thermophysicalProperties"
);

fvPatchScalarField& Tw =
const_cast<fvpatchscalarfield&>(thermo.T().boundar yField()[patchi]);

Instead, I'm keeping a reference to the temperature field and would like to use that one, something like

fvPatchScalarField& Tw = ...(T_.boundaryField()[patchi]);

but I cannot figure out how to get the boundaryField from the DimensionedField.


(edit: discussion board is screwing up formatting)
niklas is offline   Reply With Quote

Old   January 29, 2008, 06:00
Default Well, the DimensionedField
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
Well, the DimensionedField<scalar,volmesh> reference has got a name of the field T_. Use that name to do a database lookup, just as you did for basicThermo and you're on velvet

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 29, 2008, 07:27
Default Hmmm, the problem is that I ha
  #3
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
Hmmm, the problem is that I have 2 thermo databases,
one for each phase and if I do a lookup it picks up the same field for both phases, so the problem is still there.
niklas is offline   Reply With Quote

Old   January 29, 2008, 07:43
Default In that case, your database is
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
In that case, your database is screwed up with multiple fields with identical names... which is not healthy. Switch on some checking on the database - it will complain for duplicate entries - and/or find a way to uniquely name all fields.

You're in deep water now

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 29, 2008, 08:45
Default I dont think so, I've modified
  #5
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 19
niklas will become famous soon enough
I dont think so, I've modified the constructor to this

autoPtr<basicthermo> liquidThermo
(
basicThermo::New(mesh, "l", "liquidProperties", p)
);

autoPtr<basicthermo> gasThermo
(
basicThermo::New(mesh, "g", "gasProperties", p)
);


to take care of the name-clashes.

the second argument will be added to every new fieldname so for the gas the names will be Tg, hg etc..
and I call the T and h as usual

volScalarField& hg = gasThermo->h();
const volScalarField& Tg = gasThermo->T();

pressure is created on top level and the thermo just hold a reference.

.. and Im always in deep water
niklas is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAMlnIncludeScalarH many stuff not defined allenzhao OpenFOAM Installation 0 March 19, 2008 10:45
Thermo dictionaries grtabor OpenFOAM Running, Solving & CFD 0 July 7, 2005 13:07
CEA thermo.dat addition Matej CD-adapco 0 June 2, 2004 05:23
xy plot stuff? Jun FLUENT 1 June 24, 2003 20:39
thermo-acoustics prasat Main CFD Forum 1 June 7, 2003 00:04


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