> On 26. Oct 2018, at 16:35, lc <lorenzo.camp...@uniroma1.it> wrote:
> 
> Dear developers, maintainers and users,
> 
> I'm encountering some difficulties in applying a new Material law which is 
> not regularized and doesn't use EffToAbsLaw.
> 
> 
> I did as suggested previously, but when I comment the following lines I get 
> an error:
> #include <dumux/material/fluidmatrixinteractions/2p/efftoabslaw.hh>
> //typedef EffToAbsLaw<RawMaterialLaw> type;         
Hi Lorenzo,

well you can’t just comment this line. You have to replace it with

typedef ModBrooksCorey<Scalar> type;

so the whole property definition would be 

SET_PROP(TutorialSpatialParamsImplicit, MaterialLaw)
{
    typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
    typedef ModBrooksCorey < Scalar > type;
};



>    
> 
> In addition, when I use:
> #include <dumux/io/plotmateriallaw.hh>
> to plot Pc-Sw and kr profiles, I get constant behaviors.

This is most likely related to your wrong implementation and mixing of absolute 
and effective saturations.

(1) If you use the property as above (directly using the law without the 
EffToAbs wrapper),
you also don’t have parameter Snr, Swr (you hard-coded them inside 
ModBrooksCorey).
In that case (which is I think what you want to do), you implement your 
function in ModBrooksCorey expecting absolute saturations.

(2) In case you want to use the  EffToAbs wrapper, you have to set the 
parameters Snr, Swr, but then implement the functions
in ModBrooksCorey expecting effective saturations.

The plotting tool is a good way to see if your implementation is correct. Just 
plot it for saturations from 0 to 1 to see all of your function.

Timo

> I start to suspect that I didn't implement the Material Law correctly and 
> these effects are correlated.
> 
> To be more clear I add my files.
> 
> Can you give me some hint about mistakes, please?
> 
> 
> Thanks for help,
> 
> Lorenzo
> On 17/10/2018 16:53, Timo Koch wrote:
>> Hi Lorenzo,
>> 
>> 
>> On 17.10.2018 15:21, lc wrote:
>>> Dear developers and users,
>>> 
>>> I have some other questions.
>>> 
>>> 1) I successfully ran the tutorial_implicit  example from the handbook 
>>> 2.12. Now, I need to modify such test case in order to be consistent with 
>>> my requirements. 
>>> 
>>> In particular, I need to use a different relative permeability  and 
>>> capillarity pressure laws. In practice:
>>> 
>>> for the capillarity: 
>>> pc(s) = constant1 * (s-s_min)^alpha
>>> 
>>> for the permeabilities: 
>>> kr_w(s) = constant2 * (s-s_min)^beta 
>>> kr_n(s) = constant3 * (s_max-s)^beta
>>> 
>>> with s_min  and s_max other two given constants. 
>>> So, which is the best way to introduce such laws? And what about the 
>>> "regularization"? It should be applied to them also or I use them "as they 
>>> are"?
>> You would create a new class "MyLaw" (or whatever fits best) and a class 
>> "MyLawParams" that has the same interface as BrooksCorey and 
>> BrooksCoreyParams. In particular you need to implement, the pc-function and 
>> the kr-functions. Then you change the property "MaterialLaw" (the property 
>> is usually either set in problem.hh or spatialparams.hh) to use your class 
>> instead of the BrooksCorey class. You don't need to use regularization, if 
>> you don't want to, the same goes for the generalized EffToAbsLaw which takes 
>> care of converting absolute to effective saturations and the other way 
>> around. So you can just replace the whole thing by your new class.
>> The parameters go into your "MyLawParams" class and you need an interface to 
>> set them there.
>>> 
>>>                                    
>>> 2) About boundary conditions. 
>>> Where can I find all the BC that can I impose? Can I impose an injection 
>>> velocity and a constant saturation on the left and a constant pressure and 
>>> a zero saturation flux on the right? As well as normal velocity and zero 
>>> saturation flux up and down (of a 2d rectangle domain)?
>>> 
>> You can impose whatever boundary conditions you want to impose, given that 
>> they are valid for your type of problem. As boundary types Dumux differs 
>> between Dirichlet boundaries and Neumann boundaries. The Neumann boundary 
>> type includes Robin boundary conditions types (which are called solution 
>> dependent Neumann in the code sometimes). At the boundaries marked as 
>> Dirichlet boundary the "dirichlet"/"dirichletAtPos" function is called, on 
>> boundaries marked as Neumann, the "neumann"/"neumannAtPos" function is 
>> called. You can specify where to use which type of boundary condition using 
>> the global position argument.
>> 
>> How you impose boundary conditions also depends on the discretization scheme 
>> you are using. Are you using the Box method or the cell-centered TPFA 
>> method? You cannot impose velocities directly as velocity is not a unknown 
>> in your equations (for the discretization schemes available in Dumux), you 
>> can however impose fluxes on Neumann boundaries, and compute the flux with 
>> your given velocity. You can enforce the pressure and saturation as 
>> Dirichlet boundary conditions.
>> 
>> Also note that Dumux is short before a major version update (from 2.12 to 
>> 3.0) with a lot of new features / changes. There will be continued bugfix 
>> support for 2.12, as far as we can handle it. But you might want to have a 
>> look at the new version (master branch). The simulation steps are easier to 
>> understand in the new version. Everything I explained above also applies for 
>> the new version.
>> There are exercises in the dumux-course module I told you about in my last 
>> mail.
>> 
>> Best wishes
>> Timo
>>> 
>>> Thank you,
>>> 
>>> Lorenzo
>>> 
>>> 
>>> _______________________________________________
>>> Dumux mailing list
>>> Dumux@listserv.uni-stuttgart.de <mailto:Dumux@listserv.uni-stuttgart.de>
>>> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux 
>>> <https://listserv.uni-stuttgart.de/mailman/listinfo/dumux>
>> 
>> -- 
>> _______________________________________________________________
>> 
>> Timo Koch                              phone: +49 711 685 64676
>> IWS, Universität Stuttgart             fax:   +49 711 685 60430
>> Pfaffenwaldring 61        email: timo.k...@iws.uni-stuttgart.de 
>> <mailto:timo.k...@iws.uni-stuttgart.de>
>> D-70569 Stuttgart            url: www.hydrosys.uni-stuttgart.de 
>> <http://www.hydrosys.uni-stuttgart.de/>
>> _______________________________________________________________
> <tutorialspatialparams_implicit.hh><tutorialproblem_implicit.hh><tutorial_implicit.input><tutorial_implicit.cc><mod_brookscorey.hh><mod_brookscoreyparams.hh>_______________________________________________
> 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