CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

max function in Schnerr-Sauer Cavitation File

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

LinkBack Thread Tools Search this Thread Display Modes
Old   February 8, 2019, 15:39
Default max function in Schnerr-Sauer Cavitation File
New Member
Join Date: Jul 2017
Posts: 4
Rep Power: 5
dviam is on a distinguished road
I am a bit unsure that the min/max functions are working properly in the Schnerr-Sauer cavitation model. The current code reads as:

Foam::phaseChangeTwoPhaseMixtures::SchnerrSauer::mDotAlphal() const
    const volScalarField& p = alpha1_.db().lookupObject<volScalarField>("p");
    volScalarField pCoeff(this->pCoeff(p));

    volScalarField limitedAlpha1(min(max(alpha1_, scalar(0)), scalar(1)));

    return Pair<tmp<volScalarField>>
        Cc_*limitedAlpha1*pCoeff*max(p - pSat(), p0_),

        Cv_*(1.0 + alphaNuc() - limitedAlpha1)*pCoeff*min(p - pSat(), p0_)
It should be noted that p0_ is simply the scalar 0. Consider the case where p-pSat() > 0. This means that the first term in the pair Cc_*.... should have a non-zero value while the second term Cv_*.... should have a value of zero. It should be the case that these pairs never have both non-zero values at the same time. This is, however, not the case. Writing the pair to disk shows that there are instances where both values in the pair have non-zero ideas.

Any ideas how this can be corrected? Or am I interpreting the code incorrectly.

dviam is offline   Reply With Quote


cavitation, openfoam, schnerr-sauer

Thread Tools Search this Thread
Search this Thread:

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
polynomial BC srv537 OpenFOAM Pre-Processing 4 December 3, 2016 09:07
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08

All times are GMT -4. The time now is 16:10.