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

Factors for the cubic inerpolation scheme in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By sahas

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   March 10, 2017, 10:36
Post Factors for the cubic inerpolation scheme in OpenFOAM
  #1
New Member
 
Join Date: Mar 2017
Posts: 1
Rep Power: 0
Hoshang is on a distinguished road
Dear all,

I have a question regarding the used factors for the cubic interpolation scheme in OpenFOAM. Below you can see a part of the code for the cubic interpolation scheme:
Code:
virtual bool corrected() const
{
    return true;
}

//- Return the explicit correction to the face-interpolate
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh>>
correction
(
     const GeometricField<Type, fvPatchField, volMesh>& vf
 ) const
{
       const fvMesh& mesh = this->mesh();

       // calculate the appropriate interpolation factors
       const surfaceScalarField& lambda = mesh.weights();

       const surfaceScalarField kSc
       (
                 lambda*(scalar(1) - lambda*(scalar(3) - scalar(2)*lambda))    
       );

       const surfaceScalarField kVecP(sqr(scalar(1) - lambda)*lambda);

       const surfaceScalarField kVecN(sqr(lambda)*(lambda - scalar(1)));

       tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tsfCorr
       (
             new GeometricField<Type, fvsPatchField, surfaceMesh>
             (
                    IOobject
                    (
                        "cubic::correction(" + vf.name() +')',
                        mesh.time().timeName(),
                        mesh,
                        IOobject::NO_READ,
                        IOobject::NO_WRITE,
                        false
                    ),
                    surfaceInterpolationScheme<Type>::interpolate(vf, kSc, -kSc)
             )
       );
       GeometricField<Type, fvsPatchField, surfaceMesh>& sfCorr = tsfCorr.ref();

       for (direction cmpt=0; cmpt<pTraits<Type>::nComponents;cmpt++)
       {
            sfCorr.replace
            (
                 cmpt,
                 sfCorr.component(cmpt)
             + (
                     surfaceInterpolationScheme
                     <
                          typename outerProduct
                          <
                                 vector,
                                 typename pTraits<Type>::cmptType
                          >::type
                      >::interpolate
                      (
                             fv::gaussGrad
                             <typename pTraits<Type>::cmptType>(mesh)
                            .grad(vf.component(cmpt)),
                             kVecP,
                             kVecN
                       ) & mesh.Sf()
                  )/mesh.magSf()/mesh.surfaceInterpolation::deltaCoeffs()
              );
         }
The cubic interpolation is done using the linear interpolated term plus a correction term which is defined above in the code. As I understand from the Code the correction uses the factor kSc for the owner point value and -kSc for the neighbor point value. In addition, the gradient of the owner point is added with the factor kVecP and the gradient of the neighbor point with the factor kVecN. With this we get for the value at the surface the following correlation:
phi_E=lambda*phi_P+(1-lambda)*phi_N+kSc*phi_P-kSc*phi_N+kVecP*gradPhi_P+kVecN*gradphi_N

Here phi_P and phi_N are the values at the owner and neighbor point and gradphi_P and gradphi_N the gradients at the mentioned points.
But by the use of a normal cubic polynomial function (f(x)=ax³+bx²+cx+d) for the interpolation of the surface value with given values and gradients for the owner and neighbor points as conditions I get another correlation with the defined factors in the above code:
phi_E=lambda*phi_P+(1-lambda)*phi_N-kSc*phi_P+kSc*phi_N-kVecN*gradPhi_P-kVecP*gradphi_N

The differences are the opposite signs and the exchange of the factors.
I have tried lot of other numerical interpolation ways to come on the same correlation as used in OpenFOAM but i wasnt sucessful till yet.
Does anyone knows how one gets the correlation which is used in OpenFOAM respectively which interpolation technique gives this correlation with the given values and gradients at the owner and neighbor point?

Thanks in advance for answers and hopefully someone can give me an advise regarding this problem.
Hoshang is offline   Reply With Quote

 

Tags
cubic, factors, interpolation, scheme, weights


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
Getting Started with OpenFOAM wyldckat OpenFOAM 25 August 14, 2022 13:55
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 05:29
Radiation With View Factors in OPENFOAM MadiS OpenFOAM 1 August 23, 2012 11:21
Second order upwinding scheme in OpenFoam subash OpenFOAM Running, Solving & CFD 4 June 20, 2012 18:28
Surface interpolation scheme with tensors as weighting factors jutta OpenFOAM Running, Solving & CFD 1 August 27, 2007 11:00


All times are GMT -4. The time now is 14:38.