Mphase crash + accinput to many phases

Hi! I'll start with the problem:

*** Exception (JSphGpuSingle::ConstantDataUp) at JSphGpu.cpp:588
Text: Failed copying constants to GPU. (CUDA error 1 (invalid argument)).

I have several phases in the 2D simulation, automatically generated based on ice charts. I thought I could number the phases 0 - 100, one digit for ice concentration and the other for thickness, and then automatically define the phases that are present. Like this:

90 % ice cover (some 10 % of open water) ice of 20 cm thickness would be mkfluid="92". Due to python, it turns out as " 92 ", but I doubt the spaces matter.

I draw ice polygons as such:

           <setmkfluid mk=" 80 " />
           <drawprism mask="0">
             <point x=" 245.67086659497593 " y="0" z=" 232.77605047495103 " />
             <point x=" 245.46172876528348 " y="0" z=" 232.76075978287682 " />
             <point x=" 245.25234027576667 " y="0" z=" 232.75272171018273 " />
             <point x=" 245.02199585982353 " y="0" z=" 232.75435359606706 " />
             ...many more..
             ...And then the same with y="2"...

And define phases as such:

           <phase mkfluid=" 80 ">             <rhop value=" 800 " />
             <visco value="1.2" />
             <tau_yield value="0.0001" />
             <HBP_m value="100" />
             <HBP_n value="0.8" comment="lt 1: shear thinning gt 1: shear thickening" />
             <phasetype value="0" comment="Non-Newtonian=0 only option in v5.0" />

However, when I try to run DualSPHysics, I get PhaseCount:14, and the numbers run from 0 to 13..

[Multi-phase configuration]

==: PhaseCount:14
Phase 0
 Rho......: 200.000000
 Gamma....: 7.000000
 Viscosity: 1.200000


Do I need to number the phases from 0 onwards and without gaps?

A related question is that I try to apply the same accinput to all the phases. The wildcard * seems to work, but does it really?

        <accinput mkfluid="*">
          <acccentre x="0.0" y="0.0" z="0.0" comment="Center of acceleration" />
          <globalgravity value="0" comment="Global gravity enabled (1) or disabled (0)" />
          <acctimesfile value="CaseForcesData_0.csv" comment="File with acceleration data" />

Thank you for any input you might have.


  • Hi,

    On the multiphase solver: if I am not mistaken, we have restrict the mphase code to a maximum of 10 phases.

    see "#define MAXNUMBERPHASE 10"

    Can you please try and adjust you number of phases to 9 or 10?

    on your XML script:

    when you run gencase, please check the new xml file generated by gencase, you have a line similar to:

    <particles np="21001" nb="1001" nbf="1001" mkboundfirst="10" mkfluidfirst="1">


    <fixed count="1001" id="0-1000" mkcount="1" mkvalues="10" />

     <fluid count="20000" id="1001-21000" mkcount="1" mkvalues="1" />

    this will help you troubleshoot your problem.



  • Hi, thank you for your answer!

    I can confirm that just reordering the mk values doesn't help, but decreasing the number of phases does help. Thank you for the debug tips too.

    Can I increase the MAXNUMBERPHASE safely?

  • Hi,

    you can definitely try :)

    I am not sure of the maximum no. of phases though, sorry



Sign In or Register to comment.