
[Sponsors] 
July 6, 2010, 10:09 
fvc::interpolate > harmonic interpolation?

#1 
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9 
Dear all,
I would like to know how OF interpolates physical properties onto faces. I know there is linear interpolation and I have seen some threads (Interpolation in OpenFOAM and About interFoam solver) on related issues, but not quite what I am looking for. My questions are the following:
__________________
Regards, Gijs 

July 6, 2010, 11:04 

#2 
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 9 
Hi Gijsbert,
@1: I think it is always done using fvc::interpolate() (e.g. for viscosity in interFoam you can find it in src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C; member funtion mu()) @2: fvc::interpolate should read its schemes from fvSchemesDictionary. Therefore you should be able to apply what you think to be the best for your purpose. Regards, Stefan 

July 6, 2010, 11:42 

#3  
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9 
Hi Stefan,
Thanks for your reply! Quote:
As you write, I also thought of changing schemes in fvSchemes: Quote:
Code:
interpolationSchemes { default banana;//linear; } Code:
Interpolation dsicretization schemes: Unknown discretisation scheme banana Valid schemes are : 56 ( linear quadraticUpwindFit limitedCubic limitedLinear downwind OSPREV Gamma localMax quadraticLinearUpwindFit outletStabilised quadraticFit MUSCLV reverseLinear GammaV blended UMISTV limitWith linearPureUpwindFit vanLeer vanLeerV linearUpwind Minmod filteredLinear2V MinmodV Phi cubic SuperBee filteredLinear3 biLinearFit filteredLinear3V quadraticLinearFit QUICK UMIST limitedLinearV SuperBeeV weighted skewCorrected midPoint vanAlbadaV linearFit linearUpwindV localMin fixedBlended SFCDV vanAlbada OSPRE MUSCL clippedLinear filteredLinear2 upwind limitedCubicV localBlended SFCD cubicUpwindFit filteredLinear QUICKV ) Code:
surfaceScalarField muEff ( "muEff", twoPhaseProperties.muf() + harmonic::interpolate(rho*turbulence>nut()) // + fvc::interpolate(rho*turbulence>nut()) );
__________________
Regards, Gijs 

July 6, 2010, 12:25 

#4 
Senior Member
Stefan Herbert
Join Date: Dec 2009
Location: Darmstadt, Germany
Posts: 129
Rep Power: 9 
Hi Gijsbert,
the problem is, that the interpolationScheme defined in fvSchemes in used for every call of fvc::interpolate (and this are 12 in interFoam!). Some of this interpolations might not fit to the harmonic scheme. This should cause the errors and should also be the reason, why it is not listed in your bananaTest. Nevertheless you won't have to change any piece of code I think. Instead you can specify the harmonic scheme to single operations e.g. by the following entry in fvSchemes: Code:
interpolationSchemes ( default linear; interpolate(nu1) harmonic; interpolate(nu2) harmonic; interpolate((rho*nut)) harmonic; ) Have a lot of fun, Stefan 

July 6, 2010, 12:53 

#5 
Senior Member
Kathrin Kissling
Join Date: Mar 2009
Location: Besigheim, Germany
Posts: 134
Rep Power: 8 
Hello Gjis!!!
hope you're fine. If you don't want this to be accessed from anywhere else you can hardcode that one as well! tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate ( const GeometricField< Type, fvPatchField, volMesh > & const surfaceScalarField & tvf, const word & name ) Name than would be the name of your interpolation scheme. Best! Kathrin 

July 7, 2010, 10:17 

#6  
Senior Member
Gijsbert Wierink
Join Date: Mar 2009
Posts: 383
Rep Power: 9 
@ Stefan:
Quote:
Thanks for the help, I implemented it and it works. @ Kathrin: Hi Kathrin, I'm fine, thanks . Hope you're well too! Many thanks for the help. Hardcoding would perhaps be good at some point. But I am not quite clear on the snippet, so I have some (possibly dumb) questions ... For a harmonic scheme myHarmonicScheme I suppose the code goes like this: Code:
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate ( const GeometricField< Type, fvPatchField, volMesh >& const surfaceScalarField &tvf, const word &myHarmonicScheme )
__________________
Regards, Gijs 

January 17, 2011, 12:29 

#7 
Senior Member
Anton Kidess
Join Date: May 2009
Location: Delft, Netherlands
Posts: 1,019
Rep Power: 18 
Gijsbert, the snippet Kathrin showed you is already part of fvc (see openfoam documentation). You should be able to hard call a harmonic interpolation by using:
Code:
surfaceScalarField some_ssf = fvc::interpolate(some_vsf, "harmonic"); EDIT: I just tested this, unfortunately it doesn't work. This snippet tries to find a "harmonic" entry in fvSchemes instead, which has little advantage over directly specifying the term in fvSchemes. Last edited by akidess; January 17, 2011 at 14:01. 

January 4, 2012, 11:52 

#8 
Senior Member
n/a
Join Date: Sep 2009
Posts: 198
Rep Power: 8 
Hello to all. Perhaps someone can quickly enlighten on this topic, I need to interpolate cell centered values to cell faces. The cell centered faces needed to interpolate to cell faces are near the boundary, and not really quite sure how to code it. How is this:
const fvPatchScalarField& Tw = thermo.T().boundaryField()[patchI]; const scalarField Tadj = Tw.patchInternalField();//gives T for cell adjacent to wall surfaceScalarField Tsurf=fvc::interpolate(Tadj); This code makes sense, but I'm not sure if it is correct. Furthermore, does the interpolation computes face values for the east, west, north, and southern faces? I need the east, west, and northern face values, so how do get those from the interpolation operation? Cheers, Deji 

October 1, 2012, 13:31 
face value of a parameter

#9 
Member
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 5 
Hi FOAMERS
I am trying to solve a set of equations in the following form  (Density)*fvm::ddt(U) + (Density/gL)*fvm::div(phi, U)  (Visc)*(fvm::laplacian(U))  GravityVector*g*Density*((BetaT*(TTNot))+BetaC*(CCNot)) + fvm::Sp(gL*Visc/Perm,U)  Perm is the permeability which is calculated by the following relation Perm[celli] = (pow(SDAS.value(),2))*pow((gL[celli]),3)/(180*(pow((1gL[celli]),2))); Is there any way to make sure that the permeability at the cell face is calculated by mean harmonic interpolation? 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
urgent help needed (rhiechow interpolation problem)  Ardalan  Main CFD Forum  2  March 18, 2011 16:22 
CAD > gMsh > enGrid > OpenFOAM Problem  AlGates  OpenFOAM  7  August 6, 2010 12:46 
PostProcessing > Interpolation of cellcentered values to vertex  PCFD  Tecplot  2  June 26, 2010 23:54 
Surface interpolation schemes and parallelization  jutta  OpenFOAM Running, Solving & CFD  0  February 25, 2010 15:32 
momentum interpolation for collocated grid  Hadian  Main CFD Forum  4  December 25, 2009 08:25 