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

Hybrid Scheme

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By wouter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2014, 16:22
Default Hybrid Scheme
  #1
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
Dear all

I was trying to implement the hybrid scheme but I have faced some problems.
I will appreciate any suggestions,

for the implementation I have added three more parameter to the limiter function to be able to define the Peclect number. then I pick the Quick scheme as the template for new scheme.

now the code is reading as :

Code:
    scalar limiter
    (
        const scalar cdWeight,
        const scalar faceFlux,
        const typename LimiterFunc::phiType& phiP,
        const typename LimiterFunc::phiType& phiN,
        const typename LimiterFunc::gradPhiType& gradcP,
        const typename LimiterFunc::gradPhiType& gradcN,
        const vector& d,
        const vector& Sf,
        const scalar& magSf ,
       const scalar Diffu
    ) const
    {

    scalar Pe = (faceFlux/magSf)*(d & Sf)/(Diffu*magSf);
    scalar QLimiter;
    QLimiter = pos(1-0.5*mag(Pe));

        // Limit the limiter between upwind and downwind
        return  QLimiter;
    }
the code compiles well. but then when I want to run a case it gives me floating point error. if I put the Qlimiter 0 or 1 it runs without problem. but as I use a function of Pe it wont run.

best
Mahdi
mm.abdollahzadeh is offline   Reply With Quote

Old   February 12, 2014, 17:16
Default
  #2
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 203
Rep Power: 17
wouter is on a distinguished road
Dear Mahdi,
sorry if stating the obvious: prevent magSf and or Diffu from being zero or add SMALL to the divider

Hope anyone else has a better solution
Best regards
Wouter
mm.abdollahzadeh likes this.
wouter is offline   Reply With Quote

Old   February 12, 2014, 18:44
Default
  #3
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
Dear Wouter

your suggestion will make it work. But then I'm just worried what will happen to boundaries ( possible place that Diffu and Magsf could be zero?!)

best
Mahdi
mm.abdollahzadeh is offline   Reply With Quote

Old   February 13, 2014, 08:11
Default
  #4
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
now it runs

Im reading the Diffu in limitedscheme class in this way

Quote:
const volScalarField& Diff =
phi.db().objectRegistry::lookupObject<volScalarFie ld>(Diffname_);
tmp<surfaceScalarField> tDiffu=fvc::interpolate(Diff);

const surfaceScalarField& Diffu =tDiffu();
best
mahdi
mm.abdollahzadeh is offline   Reply With Quote

Reply


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
How to implement power law or hybrid schemes?? kamkari OpenFOAM Programming & Development 13 January 13, 2018 06:35
Hybrid Scheme for DES iqbalsk8 OpenFOAM Programming & Development 1 October 22, 2016 11:18
hybrid scheme dsanthosh2 FLUENT 1 July 3, 2012 00:27
Hybrid scheme activation cheema FLUENT 0 May 1, 2011 02:28
Hybrid discretization scheme alice FLUENT 0 July 15, 2004 21:47


All times are GMT -4. The time now is 05:18.