<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Hi,<br>
<br>
I have made a two-phase flow code which computes motion of two phases in one dimension, where the phases are allowed to intermix. This code relies on a finite difference Jacobian computed using the standard coloring I get from the DMDA object:<br>
<br>
   da = PETSc.DMDA().create(<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">        dim=(N_vertical,),<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">        dof=3,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">        stencil_width=1,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">    )<br>
<br>
I now want to add a variable for the interphase height L_z in addition to a velocity u_v, giving the velocity of the vapor flowing in to the interface. The interface will move throughout the grid, meaning that these two variables will not be coupled to a fixed
 set of grid cells, but will be coupled to different sets of three grid cells throughout the simulation.<br>
<br>
Questions:<br>
<br>
1. Is it possible to create a custom coloring to efficiently compute the finite difference Jacobian including the interphase height and vapor velocity?<br>
<br>
2. How do I revert to computing the full finite difference Jacobian with the purpose of testing if the interphase model works?<br>
<br>
Best regards,<br>
Eirik Jaccheri Høydalsvik<br>
Sintef ER and NTNU EPT<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</body>
</html>