epfl-ecps / channelflow

Channelflow is a software system for numerical analysis of the incompressible fluid flow in channel geometries, written in C++ and MPI-parallelized.
GNU General Public License v2.0
65 stars 29 forks source link

Generalized laminarProfile() for ASBL with dPdx and Ubulk #9

Closed johnfgibson closed 5 years ago

johnfgibson commented 5 years ago

Reogranized and generalized the ChebyCoeff laminarProfile(Real nu, MeanConstraint constraint, ...) function to handle ASBL (Vsuck != 0) conditions with bulk velocity constraint and nonzero pressure gradient. While at it modified the regular ASBL profile code to call expm1 function rather than computing exp(x) -1, which loses digits for small x, and reformulated so that the args of these functions are always of form y-a rather than plain old y.

Added a laminarTest.cpp to the test suite. This calls laminarProfile for 1000 random laminar flow conditions and verifies the resulting U(y) satisfies momentum balance, boundary condtions, and the constraint.

This was triggered by trying to describe the baseflow + perturbation decomposition for the channelflow-2.0 paper. Having the general case covered makes it easier to describe.

mirkofarano commented 5 years ago

Hi @johnfgibson, The continuous integration failed because there is an unused variable in your test.

[ 85%] Building CXX object tests/CMakeFiles/tausolverTest_app.dir/tausolverTest.cpp.o
/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp: In function ‘int main(int, char**)’:
/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp:29:12: error: unused variable ‘cfmpi’ [-Werror=unused-variable]
     CfMPI* cfmpi = NULL;
            ^~~~~
/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp: At global scope:
/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp:156:5: error: expected unqualified-id before ‘return’
     return (passtest == true) ? 0 : 1;
     ^~~~~~
/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp:157:1: error: expected declaration before ‘}’ token
 }
 ^
cc1plus: all warnings being treated as errors
johnfgibson commented 5 years ago

Hmmm. Style guidelines and unit & integration tests passed, but it looks like build tests did not run.

mirkofarano commented 5 years ago

The CI is complaining again.

/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp:154:5: error: expected unqualified-id before ‘return’
     return (passtest == true) ? 0 : 1;
     ^~~~~~
/home/travis/build/epfl-ecps/channelflow/tests/laminarTest.cpp:155:1: error: expected declaration before ‘}’ token
 }
mirkofarano commented 5 years ago

Hmmm. Style guidelines and unit & integration tests passed, but it looks like build tests did not run.

Sometimes some of the CI tests don't start and needed to be restarted.

codecov-io commented 5 years ago

Codecov Report

Merging #9 into master will increase coverage by 0.1%. The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master       #9     +/-   ##
=========================================
+ Coverage   27.11%   27.22%   +0.1%     
=========================================
  Files          63       63             
  Lines       15321    15333     +12     
  Branches     7256     7258      +2     
=========================================
+ Hits         4154     4174     +20     
+ Misses      11167    11159      -8
Impacted Files Coverage Δ
channelflow/nse.cpp 67.31% <96.42%> (+1.08%) :arrow_up:
channelflow/chebyshev.cpp 38.72% <0%> (+0.79%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update adafa77...235edbd. Read the comment docs.

mirkofarano commented 5 years ago

All test passed now. I'll have a better look at the code tomorrow, then I'll approve your PR.

johnfgibson commented 5 years ago

This latest PR makes the safeguard on Vsuck clearer and more robust. Doing it the way you suggested eliminates an error and exit when Vsuck H/nu is very small and smoothly transitions from the ASBL formulae to the PPF/PCF formulae as Vsuck H/nu -> 0.

johnfgibson commented 5 years ago

It's time to add a c++-mode-untabify-hook to my .emacs file....also how to squash commits to make a clean PR.