|
[Sponsors] |
![]() |
![]() |
#1 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 30 ![]() ![]() |
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) |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 34 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 30 ![]() ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 34 ![]() |
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 |
|
![]() |
![]() |
![]() |
![]() |
#5 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 30 ![]() ![]() |
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 ![]() |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 14:07 |
CEA thermo.dat addition | Matej | Siemens | 0 | June 2, 2004 06:23 |
xy plot stuff? | Jun | FLUENT | 1 | June 24, 2003 21:39 |
thermo-acoustics | prasat | Main CFD Forum | 1 | June 7, 2003 01:04 |