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

Improvement to the update of T_ et al in hMixtureThermoC and hhuMixtureThermoC

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 9, 2008, 05:19
Default Description: An improvement
  #1
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 64
Rep Power: 18
richpaj is on a distinguished road
Description:
An improvement to the update of T_, psi_, mu_, and alpha_ (also Tu_)
in hMixtureThermo.C and hhuMixtureThermo.C.

"oldTime" information for the internalField values
of T_, psi_, mu_, and alpha_ (also Tu_) is apparently lost
in hMixtureThermo.C and hhuMixtureThermo.C.

For example, in the Euler scheme, fvc::ddt(T) = 0 for internalField
values (boundary values, however, differentiate correctly).

(I don't think using "T.storeOldTimes()" will help here, though I stand to be corrected).



Remedy:

in hMixtureThermo.C
from line 73

forAll(T_, celli)
{
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);

T_[celli] = mixture_.TH(h_[celli], T_[celli]);
psi_[celli] = mixture_.psi(p_[celli], T_[celli]);

mu_[celli] = mixture_.mu(T_[celli]);
alpha_[celli] = mixture_.alpha(T_[celli]);
}

Replace with

forAll(T_, celli)
{
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);

T_.internalField()[celli] = mixture_.TH(h_[celli], T_[celli]);
psi_.internalField()[celli] = mixture_.psi(p_[celli], T_[celli]);

mu_.internalField()[celli] = mixture_.mu(T_[celli]);
alpha_.internalField()[celli] = mixture_.alpha(T_[celli]);
}




hhuMixtureThermo.C
from line 86


forAll(T_, celli)
{
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);

T_.internalField()[celli] = mixture_.TH(h_[celli], T_[celli]);
psi_.internalField()[celli] = mixture_.psi(p_[celli], T_[celli]);

mu_.internalField()[celli] = mixture_.mu(T_[celli]);
alpha_.internalField()[celli] = mixture_.alpha(T_[celli]);

Tu_.internalField()[celli] = this->cellReactants(celli).TH(hu_[celli], Tu_[celli]);
}

Replace with:


forAll(T_, celli)
{
const typename MixtureType::thermoType& mixture_ =
this->cellMixture(celli);

T_.internalField()[celli] = mixture_.TH(h_[celli], T_[celli]);
psi_internalField()[celli] = mixture_.psi(p_[celli], T_[celli]);

mu_internalField()[celli] = mixture_.mu(T_[celli]);
alpha_internalField()[celli] = mixture_.alpha(T_[celli]);

Tu_internalField()[celli] = this->cellReactants(celli).TH(hu_[celli], Tu_[celli]);
}
richpaj is offline   Reply With Quote

Old   October 9, 2008, 06:29
Default Thanks very much for your bug
  #2
Senior Member
 
Join Date: Mar 2009
Posts: 854
Rep Power: 22
henry is on a distinguished road
Thanks very much for your bug report and proposed fix. Your solution will certainly work but has a run-time overhead and would stop the loops vectorizing. Using "T.storeOldTimes()" etc. before the loop would work and more efficiently (note that T.internalField() simply calls T.storeOldTimes() before returning the field). I will implement this change and upload it to our 1.5.x git repository.

H
henry is offline   Reply With Quote

Old   October 9, 2008, 23:14
Default That's useful to know about st
  #3
Member
 
Richard Kenny
Join Date: Mar 2009
Posts: 64
Rep Power: 18
richpaj is on a distinguished road
That's useful to know about storeOldTimes(), many thanks, RGK
richpaj is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SurfaceTransformPoints rotate suggestion for improvement markc OpenFOAM Pre-Processing 1 August 13, 2011 09:47
SurfaceTransformPoints rotate suggestion for improvement markc OpenFOAM Pre-Processing 0 January 9, 2009 03:28
Jet Impingement (results improvement) ... Sri FLUENT 6 July 16, 2007 07:33
Improvement in makeDeltaCoeffs rolando OpenFOAM Bugs 3 May 15, 2007 13:49
sponsership-research-innovative improvement-wind amit Main CFD Forum 0 February 9, 2006 08:51


All times are GMT -4. The time now is 01:52.