|
[Sponsors] |
Factors for the cubic inerpolation scheme in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 10, 2017, 10:36 |
Factors for the cubic inerpolation scheme in OpenFOAM
|
#1 |
New Member
Join Date: Mar 2017
Posts: 1
Rep Power: 0 |
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() ); } 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. |
|
Tags |
cubic, factors, interpolation, scheme, weights |
|
|
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 |