<div dir="ltr">Hi,<div><br></div><div>I am developing a fully implicit control volume finite element black oil reservoir simulator using petscdmplex and snes. So far, for 2 phase flow problems (3 by 3 block for pressure, saturation and bottomhole pressure), my simulator runs fine for small time step sizes in the order of less than 5 days. However, increasing the time step size, it doesn't converge with -3 (-5 sometimes) diverge reason. Considering that this is a fully implicit but nonlinear problem, I expect unconditional stability for reasonable time step sizes.</div><div><br></div><div> The background DM for the 3 block problem is a composite one with the first two being DMPLES's (<span style="font-family:Menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">bag->plexScalNode </span>for pressure and saturation) and the last one, <span style="font-family:Menlo;font-size:11px;font-variant-ligatures:no-common-ligatures">bag->WellRedun,</span> a redundant DM for the wellbore pressures. See below.</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = DMRedundantCreate(PETSC_COMM_WORLD,</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,bag->numWells,&bag->WellRedun);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = DMCompositeCreate(PETSC_COMM_WORLD,&bag->MultiPhasePacker);CHKERRQ(ierr);</span></p></div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>ierr = DMCompositeAddDM(bag->MultiPhasePacker,bag->plexScalNode);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">        </span>ierr = DMCompositeAddDM(bag->MultiPhasePacker,bag->plexScalNode);CHKERRQ(ierr);</span></p>
<div><span class="gmail-Apple-converted-space" style="font-variant-ligatures:no-common-ligatures;font-family:Menlo;font-size:11px">        </span><span style="font-variant-ligatures:no-common-ligatures;font-family:Menlo;font-size:11px">ierr = DMCompositeAddDM(bag->MultiPhasePacker,bag->WellRedun);CHKERRQ(ierr);</span> </div><div><br></div><div>I have used nested matrices as shown below. In addition, I used the fieldsplit (composite multiplicative) preconditioner with FGRES and least square for newton solver. See below.</div><div><br></div><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">ierr = MatCreateNest(PETSC_COMM_WORLD,Msize,is,Msize,is,&bK[</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">],K);CHKERRQ(ierr);</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = SNESGetKSP(bag->snesP,&kspP);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = KSPSetTolerances(kspP,</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">1.e-8</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,</span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">1.e-8</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,PETSC_DEFAULT,PETSC_DEFAULT);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = KSPSetType(kspP,KSPFGMRES);CHKERRQ(ierr);</span></p>
<p class="gmail-p2" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span class="gmail-Apple-converted-space" style="font-variant-ligatures:no-common-ligatures;color:rgb(34,34,34)">    </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(34,34,34)">ierr = KSPSetFromOptions(kspP);CHKERRQ(ierr);</span><br></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = KSPGetPC(kspP,&pcP);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = PCSetType(pcP, PCFIELDSPLIT);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = DMCompositeGetGlobalISs(bag->MultiPhasePacker,&is);CHKERRQ(ierr); </span></p><div>





<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>for(i = </span><span class="gmail-s2" style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">; i < Msize; i++)<span class="gmail-Apple-converted-space">  </span>ierr = PCFieldSplitSetIS(pcP,</span><span class="gmail-s3" style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">NULL</span><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">,is[i]);CHKERRQ(ierr);</span></p>
<p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space">    </span>ierr = PCFieldSplitSetType(pcP,PC_COMPOSITE_MULTIPLICATIVE);CHKERRQ(ierr);</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Any ideas on possible precoditioner options/solver options/combinations to improve stability will be appreciated.</span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p><p class="gmail-p1" style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo"><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">Chuks</span></p></div><div><br></div></div></div>