Hi,

the first if-query is wrong, corresponding to your boundary conditions:

    if x < 20m and y < 20 m: q_w.n = -1e-8 and Sw=1
    if x > 580 and y > 580: pw= 150 bar and Sn=1

it should be
if ((globalPos[0] > 580- eps_) && (globalPos[1] > 580- eps_) )
            {
                bcTypes.setDirichlet(pressEqIdx);
                bcTypes.setDirichlet(satEqIdx);
//bcTypes.setAllDirichlet(); // alternative if the same BC is used for both types of equations
            }

instead of:
if ((globalPos[0] > 600- eps_) && (globalPos[1] > 600- eps_) )
            {
                bcTypes.setDirichlet(pressEqIdx);
                bcTypes.setDirichlet(satEqIdx);
//bcTypes.setAllDirichlet(); // alternative if the same BC is used for both types of equations
            }

Regards,
Martin

On 10/21/2015 07:34 PM, Ait Mahiout Latifa wrote:

Hi,
i want to change the boundary conditions in tutorial_decoupled problem, so that in an domain 600*600, are imposed the boundary conditions:
if x < 20m and y < 20 m: q_w.n = -1e-8 and Sw=1
if x > 580 and y > 580: pw= 150 bar and Sn=1
and no flux in the other parts of the domain.
So, i change x and y in the .input file, and i have the folowing modifications in the tutorial_decoupled.hh: void boundaryTypesAtPos(BoundaryTypes &bcTypes, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:bctype}@*/
    {
if ((globalPos[0] > 600- eps_) && (globalPos[1] > 600- eps_) )
            {
                bcTypes.setDirichlet(pressEqIdx);
                bcTypes.setDirichlet(satEqIdx);
//bcTypes.setAllDirichlet(); // alternative if the same BC is used for both types of equations
            }
            // all other boundaries
else if ((globalPos[0] < 20- eps_) && (globalPos[1] < 20- eps_) )
            {
                bcTypes.setNeumann(pressEqIdx);
                bcTypes.setDirichlet(satEqIdx);
//bcTypes.setAllNeumann(); // alternative if the same BC is used for both types of equations
            }
            else
                bcTypes.setAllNeumann();
    }
    //! Value for dirichlet boundary condition at position globalPos.
/*! In case of a dirichlet BC for the pressure equation the pressure \f$ [Pa] \f$, and for * the transport equation the saturation [-] have to be defined on boundaries.
     *
     *  \param values Values of primary variables at the boundary
     *  \param intersection The boundary intersection
     *
* Alternatively, the function dirichletAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) * could be defined, where globalPos is the vector including the global coordinates of the finite volume.
     */
void dirichletAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) const
    {
       if ((globalPos[0] >  600-  eps_) && (globalPos[1] >  600-  eps_) )
      {
        values[pwIdx] = 3.5e7;
        values[swIdx] = 0.0;
      }
else if ((globalPos[0] < 20- eps_) && (globalPos[1] < 20- eps_) )
        values[swIdx] = 1.0;
    }
//! Value for neumann boundary condition \f$ [\frac{kg}{m^3 \cdot s}] \f$ at position globalPos.
    /*! In case of a neumann boundary condition, the flux of matter
     *  is returned as a vector.
     *
     *  \param values Boundary flux values for the different phases
     *  \param globalPos The position of the center of the finite volume
     *
* Alternatively, the function neumann(PrimaryVariables &values, const Intersection& intersection) could be defined,
     *  where intersection is the boundary intersection.
     */
void neumannAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) const /*@\label{tutorial-decoupled:neumann}@*/
    {
        values = 0;
         if ((globalPos[0] <  20-  eps_) && (globalPos[1] <  20-  eps_) )
        {
            values[nPhaseIdx] = -1e-8;
             values[wPhaseIdx] = 0.0;
        }
       else

        {
            values[nPhaseIdx] = 0.0;
             values[wPhaseIdx] = 0.0;
        }
    }
    //! Initial condition at position globalPos.
    /*! Only initial values for saturation have to be given!
     *
     *  \param values Values of primary variables
     *  \param element The finite volume element
     *
* Alternatively, the function initialAtPos(PrimaryVariables &values, const GlobalPosition& globalPos) * could be defined, where globalPos is the vector including the global coordinates of the finite volume.
     */
    void initial(PrimaryVariables &values,
const Element &element) const /*@\label{tutorial-decoupled:initial}@*/
    {
        values = 0;
    }


There isn't a problem in compilation, but in execution, io have the folowing error:

 ./tutorial_decoupled

Wherever he saw a hole he always wanted to know the depth of it. To him this was important.
 - Jules Verne, A journey to the center of the earth

Rank 0: No parameter file given. Defaulting to './tutorial_decoupled.input' for input file.
Initializing problem 'tutorial_decoupled'
Dune reported error: ISTLError [apply:/home/latifa/Dumux_2.6.0/dune-istl-2.3.1/dune/istl/solvers.hh:679]: h=0 in BiCGSTAB

So please, where os the problem in my definition of the boundary conditions? An how i can arrange it?
Best regards.



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


--
M.Sc. Martin Schneider
University of Stuttgart         
Institute for Modelling Hydraulic and Environmental Systems
Department of Hydromechanics and Modelling of Hydrosystems
Pfaffenwaldring 61
D-70569 Stuttgart
Tel: (+49) 0711/ 685-69159
Fax: (+49) 0711/ 685-60430
E-Mail: [email protected]

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

Reply via email to