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

Hybrid Scheme

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

Like Tree1Likes
  • 1 Post By wouter

Reply
 
LinkBack Thread Tools Display Modes
Old   February 12, 2014, 17:22
Default Hybrid Scheme
  #1
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 149
Rep Power: 6
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, 18:16
Default
  #2
Senior Member
 
Wouter van der Meer
Join Date: May 2009
Location: Elahuizen, Netherlands
Posts: 130
Rep Power: 8
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, 19:44
Default
  #3
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 149
Rep Power: 6
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, 09:11
Default
  #4
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 149
Rep Power: 6
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hybrid Scheme for DES iqbalsk8 OpenFOAM Programming & Development 0 November 15, 2013 15:13
hybrid scheme dsanthosh2 FLUENT 1 July 3, 2012 00:27
How to implement power law or hybrid schemes?? kamkari OpenFOAM 10 May 9, 2011 10:29
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 09:20.