fvc::interpolate -> harmonic interpolation?

 Register Blogs Members List Search Today's Posts Mark Forums Read

 July 6, 2010, 10:09 fvc::interpolate -> harmonic interpolation? #1 Senior Member   Gijsbert Wierink Join Date: Mar 2009 Posts: 383 Rep Power: 10 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: How does OF interpolate physical properties (e.g. viscosity in interFoam) onto faces and where is it defined? Is there a harmonic interpolation scheme for physical properties (can fvc::interpolate be set to harmonic somehow)? Many thanks in advance! __________________ 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 fvSchemes-Dictionary. 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: 10
Hi Stefan,

Quote:
 @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())
In the member functions (for e.g. muf) in src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C fvc::interpolate is also used, but I can' find anywhere how things are interpolated.

As you write, I also thought of changing schemes in fvSchemes:
Quote:
 @2: fvc::interpolate should read its schemes from fvSchemes-Dictionary. Therefore you should be able to apply what you think to be the best for your purpose.
But when I write
Code:
```interpolationSchemes
{
default         banana;//linear;
}```
I get a list of (what seem to be) advection schemes (not face interpolation schemes (?)):
Code:
```Interpolation dsicretization schemes:

Unknown discretisation scheme banana

Valid schemes are :

56
(
linear
limitedCubic
limitedLinear
downwind
OSPREV
Gamma
localMax
outletStabilised
MUSCLV
reverseLinear
GammaV
blended
UMISTV
limitWith
linearPureUpwindFit
vanLeer
vanLeerV
linearUpwind
Minmod
filteredLinear2V
MinmodV
Phi
cubic
SuperBee
filteredLinear3
biLinearFit
filteredLinear3V
QUICK
UMIST
limitedLinearV
SuperBeeV
weighted
skewCorrected
midPoint
linearFit
linearUpwindV
localMin
fixedBlended
SFCDV
OSPRE
MUSCL
clippedLinear
filteredLinear2
upwind
limitedCubicV
localBlended
SFCD
cubicUpwindFit
filteredLinear
QUICKV
)```
In the mean time I did find a harmonic interpolation scheme in src/finiteVolume/interpolation/surfaceInterpolation/schemes/harmonic/harmonic.H. But when I plug it into the UEqn as a test (in interFoam), like below, the compiler complains that harmonic is a virtual function so it needs an object.

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 banana-Test. 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; )``` You can test if these entries are used, by replacing harmonic by banana again. 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: 9 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: 10
@ Stefan:
Quote:
 Some of this interpolations might not fit to the harmonic scheme
Aha, good point!
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
)```
Isn't "tvf" a tensorVolumeField (just a guess)? Is that ok for viscosity? Also, should I then put this code into \$FOAM_SRC//finiteVolume/finiteVolume/fvc/? And shouldn't there be an actual implementation of the interpolation algorithm?
__________________
Regards, Gijs

 January 17, 2011, 12:29 #7 Senior Member     Anton Kidess Join Date: May 2009 Location: Delft, Netherlands Posts: 1,151 Rep Power: 20 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");` - Anton 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: 9 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: 6 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*(T-TNot))+BetaC*(C-CNot)) + 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((1-gL[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 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 On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Ardalan Main CFD Forum 2 March 18, 2011 16:22 AlGates OpenFOAM 7 August 6, 2010 12:46 PCFD Tecplot 2 June 26, 2010 23:54 jutta OpenFOAM Running, Solving & CFD 0 February 25, 2010 15:32 Hadian Main CFD Forum 4 December 25, 2009 08:25

All times are GMT -4. The time now is 11:13.