Dear Lorenzo,

I just had a look into your problem.hhh file, and I saw that in your implementation of the /dirichletAtPos/ function:

PrimaryVariables dirichletAtPos(const GlobalPosition &globalPos) const
    {
        PrimaryVariables priVars = initial_(globalPos);

//        if (useDirichlet_)
//        {
//            if (isInjectionArea_(globalPos))
//            {
//                priVars.setState(Indices::bothPhases);
//                priVars[switchIdx] = 0.2;
//                return priVars;
//            }
//        }

    // condition for the polymer mole fraction at left boundary
        if (globalPos[0] < eps_ )
        {
            //values[saturationOILIdx] = 0.25; // inject water
            //values[pressureH2OIdx] = 34e6;

            //values[PolymerIdx]  = 0.01;
            //values[pressureIdx] = 34e6;

        // TODO: this may change with time to allow
        //          water+polymer+water slug scenario
        priVars.setState(Indices::bothPhases);
            priVars[switchIdx] = 0.1;
            priVars[pressureIdx] = 0.3e5;
            return priVars;

        }
    }


you only return primary variables in the if clause at the end, i.e. if (globalPos[0] < eps_). So on the remaining Dirichlet boundaries the return is undefined. You should place the return priVars statemen at the end of the function outside of the if-clause.

Apart from that, I think you might have to rethink your combination of initial and boundary conditions. First of all, in your initial conditions you are setting zero water pressures everywhere, except for the right boundary where you prescribe negative pressures (for cell-centered schemes this would be ignored as you do a position check with the right boundary which no degree of freedom reaches in cc schemes). I would encourage you to only use positive pressures for which water is in liquid state since you are using a fluid system which expects water to be liquid. In case your applications has these very low pressures, you should rethink the fluid system you are using I suppose.

Moreover, I am unsure about your choices of initial/boundary conditions for priVars[switchIdx]. It seems to me that initially there should be only the water phase present, but then you are setting a nitrogen mole fraction of 0.99 which to me seems counterintuitive.

I hope this helps a bit!

Best wishes,
Dennis


On 30.03.20 13:03, lk wrote:
Dear Dumux community,

I'm experiencing some difficulty with the attached simulation.

I borrowed it from 2p2c implicit examples and performed minimal modifications which to me should not create any problem.

It seems I am wrong but I cannot figure out where!

May I ask you help to detect anything wrong, please?


Kind regards,

Lorenzo


_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
_______________________________________________
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to