|
[Sponsors] |
Improvement to the update of T_ et al in hMixtureThermoC and hhuMixtureThermoC |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 9, 2008, 05:19 |
Description:
An improvement
|
#1 |
Member
Richard Kenny
Join Date: Mar 2009
Posts: 64
Rep Power: 18 |
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]); } |
|
October 9, 2008, 06:29 |
Thanks very much for your bug
|
#2 |
Senior Member
Join Date: Mar 2009
Posts: 854
Rep Power: 22 |
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 |
|
October 9, 2008, 23:14 |
That's useful to know about st
|
#3 |
Member
Richard Kenny
Join Date: Mar 2009
Posts: 64
Rep Power: 18 |
That's useful to know about storeOldTimes(), many thanks, RGK
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |