Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dambreak_solver_options test redesign #1063

Open
zhang-alvin opened this issue Jan 20, 2020 · 0 comments
Open

Dambreak_solver_options test redesign #1063

zhang-alvin opened this issue Jan 20, 2020 · 0 comments

Comments

@zhang-alvin
Copy link
Contributor

Problem mentioned in issue #1056.

The TwoPhaseFlow/dambreak_solver_options test fails via the hashdist build but not via the conda build.

=================================== FAILURES ===================================
�[31m�[1m________________ TestTwoPhaseFlow.test_damBreak_solver_options _________________�[0m
[gw0] linux -- Python 3.7.2 /home/travis/build/erdc/proteus/linux/bin/python
self = <proteus.tests.TwoPhaseFlow.test_TwoPhaseFlow.TestTwoPhaseFlow object at 0x7ccec18>

    def test_damBreak_solver_options(self):
        os.system("parun --TwoPhaseFlow --path " + self.path + " "
                  "damBreak_solver_options.py -l5 -v -C 'final_time=0.1 dt_output=0.1 he=0.1'")
>       self.compare_vs_saved_files("damBreak_solver_options")

proteus/tests/TwoPhaseFlow/test_TwoPhaseFlow.py:67: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <proteus.tests.TwoPhaseFlow.test_TwoPhaseFlow.TestTwoPhaseFlow object at 0x7ccec18>
name = 'damBreak_solver_options'

    def compare_vs_saved_files(self,name):
        actual = tables.open_file(name+'.h5','r')
    
        expected_path = 'comparison_files/' + 'comparison_' + name + '_phi_t2.csv'
        #write comparison file
        #np.array(actual.root.phi_t2).tofile(os.path.join(self._scriptdir, expected_path),sep=",")
>       np.testing.assert_almost_equal(np.fromfile(os.path.join(self._scriptdir, expected_path),sep=","),np.array(actual.root.phi_t2).flatten(),decimal=10)
E       AssertionError: 
E       Arrays are not almost equal to 10 decimals
E       
E       Mismatch: 100%
E       Max absolute difference: 0.12644174
E       Max relative difference: 1.27583147
E        x: array([-0.6281821969,  1.9642545046,  2.5372557862,  1.1639619602,
E               0.7474668495,  1.3850260196,  2.1816673879,  1.729152002 ,
E               0.9487286845,  1.2566472109,  1.5379914368,  1.3029162311,...
E        y: array([-0.6391312677,  2.0310413596,  2.5577650745,  1.1762542886,
E               0.8369607758,  1.3825964545,  2.2229598418,  1.7347065252,
E               0.9678189718,  1.2609615221,  1.5385438642,  1.3023196779,...

proteus/tests/TwoPhaseFlow/test_TwoPhaseFlow.py:44: AssertionError

In fact, the numerics fail fairly early on.

[       0] ==============================================================
[       0] Solving over interval [ 0.00000e+00, 1.00000e-03]
[       0] ==============================================================
[       0] Min_dt_controller setSubsteps tList=[0.001] self.t_model=0.001 self.substeps= [0.001] 
[       0] Min_dt_controller setSubsteps tList=[0.001] self.t_model=0.001 self.substeps= [0.001] 
[       0] System time step t= 1.00000e-03, dt= 1.00000e-03
[       0] saving previous velocity dofs 0
[       0] Split operator iteration 0
[       0] Model: rans2p
[       0] Fractional step  1.00000e-03 for model rans2p
[       0] Model step t= 1.00000e-03, dt= 1.00000e-03 for model rans2p
[       0] Model substep t= 1.00000e-03 for model rans2p
[       0] Model substep t= 1.00000e-03 for model rans2p model.timeIntegration.t=  1.00000e-03
[       0] Maximum CFL = 0.0
[       0]    Newton it 0 norm(r) =  5.81811e+00  		 norm(r)/(rtol*norm(r0)+atol) = 5.81811e+09 test=r
[       0] before ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= False ksp.its= 0 ksp.norm= 0.0 
[       0] after ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= True ksp.its= 22 ksp.norm= 2.7198399351813935e-09 reason = 2
[       0] Maximum CFL = 4.2185181435780866e-05
[       0]    Newton it 1 norm(r) =  5.06826e-03  		 norm(r)/(rtol*norm(r0)+atol) = 5.06826e+06 test=r
[       0] before ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= False ksp.its= 22 ksp.norm= 2.7198399351813935e-09 
[       0] after ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= True ksp.its= 22 ksp.norm= 1.0294966186689725e-12 reason = 2
[       0] Maximum CFL = 4.227390254218761e-05
[       0]    Newton it 2 norm(r) =  1.35207e-05  		 norm(r)/(rtol*norm(r0)+atol) = 13520.7 test=r
[       0] before ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= False ksp.its= 22 ksp.norm= 1.0294966186689725e-12 
[       0] after ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= True ksp.its= 22 ksp.norm= 6.193521028209155e-15 reason = 2
[       0] Maximum CFL = 4.227385204190255e-05
[       0]    Newton it 3 norm(r) =  1.17514e-08  		 norm(r)/(rtol*norm(r0)+atol) = 11.7514 test=r
[       0] before ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= False ksp.its= 22 ksp.norm= 6.193521028209155e-15 
[       0] after ksp.rtol= 1e-09 ksp.atol= 1e-20 ksp.converged= True ksp.its= 22 ksp.norm= 5.940964936203353e-18 reason = 2
[       0] Maximum CFL = 4.2273852020229116e-05
[       0]    Newton it 4 norm(r) =  1.98236e-11  		 norm(r)/(rtol*norm(r0)+atol) =  1.98236e-02
[       0] Step Taken, t_stepSequence= 0.001 Model step t= 1.00000e-03, dt= 1.00000e-03 for model rans2p
[       0] Model: clsvof
[       0] Fractional step  1.00000e-03 for model clsvof
[       0] Model step t= 1.00000e-03, dt= 1.00000e-03 for model clsvof
[       0] Model substep t= 1.00000e-03 for model clsvof
[       0] Model substep t= 1.00000e-03 for model clsvof model.timeIntegration.t=  1.00000e-03
[       0] +++++ Spin up to start with disc ICs +++++
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  5.58950e-01  		 norm(r)/(rtol*norm(r0)+atol) = 539.09 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 0 ksp.norm= 0.0 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 10 ksp.norm= 0.0030050066645684026 reason = 2
[       0] ls #1 norm_r_cur=0.919566224827264 atol=0.00103684 rtol=0
[       0] ls #2 norm_r_cur=0.2800604074327376 atol=0.00103684 rtol=0
[       0] Linesearches = 2
[       0]    Newton it 1 == maxIts FAILED convergenceTest = r
[       0]    Newton it 1 norm(r) =  2.80060e-01  		 norm(r)/(rtol*norm(r0)+atol) =  2.70110e+02
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  3.82157e-01  		 norm(r)/(rtol*norm(r0)+atol) = 368.578 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 10 ksp.norm= 0.0030050066645684026 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 6 ksp.norm= 0.0013542895798390295 reason = 2
[       0]    Newton it 1 == maxIts FAILED convergenceTest = r
[       0]    Newton it 1 norm(r) =  3.81313e-02  		 norm(r)/(rtol*norm(r0)+atol) =  3.67764e+01
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  7.78754e-02  		 norm(r)/(rtol*norm(r0)+atol) = 75.1084 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 6 ksp.norm= 0.0013542895798390295 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 6 ksp.norm= 8.474135011046035e-05 reason = 3
[       0]    Newton it 1 == maxIts FAILED convergenceTest = r
[       0]    Newton it 1 norm(r) =  3.12001e-03  		 norm(r)/(rtol*norm(r0)+atol) =  3.00916e+00
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  2.07533e-02  		 norm(r)/(rtol*norm(r0)+atol) = 20.0159 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 6 ksp.norm= 8.474135011046035e-05 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 6 ksp.norm= 3.143365220490628e-05 reason = 3
[       0]    Newton it 1 norm(r) =  3.85318e-04  		 norm(r)/(rtol*norm(r0)+atol) =  3.71627e-01
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  4.70787e-01  		 norm(r)/(rtol*norm(r0)+atol) = 454.059 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 6 ksp.norm= 3.143365220490628e-05 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 4 ksp.norm= 9.323844517860051e-06 reason = 3
[       0]    Newton it 1 == maxIts FAILED convergenceTest = r
[       0]    Newton it 1 norm(r) =  1.14745e-02  		 norm(r)/(rtol*norm(r0)+atol) =  1.10668e+01
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  1.99105e-02  		 norm(r)/(rtol*norm(r0)+atol) = 19.203 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 4 ksp.norm= 9.323844517860051e-06 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 3 ksp.norm= 1.7797814134492084e-05 reason = 3
[       0]    Newton it 1 norm(r) =  9.77294e-05  		 norm(r)/(rtol*norm(r0)+atol) =  9.42569e-02
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  1.64986e-01  		 norm(r)/(rtol*norm(r0)+atol) = 159.124 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 3 ksp.norm= 1.7797814134492084e-05 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 7 ksp.norm= 0.0001335953675773493 reason = 2
[       0]    Newton it 1 == maxIts FAILED convergenceTest = r
[       0]    Newton it 1 norm(r) =  6.49833e-03  		 norm(r)/(rtol*norm(r0)+atol) =  6.26744e+00
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  1.18863e-01  		 norm(r)/(rtol*norm(r0)+atol) = 114.64 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 7 ksp.norm= 0.0001335953675773493 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 6 ksp.norm= 6.911448004381769e-05 reason = 3
[       0]    Newton it 1 norm(r) =  8.04089e-04  		 norm(r)/(rtol*norm(r0)+atol) =  7.75519e-01
[       0] +++++ Pre re-distancing +++++
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  9.63670e-03  		 norm(r)/(rtol*norm(r0)+atol) = 9.2943 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 6 ksp.norm= 6.911448004381769e-05 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 6 ksp.norm= 4.617002923309927e-05 reason = 3
[       0]    Newton it 1 norm(r) =  2.13174e-04  		 norm(r)/(rtol*norm(r0)+atol) =  2.05600e-01
[       0] +++++ Nonlinear CLSVOF +++++
[       0]   ... Normal reconstruction via weighted lumped L2-projection ...
[       0]    Newton it 0 norm(r) =  1.77596e+00  		 norm(r)/(rtol*norm(r0)+atol) = 1712.86 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 6 ksp.norm= 4.617002923309927e-05 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 9 ksp.norm= 6.919419918451551e-05 reason = 3
[       0]    Newton it 1 norm(r) =  6.82798e-02  		 norm(r)/(rtol*norm(r0)+atol) = 65.8537 test=r
[       0] before ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= False ksp.its= 9 ksp.norm= 6.919419918451551e-05 
[       0] after ksp.rtol= 0.001 ksp.atol= 0.00010368400000000005 ksp.converged= True ksp.its= 2 ksp.norm= 3.63898829685863e-05 reason = 3
[       0]    Newton it 2 norm(r) =  1.97502e-04  		 norm(r)/(rtol*norm(r0)+atol) =  1.90484e-01
[       0] Step Taken, t_stepSequence= 0.001 Model step t= 1.00000e-03, dt= 1.00000e-03 for model clsvof
[       0] Step Taken, Model step t= 1.00000e-03, dt= 1.00000e-03 for model clsvof
[       0] RANS2P.SubgridError: switched to lagged subgrid error
[       0] RANS2P.ShockCapturing: switched to lagged shock capturing
[       0] RANS2P: max numDiff_1 3.423463e-01 numDiff_2 3.423463e-01 numDiff_3 3.423463e-01
[       0] Min_dt_controller setSubsteps tList=[0.003] self.t_model=0.003 self.substeps= [0.003] 
[       0] Min_dt_controller setSubsteps tList=[0.003] self.t_model=0.003 self.substeps= [0.003] 
[       0] Step Taken, System time step t= 1.00000e-03, dt= 1.00000e-03
[       0] Potential System time step t= 3.00000e-03, dt= 2.00000e-03 for next step
[       0] Calculate called at time 0.001
[       0] Calculate called at time 0.001
[       0] Writing mesh header for  model = rans2p at time t=0.001
[       0] Writing solution for  model = rans2p
[       0] Writing mesh header for  model = clsvof at time t=0.001
[       0] Writing solution for  model = clsvof
[       0] Writing initial vof from clsvof at time t=0.001
[       0] Writing quantity of interest at DOFs for = clsvof at time t=0.001
[       0] Syncing Archive
[       0] Gathering Archive Time step
[       0] Done Gathering Archive Time Step
[       0] Done Syncing Archive

My experience was that refining the mesh did not resolve this issue, which suggests that the test should be redesigned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant