Dear Ali,

as far as I can see from your code your boundary conditions on the top boundary are set correctly.

- Can you check if you have a fixed pressure at your top boundary.
- Can you check whether CO2 leaves your system?

Kind regards
Alex

On 11/25/2013 04:59 PM, [email protected] wrote:

Dear Alexandre and Christoph,

Thanks a lot for all your answers and advises.

Unfortunately, I forgot to ask you a question in my last email.

My question concerns the boundary type in DuMux.

I would like to know, if it is possible, in co2 problem (2p2c problem), to only fix the pressure of the Brine phase on a boundary and set outflow boundary condition for CO2. If I understood correctly, we can use setDirichlet <http://www.dumux.org/doxygen-trunk/html/class_dumux_1_1_boundary_types.php#a9498f930ad5563ae4f671c5a019dcd35>(int pvIdx, int eqIdx) for a primary variable in dumux.

With :

pressureIdx = Indices::pressureIdx,

conti0EqIdx = Indices::conti0EqIdx,

contiBrineEqIdx = conti0EqIdx + BrineIdx,

contiCO2EqIdx = conti0EqIdx + CO2Idx

I managed my code as follow. As can be seen the outflow condition is on upperboundary, and therefore, co2 should migrate vertically out of domain. However, the results show that co2 migrate horizontally. It can only happen if I have a zero flux neumann boundary type at this position.

If I cannot use values.setDirichlet(pressureIdx, contiBrineEqIdx) in the way that is used in my code, it can explain my problems.

void boundaryTypes(BoundaryTypes &values, const Vertex &vertex) const

{

const GlobalPosition globalPos = vertex.geometry().center();

 if (onUpperBoundary(globalPos)){

values.setOutflow(contiCO2EqIdx);

values.setDirichlet(pressureIdx, contiBrineEqIdx);

}else if (onRightBoundary(globalPos) || onLowerBoundary(globalPos)){

values.setAllDirichlet();

}else{

values.setAllNeumann();

}

}

bool onLeftBoundary(const GlobalPosition &globalPos) const

{ return globalPos[0] < this->bboxMin()[0] + eps_; }

bool onRightBoundary(const GlobalPosition &globalPos) const

{ return globalPos[0] > this->bboxMax()[0] - eps_; }

bool onLowerBoundary(const GlobalPosition &globalPos) const

{ return globalPos[2] < this->bboxMin()[2] + eps_; }

bool onUpperBoundary(const GlobalPosition &globalPos) const

{ return globalPos[2] > this->bboxMax()[2] - eps_; }

Thanks again for your help

Best regards

Ali NOWAMOOZ

*From:*[email protected] [mailto:[email protected]] *On Behalf Of *Alexander Kissinger
*Sent:* jeudi 21 novembre 2013 05:58
*To:* DuMuX User Forum
*Subject:* Re: [DuMuX] parallel computing in version 2.4

Hi Ali,


I would like to ask you a question about intersectionToVertexBC_.boundaryTypes(values, vertex) function. I cannot understand where, why and how it should be used.

For box model, I remove it from code without any problem, as you can see in heterogeneousproblem.hh. I used :

void boundaryTypes(BoundaryTypes &values, const Vertex &vertex) const

to define my boundary types.


we use this function to assign the type of boundary condition depending on a boundary Id that is defined in the gird file. In order to access the boundary Id from the grid file, we need the intersection objects. - First boundaryTypes(BoundaryTypes &values, const Vertex &vertex) is called with the vertex as an argument - intersectionToVertexBC_.boundaryTypes(values, vertex) is then called which calls void boundaryTypes(BoundaryTypes &values, const Intersection &intersection) giving an intersection objects for the vertex. Now the boundary Id from the grid file can be obtained, and the boundary condition types can be
defined accordingly.
This procedure is only necessary if you have a complex grid and you would like to specify the boundary conditions from the grid file. In all other cases using only boundaryTypes(BoundaryTypes &values, const Vertex &vertex)
is the way to go.

As I explained, I had a problem with cell-centered models. I added two voids in co2models that let me calculate the advective flux and diffusive flux. I followed the explanations given by Alexander Kissinger to write these voids.

However, it seems that they don't work for cell-centered problems. You cans find the error message in test_ccco2.stderr. Can you please take a look at co2model.hh and explain me how I can calculate flux when I use cell-centered model?

We have not used this function for the CC method. But we are currently setting up a model with the CC method, where we also want to measure the advective fluxes. I can inform you if we have a function that works with CC method as well.

kind regards
Alex





On 11/21/2013 08:54 AM, [email protected] <mailto:[email protected]> wrote:

    Dear Bernd,

    Thanks a lot for your help and comments.

    I am sorry for my late answer. We had several problems to install
    dune-pdelab and to apply patches. Good news, we finally solved all
    our problems.

    The test_box1pwithamg and test_cc1pwithamg are running without any
    problem, however, I have a warning message about SuperLU.

    WARNING: You are using AMG without SuperLU! Please consider
    installing SuperLU, or set the use superlu flag to false to
    suppress this warning.

    I mentioned that SuperLU is by default included in amg.hh :
    #include<dune/istl/superlu.hh>. Now, is it really necessary to
    install SuperLU or I can continue my simulations without it?

    I also applied the necessary modifications in heterogeneousproblem
    to use AMG as the linear solver.

    I ran a 100 years simulation using the box model (not
    cell-centered as you mentioned in your previous mail, I have a
    problem with cell-centered that I will explain it later).

    I have the same warning about SuperLU, as before. Comparing the
    results of this problem with results of test_box1pwithamg problem,
    I found a difference that make me doubt if the AMG is really used
    in my problem.

    In test_box1pwithamg, each time that the linear solver couldn't
    converge, I had this message :

    [Newton: Caught exception: "MathError
    
[mgc:/rap/jda-332-aa/apps/dumux-2.4.0-2/dune-istl-2.2.1/dune/istl/paamg/amg.hh:739]:
    Coarse solver did not converge"

    Newton solver did not converge with dt=6026.29 seconds. Retrying
    with time step of 3013.15 seconds

    But in heterogeneousproblem, I had this message :

    [Newton: Caught exception: "ISTLError
    
[apply:/rap/jda-332-aa/apps/dumux-2.4.0-2/dune-istl-2.2.1/dune/istl/solvers.hh:768]:
    breakdown in BiCGSTAB - rho 0 <= EPSILON 1e-80 after 59.5 iterations"

    Newton solver did not converge with dt=7.59684e+06 seconds.
    Retrying with time step of 3.79842e+06 seconds

    These messages should not be related and should come from two
    different steps, but I would like to have your confirmation. I
    send you the heterogeneousproblem.hh file (Lines 89 and 90) for
    your attention.

    As I explained, I had a problem with cell-centered models.  I
    added two voids in co2models that let me calculate the advective
    flux and diffusive flux.  I followed the explanations given by
    Alexander Kissinger to write these voids.

    However, it seems that they don't work for cell-centered problems.
    You cans find the error message in test_ccco2.stderr. Can you
    please take a look at co2model.hh and explain me how I can
    calculate flux when I use cell-centered model?

    I would like to ask you a question about
    intersectionToVertexBC_.boundaryTypes(values, vertex) function. I
    cannot understand where, why and how it should be used.

    For box model, I remove it from code without any problem, as you
    can see in  heterogeneousproblem.hh. I used :

    void boundaryTypes(BoundaryTypes &values, const Vertex &vertex) const

    to define my boundary types.

    For cell-centered model, as you can see in
    heterogeneousproblem_cc_without_intersectionToVertexBC, I used :

    void boundaryTypesAtPos(BoundaryTypes &values, const
    GlobalPosition &globalPos) const

    to define my boundary types.

    Thanks a lot for your help and collaboration.

    Best regards

    Ali NOWAMOOZ

    *From:*[email protected]
    <mailto:[email protected]>
    [mailto:[email protected]] *On Behalf Of
    *Bernd Flemisch
    *Sent:* mardi 22 octobre 2013 03:23
    *To:* DuMuX User Forum
    *Subject:* Re: [DuMuX] parallel computing in version 2.4

    Hi Ali,

    it is nice to hear that you already use Dumux for advanced problems.

    What kind of linear solver do you use? From our experience, the
    standard linear solvers will not work nicely for more complex
    problems in parallel.

    Since Dumux 2.3, we have a backend for the ISTL AMG solver. We are
    using that for our parallel CO2 computations. You can have a look
    at how to use it from test/implicit/1p/test_cc1pwithamg and the
    problem file in there. You first need to install the DUNE module
    dune-pdelab, http://www.dune-project.org/pdelab/, version 1.0 or
    1.1 and to apply patches to dune-istl and dune-pdelab. See
    dumux/patches/README for details. You then need to rerun dunecontrol.

    For heterogeneous parameters, it can also be benefitial to use the
    cell-centered version instead of box (vertex-centered). You can
    have a look at the co2 test problem file to see how this is done.

    Currently, the salinity is a public static variable of the Brine
    component and not intended to be varying over space. If you use
    the BrineCO2FluidSystem in the standard way, the density and
    viscosity values of the brine will be tabulated depending on this
    salinity. You can use an untabulated version, see the
    documentation of BrineCO2FluidSystem at line 745ff. Beware that
    this can slow down your computation.

    Once you use an untabulated Brine component, you could manipulate
    the static salinity value. In a quick and dirty way, you could do
    this at the very beginning of the update function in
    co2volumevariables.hh, line 122, for example

      if (element.geometry().center()[2] < 1000.0)
        FluidSystem::Brine::salinity = 0.1;
      else
        FluidSystem::Brine::salinity = 0.05;

    Then all the secondary variables like density would be calculated
    depending on this salinity value.

    Please let us know how this works out.

    Kind regards
    Bernd

    On 10/22/2013 01:59 AM, Ali NOWAMOOZ wrote:

        Dear Dumux,

        First, I would like to congratulate all DuMux team for this
        new version.

        I have a question about the new version of DuMux :

        I would like to know If any progress has been made on the parallel 
computing in this version comparing to version 2.3. We could install dumux on 
Clumeq (server of laval universityhttps://www.calculquebec.ca/index.php/en/) 
and run a CO2 2p2c model on 96 processors (12 nodes * 8 processors). However, 
we recognized a problem with the linear solvers of DUNE that couldn't converge 
(actually, it converged but only with time steps lower than 500 s). I found 
some explanations on the dumux website at this 
addresshttp://www.mail-archive.com/[email protected]/msg00006.html.
 According to this mail, the parallel version of dumux was experimental at that 
moment. Pl

          ea<

          /

        o:p>

          se let me

          know if it is also the case in the new version. If you need any more 
information, please let me know. I can also run a model and send you the 
results.

        I have also a question about CO2 model. I would like to know if it is 
possible to define different salinities in the domain. I don't want to simulate 
the salt transport. I only need to distinct fresh water from brine in my domain.

        Best regards

        Ali NOWAMOOZ





        _______________________________________________

        Dumux mailing list

        [email protected]  
<mailto:[email protected]>

        https://listserv.uni-stuttgart.de/mailman/listinfo/dumux





--
    _______________________________________________________________

         !!!! CMWR 2014: 10th - 13th June 2014 in Stuttgart !!!!

                       Please visitwww.cmwr14.de  <http://www.cmwr14.de>

    _______________________________________________________________

    Bernd Flemisch                         phone: +49 711 685 69162

    IWS, Universität Stuttgart             fax:   +49 711 685 60430

    Pfaffenwaldring 61            email:[email protected]  
<mailto:[email protected]>

    D-70569 Stuttgart            url:www.hydrosys.uni-stuttgart.de  
<http://www.hydrosys.uni-stuttgart.de>

    _______________________________________________________________




    _______________________________________________

    Dumux mailing list

    [email protected]  <mailto:[email protected]>

    https://listserv.uni-stuttgart.de/mailman/listinfo/dumux




--
*******************************************************
!!!! CMWR 2014: 10th - 13th June 2014 in Stuttgart !!!!
         Please visitwww.cmwr14.de  <http://www.cmwr14.de>
*******************************************************
Alexander Kissinger
Institut für Wasser- und Umweltsystemmodellierung
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung
Pfaffenwaldring 61
D-70569 Stuttgart
Telefon: +49 (0) 711 685-64729
E-Mail:[email protected]  
<mailto:[email protected]>


_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


--
*******************************************************
!!!! CMWR 2014: 10th - 13th June 2014 in Stuttgart !!!!
        Please visit www.cmwr14.de
*******************************************************
Alexander Kissinger
Institut für Wasser- und Umweltsystemmodellierung
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung
Pfaffenwaldring 61
D-70569 Stuttgart

Telefon: +49 (0) 711 685-64729
E-Mail:  [email protected]

_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to