Dear Ali,

from what I see in your error message the compiler can not find the function "calculateFluxAcrossLayer" you call from your problem. The reason is: If you use the co2model the type of the primary variables vector is:
Dune::FieldVector<double, 2> as you have two primary variables.
If you use the co2nimodel it is Dune::FieldVector<double, 3> as you have an additional primary variable (temperature). You can fix the problem if you change type of the "flux" vector in you postTimeStep() function in your problem from
"Dune::FieldVector<Scalar, 2>" to "PrimaryVariables".
The type "PrimaryVariables" is already defined in line 135 of the attached eco2problem.hh.
In this way you will always use the right vector type.

By the way if you plan on updating to the latest dumux release 2.6, the co2nimodel has been removed and is replaced by a general non-isothermal model.

best regards
Alex




On 11/20/2014 09:02 PM, Ali Nowamooz wrote:

Dear DuMux,

I generally used CO2model for my simulations. Inside this model I added a function that calculates the advective flux across different layers Alexander sent me kindly this function (attached files) and it works perfectly when I use CO2model.

I recently tried to run the same simulations but using CO2ni model. When I compile my code I receive this error :

test_boxco2ni.cc:76:58: required from here

heterogeneousproblemni.hh:309:9: error: no matching function for call to ‘Dumux::CO2NIModel<Dumux::Properties::TTag::HeterogeneousNIBoxProblem>:: calculateFluxAcrossLayer (Dune::FieldVector<double, 2>&, int, double)’

this->model().calculateFluxAcrossLayer (fA, 2, 206.5);

         ^

heterogeneousproblemni.hh:309:9: note: candidate is:

In file included from ../../../dumux/implicit/co2ni/co2nimodel.hh:27:0,

                 from heterogeneousproblemni.hh:30,

                 from test_boxco2ni.cc:25:

../../../dumux/implicit/co2/co2model.hh:181:8: note: void Dumux::CO2Model<TypeTag>:: calculateFluxAcrossLayer (Dumux::CO2Model<TypeTag>::PrimaryVariables&, int, Dumux::CO2Model<TypeTag>::Scalar) [with TypeTag = Dumux::Properties::TTag::HeterogeneousNIBoxProblem; Dumux::CO2Model<TypeTag>::PrimaryVariables = Dune::FieldVector<double, 3>; Dumux::CO2Model<TypeTag>::Scalar = double]

   void calculateFluxAcrossLayer (PrimaryVariables &flux, int coord,

        ^

../../../dumux/implicit/co2/co2model.hh:181:8: note: no known conversion for argument 1 from ‘Dune::FieldVector<double, 2>’ to ‘Dumux::CO2Model<Dumux::Properties::TTag::HeterogeneousNIBoxProblem>::PrimaryVariables& {aka Dune::FieldVector<double, 3>&}’

I think CO2nimodel is derived from CO2model and therefore, we have access to all functions in this model. So I can call calculateFluxAcrossLayer in my code at the end of each timestep in the following manner:

void postTimeStep()

    {

    Dune::FieldVector<Scalar, 2> fA(0.0);

this->model().calculateFluxAcrossLayer (fA, 2, 206.5);

    }

Can you please help me with this problem?

Best regards

Ali Nowamooz



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


--
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