|
[Sponsors] |
April 29, 2015, 09:39 |
Foam::correction() function
|
#1 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18 |
Hello guys
I was trying to figure out this function: Code:
tmp<fvMatrix<Type> > Foam::correction ( const fvMatrix< Type > & ) Return the correction form of the given matrix. by subtracting the matrix multiplied by the current field Code:
template<class Type> Foam::tmp<Foam::fvMatrix<Type> > Foam::correction ( const fvMatrix<Type>& A ) { tmp<Foam::fvMatrix<Type> > tAcorr = A - (A & A.psi()); if ( (A.hasUpper() || A.hasLower()) && A.psi().mesh().fluxRequired(A.psi().name()) ) { tAcorr().faceFluxCorrectionPtr() = (-A.flux()).ptr(); } return tAcorr; } Thanks |
|
May 23, 2015, 13:02 |
|
#2 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18 |
Yeah, from mathematical equations. it should be substantial derivative, but it does not look like.
|
|
July 2, 2015, 03:43 |
|
#3 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 849
Rep Power: 18 |
Okay, I figured it out finally,
correction(fvm::ddt(p)) means d(p)/d(t) - d(pold)/d(t) /handshake
__________________
My OpenFOAM algorithm website: http://dyfluid.com By far the largest Chinese CFD-based forum: http://www.cfd-china.com/category/6/openfoam We provide lots of clusters to Chinese customers, and we are considering to do business overseas: http://dyfluid.com/DMCmodel.html |
|
July 9, 2015, 14:06 |
|
#4 |
Member
|
What does pold here refer to? A temporary value during iteration or the solution from previous time step (usually in the transient solver)? In case of former circumstance, the correction term should disappear when the equation is converged. I'd rather treat this term in favor of mathematics than physics.
__________________
Kai |
|
January 12, 2023, 09:01 |
Some links to help others discern the meaning of Foam::correction()
|
#5 |
New Member
Corbin G
Join Date: Oct 2022
Location: Midwest, USA
Posts: 11
Rep Power: 4 |
Dear FOAMers,
I have been struggling to understand the correction() function as well. Particularly as it is implemented in the compressibleInterFoam pEqn.H. I don't have a perfect answer, but I at least wanted to put in the information I have found here. It would be nice if an OpenFOAM expert could tell us once and for all the meaning and purpose of correction(). First, the definition of the correction() function is found in fvMatrix.C. For OpenFOAM v2112, this looks like: Code:
template<class Type> Foam::tmp<Foam::fvMatrix<Type>> Foam::correction ( const fvMatrix<Type>& A ) { tmp<Foam::fvMatrix<Type>> tAcorr = A - (A & A.psi()); // Delete the faceFluxCorrection from the correction matrix // as it does not have a clear meaning or purpose deleteDemandDrivenData(tAcorr.ref().faceFluxCorrectionPtr()); return tAcorr; } template<class Type> Foam::tmp<Foam::fvMatrix<Type>> Foam::correction ( const tmp<fvMatrix<Type>>& tA ) { tmp<Foam::fvMatrix<Type>> tAcorr = tA - (tA() & tA().psi()); // Delete the faceFluxCorrection from the correction matrix // as it does not have a clear meaning or purpose deleteDemandDrivenData(tAcorr.ref().faceFluxCorrectionPtr()); return tAcorr; } What does correction() actually do? Well, as mentioned at the beginning of this post, "Return the correction form of the given matrix by subtracting the matrix multiplied by the current field". Henry gave us another hint here: https://bugs.openfoam.org/view.php?id=1772 "The correction(fvm::ddt(p_rgh)) term is a correction to fvc::ddt(rho) due to changes in pressure and the converged result will be the same irrespective of how this correction is formulated, i.e. the correction will converge to 0 and the results will be fvc::ddt(rho)." So I guess the correction term goes to 0 at convergence and it is meant for improving solver robustness? More insights into the functionality of the correction() function are welcomed. Best regards, Corbin Edit: this thread also contains come interesting ideas on what correction() might do: Understanding Terms in Compressible pEqn Edit2: this wiki has some good info on OpenFOAM matrices which may also help: https://openfoamwiki.net/index.php/O...es_in_OpenFOAM Last edited by CorbinMG; January 12, 2023 at 14:01. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
Compilation errors in ThirdPartymallochoard | feng_w | OpenFOAM Installation | 1 | January 25, 2009 07:59 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |
Please help about the VTKFoam | liugx212 | OpenFOAM Running, Solving & CFD | 0 | November 18, 2005 19:27 |