|
[Sponsors] |
Where are correct () and update() functions defined ? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 24, 2013, 11:14 |
Where are correct () and update() functions defined ?
|
#1 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
Hi Foamers,
I am focusing the codes of sonicTurbDyMEngineFoam these days. Do you know where is the correct() function defined in below code ? Code:
thermo.correct(); Code:
bool meshChanged = mesh.update(); Thanks and best regards, Sasan. P.S. correct function declared as a pure virtual function in basicThermo class. |
|
July 24, 2013, 12:00 |
|
#2 |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
For the first question "thermo.correct();"
It depends on what thermo model you are using. Take hPsiThermo as an example. It is define in /src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C For the second question. This is used dynamic meshing.It also depends on what dynamic meshing utility you are using. If you use dynamicRefineFvMesh It is defined in /src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C |
|
July 24, 2013, 12:44 |
|
#3 |
Senior Member
Sasan Ghomi
Join Date: Sep 2012
Location: Denmark
Posts: 292
Rep Power: 15 |
Dear Haomin
Thank you very much. Best regards Sasan. |
|
August 15, 2013, 16:04 |
|
#4 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
Hi Sasan,Haomin and other dears
what does correct() do on thermo type? I can't find thermo.correct() in the library below: Code:
/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "hePsiThermo.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class BasicPsiThermo, class MixtureType> void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::calculate() { const scalarField& hCells = this->he_.internalField(); const scalarField& pCells = this->p_.internalField(); scalarField& TCells = this->T_.internalField(); scalarField& psiCells = this->psi_.internalField(); scalarField& muCells = this->mu_.internalField(); scalarField& alphaCells = this->alpha_.internalField(); forAll(TCells, celli) { const typename MixtureType::thermoType& mixture_ = this->cellMixture(celli); TCells[celli] = mixture_.THE ( hCells[celli], pCells[celli], TCells[celli] ); psiCells[celli] = mixture_.psi(pCells[celli], TCells[celli]); muCells[celli] = mixture_.mu(pCells[celli], TCells[celli]); alphaCells[celli] = mixture_.alphah(pCells[celli], TCells[celli]); } forAll(this->T_.boundaryField(), patchi) { fvPatchScalarField& pp = this->p_.boundaryField()[patchi]; fvPatchScalarField& pT = this->T_.boundaryField()[patchi]; fvPatchScalarField& ppsi = this->psi_.boundaryField()[patchi]; fvPatchScalarField& ph = this->he_.boundaryField()[patchi]; fvPatchScalarField& pmu = this->mu_.boundaryField()[patchi]; fvPatchScalarField& palpha = this->alpha_.boundaryField()[patchi]; if (pT.fixesValue()) { forAll(pT, facei) { const typename MixtureType::thermoType& mixture_ = this->patchFaceMixture(patchi, facei); ph[facei] = mixture_.HE(pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); pmu[facei] = mixture_.mu(pp[facei], pT[facei]); palpha[facei] = mixture_.alphah(pp[facei], pT[facei]); } } else { forAll(pT, facei) { const typename MixtureType::thermoType& mixture_ = this->patchFaceMixture(patchi, facei); pT[facei] = mixture_.THE(ph[facei], pp[facei], pT[facei]); ppsi[facei] = mixture_.psi(pp[facei], pT[facei]); pmu[facei] = mixture_.mu(pp[facei], pT[facei]); palpha[facei] = mixture_.alphah(pp[facei], pT[facei]); } } } } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template<class BasicPsiThermo, class MixtureType> Foam::hePsiThermo<BasicPsiThermo, MixtureType>::hePsiThermo ( const fvMesh& mesh, const word& phaseName ) : heThermo<BasicPsiThermo, MixtureType>(mesh, phaseName) { calculate(); // Switch on saving old time this->psi_.oldTime(); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template<class BasicPsiThermo, class MixtureType> Foam::hePsiThermo<BasicPsiThermo, MixtureType>::~hePsiThermo() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class BasicPsiThermo, class MixtureType> void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::correct() { if (debug) { Info<< "entering hePsiThermo<BasicPsiThermo, MixtureType>::correct()" << endl; } // force the saving of the old-time values this->psi_.oldTime(); calculate(); if (debug) { Info<< "exiting hePsiThermo<BasicPsiThermo, MixtureType>::correct()" << endl; } }
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked. |
|
August 15, 2013, 16:06 |
|
#5 |
Member
Haomin Yuan
Join Date: Jan 2012
Location: Madison, Wisconsin, USA
Posts: 59
Rep Power: 14 |
It calculate other properties from pressure and h or e.
|
|
August 16, 2013, 10:49 |
|
#6 |
Senior Member
Armin
Join Date: Feb 2011
Location: Helsinki, Finland
Posts: 156
Rep Power: 19 |
thermo.correct() is just a wrapper for thermo.calculate(). See the code below for an example.
This has been discussed here already some time ago, search the forum and you will find more information. Code:
template<class BasicPsiThermo, class MixtureType> void Foam::hePsiThermo<BasicPsiThermo, MixtureType>::correct() { if (debug) { Info<< "entering hePsiThermo<BasicPsiThermo, MixtureType>::correct()" << endl; } // force the saving of the old-time values this->psi_.oldTime(); calculate(); if (debug) { Info<< "exiting hePsiThermo<BasicPsiThermo, MixtureType>::correct()" << endl; } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is my Dynamic mesh setup correct? | cfd seeker | FLUENT | 16 | October 30, 2020 07:16 |
Update of the variables after dynamic mesh motion. | gtg258f | OpenFOAM Programming & Development | 9 | January 18, 2014 11:08 |
apt-get update Duplicate lists of OpenFOAM | Xulia | OpenFOAM Installation | 2 | June 20, 2013 11:13 |
Using Workbench, CFX-Pre doesn't update mesh from upstream data | Shawn_A | CFX | 2 | November 25, 2012 14:06 |
how can I correct the udf? | happyrabbit | FLUENT | 9 | January 28, 2011 10:50 |