# fvc::interpolate(rAU) at boundary faces

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 28, 2019, 14:51 fvc::interpolate(rAU) at boundary faces #1 New Member   Jesper R. K. Qwist Join Date: Dec 2017 Posts: 20 Rep Power: 7 Hi everyone, I am currently trying to understand how OpenFOAM interpolates the cell centred field "rAU" to the cell face centres, whereby we get "rAUf". rAU is 1/A0, where A0 is the diagonal elements from the implicit part of the discretisation of the convective and diffusive terms in the momentum equation. I know that for internal faces at linear interpolation is performed between the two cell centres sharing the face. Does anyone know how the interpolation is performed at the boundary faces? Best Regards and Thanks in advance, JRKQ.

January 28, 2019, 15:54
#2
Senior Member

Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12
Quote:
 Originally Posted by Jesper_Roland Hi everyone, I am currently trying to understand how OpenFOAM interpolates the cell centred field "rAU" to the cell face centres, whereby we get "rAUf". rAU is 1/A0, where A0 is the diagonal elements from the implicit part of the discretisation of the convective and diffusive terms in the momentum equation. I know that for internal faces at linear interpolation is performed between the two cell centres sharing the face. Does anyone know how the interpolation is performed at the boundary faces? Best Regards and Thanks in advance, JRKQ.
Something like this code from pEqn.h

Code:
```surfaceScalarField faceMask(localMin<scalar>(mesh).interpolate(cellMask));

volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA("HbyA", U);
HbyA = constrainHbyA(cellMask*rAU*UEqn.H(), U, p);```
inside overRhoPimpleDyMFoam?

This might help What does fvc::interpolate(U) & mesh.Sf() stand for?

 January 28, 2019, 18:47 #3 Senior Member   Andrew Somorjai Join Date: May 2013 Posts: 175 Rep Power: 12 Might be wrong but this seems like the header file surfaceInterpolate.H Code: ```/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 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 . InNamespace Foam::fvc Description Surface Interpolation SourceFiles surfaceInterpolate.C \*---------------------------------------------------------------------------*/ #ifndef surfaceInterpolate_H #define surfaceInterpolate_H #include "tmp.H" #include "volFieldsFwd.H" #include "surfaceFieldsFwd.H" #include "surfaceInterpolationScheme.H" #include "one.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { /*---------------------------------------------------------------------------*\ Namespace fvc functions Declaration \*---------------------------------------------------------------------------*/ namespace fvc { //- Return weighting factors for scheme given from Istream template static tmp> scheme ( const surfaceScalarField& faceFlux, Istream& schemeData ); //- Return weighting factors for scheme given by name in dictionary template static tmp> scheme ( const surfaceScalarField& faceFlux, const word& name ); //- Return weighting factors for scheme given from Istream template static tmp> scheme ( const fvMesh& mesh, Istream& schemeData ); //- Return weighting factors for scheme given by name in dictionary template static tmp> scheme ( const fvMesh& mesh, const word& name ); //- Interpolate field onto faces using scheme given by Istream template static tmp> interpolate ( const GeometricField& tvf, const surfaceScalarField& faceFlux, Istream& schemeData ); //- Interpolate field onto faces using scheme given by name in fvSchemes template static tmp> interpolate ( const GeometricField& tvf, const surfaceScalarField& faceFlux, const word& name ); //- Interpolate field onto faces using scheme given by name in fvSchemes template static tmp> interpolate ( const tmp>& tvf, const surfaceScalarField& faceFlux, const word& name ); //- Interpolate field onto faces using scheme given by name in fvSchemes template static tmp> interpolate ( const GeometricField& tvf, const tmp& faceFlux, const word& name ); //- Interpolate field onto faces using scheme given by name in fvSchemes template static tmp> interpolate ( const tmp>& tvf, const tmp& faceFlux, const word& name ); //- Interpolate field onto faces using scheme given by Istream template static tmp> interpolate ( const GeometricField& tvf, Istream& schemeData ); //- Interpolate field onto faces using scheme given by name in fvSchemes template static tmp> interpolate ( const GeometricField& tvf, const word& name ); //- Interpolate field onto faces using scheme given by name in fvSchemes template static tmp> interpolate ( const tmp>& tvf, const word& name ); //- Interpolate field onto faces using 'interpolate()' template static tmp> interpolate ( const GeometricField& tvf ); //- Interpolate tmp field onto faces using 'interpolate()' template static tmp> interpolate ( const tmp>& tvf ); //- Interpolate boundary field onto faces (simply a type conversion) template static tmp> interpolate ( const FieldField& fvpff ); //- Interpolate boundary field onto faces (simply a type conversion) template static tmp> interpolate ( const tmp>& tfvpff ); //- Interpolate 'one' returning 'one' inline one interpolate(const one&) { return one(); } //- Interpolate field onto faces // and 'dot' with given surfaceVectorField Sf template static tmp < GeometricField < typename innerProduct::type, fvsPatchField, surfaceMesh > > dotInterpolate ( const surfaceVectorField& Sf, const GeometricField& tvf ); //- Interpolate tmp field onto faces // and 'dot' with given surfaceVectorField Sf template static tmp < GeometricField < typename innerProduct::type, fvsPatchField, surfaceMesh > > dotInterpolate ( const surfaceVectorField& Sf, const tmp>& tvf ); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository #include "surfaceInterpolate.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //``` From https://www.openfoam.com/documentati...8H_source.html And here's the source surfaceInterpolate.C Code: ``` /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 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 . \*---------------------------------------------------------------------------*/ #include "surfaceInterpolate.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template Foam::tmp> Foam::fvc::scheme ( const surfaceScalarField& faceFlux, Istream& streamData ) { return surfaceInterpolationScheme::New ( faceFlux.mesh(), faceFlux, streamData ); } template Foam::tmp> Foam::fvc::scheme ( const surfaceScalarField& faceFlux, const word& name ) { return surfaceInterpolationScheme::New ( faceFlux.mesh(), faceFlux, faceFlux.mesh().interpolationScheme(name) ); } template Foam::tmp> Foam::fvc::scheme ( const fvMesh& mesh, Istream& streamData ) { return surfaceInterpolationScheme::New ( mesh, streamData ); } template Foam::tmp> Foam::fvc::scheme ( const fvMesh& mesh, const word& name ) { return surfaceInterpolationScheme::New ( mesh, mesh.interpolationScheme(name) ); } template Foam::tmp> Foam::fvc::interpolate ( const GeometricField& vf, const surfaceScalarField& faceFlux, Istream& schemeData ) { if (surfaceInterpolation::debug) { InfoInFunction << "interpolating GeometricField " << vf.name() << endl; } return scheme(faceFlux, schemeData)().interpolate(vf); } template Foam::tmp> Foam::fvc::interpolate ( const GeometricField& vf, const surfaceScalarField& faceFlux, const word& name ) { if (surfaceInterpolation::debug) { InfoInFunction << "interpolating GeometricField " << vf.name() << " using " << name << endl; } return scheme(faceFlux, name)().interpolate(vf); } template Foam::tmp> Foam::fvc::interpolate ( const tmp>& tvf, const surfaceScalarField& faceFlux, const word& name ) { tmp> tsf = interpolate(tvf(), faceFlux, name); tvf.clear(); return tsf; } template Foam::tmp> Foam::fvc::interpolate ( const GeometricField& vf, const tmp& tFaceFlux, const word& name ) { tmp> tsf = interpolate(vf, tFaceFlux(), name); tFaceFlux.clear(); return tsf; } template Foam::tmp> Foam::fvc::interpolate ( const tmp>& tvf, const tmp& tFaceFlux, const word& name ) { tmp> tsf = interpolate(tvf(), tFaceFlux(), name); tvf.clear(); tFaceFlux.clear(); return tsf; } template Foam::tmp> Foam::fvc::interpolate ( const GeometricField& vf, Istream& schemeData ) { if (surfaceInterpolation::debug) { InfoInFunction << "interpolating GeometricField " << vf.name() << endl; } return scheme(vf.mesh(), schemeData)().interpolate(vf); } template Foam::tmp> Foam::fvc::interpolate ( const GeometricField& vf, const word& name ) { if (surfaceInterpolation::debug) { InfoInFunction << "interpolating GeometricField " << vf.name() << " using " << name << endl; } return scheme(vf.mesh(), name)().interpolate(vf); } template Foam::tmp> Foam::fvc::interpolate ( const tmp>& tvf, const word& name ) { tmp> tsf = interpolate(tvf(), name); tvf.clear(); return tsf; } template Foam::tmp> Foam::fvc::interpolate ( const GeometricField& vf ) { if (surfaceInterpolation::debug) { InfoInFunction << "interpolating GeometricField " << vf.name() << " using run-time selected scheme" << endl; } return interpolate(vf, "interpolate(" + vf.name() + ')'); } template Foam::tmp> Foam::fvc::interpolate ( const tmp>& tvf ) { tmp> tsf = interpolate(tvf()); tvf.clear(); return tsf; } template Foam::tmp> Foam::fvc::interpolate ( const FieldField& fvpff ) { FieldField* fvspffPtr ( new FieldField(fvpff.size()) ); forAll(*fvspffPtr, patchi) { fvspffPtr->set ( patchi, fvsPatchField::NewCalculatedType(fvpff[patchi].patch()).ptr() ); (*fvspffPtr)[patchi] = fvpff[patchi]; } return tmp>(fvspffPtr); } template Foam::tmp> Foam::fvc::interpolate ( const tmp>& tfvpff ) { tmp> tfvspff = interpolate(tfvpff()); tfvpff.clear(); return tfvspff; } template Foam::tmp < Foam::GeometricField < typename Foam::innerProduct::type, Foam::fvsPatchField, Foam::surfaceMesh > > Foam::fvc::dotInterpolate ( const surfaceVectorField& Sf, const GeometricField& vf ) { if (surfaceInterpolation::debug) { InfoInFunction << "interpolating GeometricField " << vf.name() << " using run-time selected scheme" << endl; } return scheme ( vf.mesh(), "dotInterpolate(" + Sf.name() + ',' + vf.name() + ')' )().dotInterpolate(Sf, vf); } template Foam::tmp < Foam::GeometricField < typename Foam::innerProduct::type, Foam::fvsPatchField, Foam::surfaceMesh > > Foam::fvc::dotInterpolate ( const surfaceVectorField& Sf, const tmp>& tvf ) { tmp < GeometricField < typename Foam::innerProduct::type, fvsPatchField, surfaceMesh > > tsf = dotInterpolate(Sf, tvf()); tvf.clear(); return tsf; }``` https://www.openfoam.com/documentati...8C_source.html Last edited by massive_turbulence; January 28, 2019 at 18:50. Reason: Added more details

 January 30, 2019, 03:53 #4 New Member   Jesper R. K. Qwist Join Date: Dec 2017 Posts: 20 Rep Power: 7 Hi massive_turbulence, Thank you for your reply. To my understanding fvc::interpolate(U) & mesh.Sf() is the dot product between the surface normal area vector to the face in question and the cell centred velocity field interpolated to the cell face in question. Maybe I posted the question in the wrong section. I am interested in a theoretical explanation for how the linear interpolation is carried out at the boundaries of the domain, and not how it is coded in OpenFOAM. I have done some more research on this and I think have found a source to get the information I seek, which is the book: Moukalled, Mangani, Darwish - 2016 - The finite volume method in computational fluid dynamics In Section 15.6, the book writes about the boundary conditions in relation to the Rhie-Chow interpolation, both for boundary cells and internal cells. massive_turbulence likes this.

January 30, 2019, 07:15
#5
Senior Member

Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 12
Quote:
 Originally Posted by Jesper_Roland Hi massive_turbulence, Thank you for your reply. To my understanding fvc::interpolate(U) & mesh.Sf() is the dot product between the surface normal area vector to the face in question and the cell centred velocity field interpolated to the cell face in question. Maybe I posted the question in the wrong section. I am interested in a theoretical explanation for how the linear interpolation is carried out at the boundaries of the domain, and not how it is coded in OpenFOAM. I have done some more research on this and I think have found a source to get the information I seek, which is the book: Moukalled, Mangani, Darwish - 2016 - The finite volume method in computational fluid dynamics In Section 15.6, the book writes about the boundary conditions in relation to the Rhie-Chow interpolation, both for boundary cells and internal cells.
Well yeah, the Rhie-Chow interpolation is not easy to explain in everyday language and I have looked at it myself but there are no simple explanations anywhere.

Try reading this https://openfoamwiki.net/index.php/B...sinesqPisoFoam

There's some info on how things are done, but they do gloss over Rhie-Chow interpolation without details. Otherwise there are lots of papers online you can search for or maybe someone will give a tutorial here eventually.

 January 30, 2019, 08:55 #6 New Member   Jesper R. K. Qwist Join Date: Dec 2017 Posts: 20 Rep Power: 7 Thank you for the link, it is very useful. I will definitely save that I agree, it is hard to find a presentation of the Rhie-Chow interpolation, which is easily understood. In my opinion the explanations are often made with a large number of introduced variables to shorten the presentation, which ends up in a nightmare of notation to keep track of. And one more thing I rarely find that the authors using the Rhie-Chow interpolation describes the boundary conditions for the method, even though this is a critical part of CFD. I hope that I can get back to this post with a detailed explanation of the Rhie-Chow interpolation with less notation and detailed comments on boundary conditions. Thank you for your suggestions and comments

 Tags boundary, fvc::interpolate, interpolate, rau, rauf

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post [snappyHexMesh] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 08:26 Saturn CFX 58 July 3, 2020 01:13 [snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 03:21 aylalisa OpenFOAM Installation 23 June 15, 2015 14:49 hinca CFX 15 January 26, 2014 17:11

All times are GMT -4. The time now is 21:02.

 Contact Us - CFD Online - Privacy Statement - Top