Dear Felix,

I think you should either write
*Scalar  salinity_test= salinity();
*or
**Scalar  salinity_test= salinity_;

**Because salinity is the name of the function defined in the VolumeVariables you sent me.

I hope this helps. Best regards,
Martin

On 04/02/2019 05:26 PM, Felix Feldmann wrote:

Dear Martin,

Thank you very much for your answer.

Yes, I am using DuMux 2.12.

As you suggested, I wrote a new MaterialLaw which is a function of two parameters: Effective water saturation and salinity.

My problem is however caused by volumevariables file, in which the capillary pressure is invoked (2PMINC):

*static void completeFluidState(const PrimaryVariables& priVars,*

*const Problem& problem,*

*const Element& element,*

*const FVElementGeometry& fvGeometry,*

*                                 int scvIdx,*

*FluidState& fluidState,*

*bool isOldSol = false)*

   { ….

        // calculate capillary pressure

        const MaterialLawParams &materialParams = problem.spatialParams().materialLawParams(element, fvGeometry, scvIdx);

        Scalar pc = MaterialLaw::pc(materialParams, 1 - Sg, 1 ); // (material params, saturation, salinity)

….}

The MaterialLaw is working fine as long as I define a number for the salinity. The corresponding output file displays the expected (correct) capillary pressure values.

However, as I exchange the random number by salinity, I obtain the below listed error.

{….

        // calculate capillary pressure

        const MaterialLawParams &materialParams = problem.spatialParams().materialLawParams(element, fvGeometry, scvIdx);

        Scalar pc = MaterialLaw::pc(materialParams, 1 - Sg, salinity );

….}

error: cannot convert ‘Dumux::TwoPNCMinVolumeVariables<Dumux::Properties::TTag::CorefloodProblemCCProblemCMIN_In2b>::salinity’ from type ‘Dumux::TwoPNCMinVolumeVariables<Dumux::Properties::TTag::CorefloodProblemCCProblemCMIN_In2b>::Scalar (Dumux::TwoPNCMinVolumeVariables<Dumux::Properties::TTag::CorefloodProblemCCProblemCMIN_In2b>::)() const {aka double (Dumux::TwoPNCMinVolumeVariables<Dumux::Properties::TTag::CorefloodProblemCCProblemCMIN_In2b>::)() const}’ to type ‘Dumux::TwoPNCMinVolumeVariables<Dumux::Properties::TTag::CorefloodProblemCCProblemCMIN_In2b>::Scalar {aka double}’

         Scalar  salinity_test= salinity;

I attached my volumevariables file for an better understanding. Do you have any idea how to solve this problem?

Thank you and best regards,

Felix

*From:*Martin Schneider [mailto:[email protected]]
*Sent:* Thursday, March 28, 2019 2:20 PM
*To:* DuMuX User Forum <[email protected]>; Felix Feldmann <[email protected]> *Subject:* Re: [DuMuX] Invoke spatial depending parameter in fluidmatrixinteraction

Dear Felix,

you are using DuMuX 2.12, if I remember correctly. In DuMuX 2.12, you could overwrite the *preTimeStep()* method in your problem file, see for example *2p/implicit/lensproblem.hh.* In this method,  you could call some*updateLaws(args) *function from the spatialParams class. This function gets all arguments *args*, e.g. time, problem, etc., that are needed to calculate your parameters.

I hope this helps.

Best regards,
Martin




On 03/28/2019 07:50 AM, Felix Feldmann wrote:

    Dear DuMux community,

    Thank you very much again for helping me on my “GravityAtPosition”
    problem earlier this year. Unfortunately, I am facing a new problem.

    I am trying to invoke a value inside my
    fluidmatrixinteraction.file which is defined by my
    problemspatialparams.file

    *_Dumux provides several examples in which this is done for
    (constant) Scalar values. For example:_*

    const MaterialLawParams& materialLawParams(const Element &element,
    const FVElementGeometry &fvGeometry, const int scvIdx) const

        {   const GlobalPosition &globalPos =
    fvGeometry.subContVol[scvIdx].global;

                if (isOutletMaterial_(globalPos))

                 return outletMaterialParams_;

                else

               return coreMaterialParams_;   }

    *_Where the parameters can be defined as following_*

    CorefloodProblemSpatialParams(const GridView &gridView)

            : ParentType(gridView)

        {

    outletMaterialParams_.settest(1);

    coreMaterialParams_.settest(2);

        }

    This is quite clear to me - However, I am wondering if this also
    possible for properties which change in time and spatial
    orientation? In my very specific case, I would like to invoke a
    fluid component concentration inside my fluidmatrixinteraction.

    Do you have any suggestions?

    Thank you and best regards,

    Felix




    _______________________________________________

    Dumux mailing list

    [email protected]
    <mailto:[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] <mailto:[email protected]>


_______________________________________________
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