> On 26. Apr 2021, at 17:07, Dmitry Pavlov <[email protected]> wrote:
>
> Kilian,
>
> Thank you, I wiped out my GridVariables and GridVolumeVariables as you
> suggested.
>
> It turns out the problem was that I inherited TwoPNCVolumeVariables in
> MyVolumeVariables. Once I stopped doing that and just copy-pasted the entire
> implementation, everything has come to normal.
Hi Dmitry,
that’s slightly strange. Letting your VolumeVariables inherit from
TwoPNCVolumeVariables should be ok, too.
Best
Timo
>
> Best regards,
>
> Dmitry
>
>
> On 26.04.2021 09:45, Kilian Weishaupt wrote:
>> Hi Dmitry,
>>
>> setting the Property for your own VolumeVariables (as you did) should be
>> sufficient. I am just wondering at which point TwoPNCVolumeVariables is
>> still used. Have you searched in your code for them?
>> Are you by chance considering a non-isothermal system?
>>
>> Can you give more details on the first compiler error you get when only
>> setting the VolumeVariables Property (without your subsequent steps)?
>>
>> Best
>> Kilian
>>
>> On 25.04.21 20:41, Dmitry Pavlov wrote:
>>> Hello,
>>>
>>> I am using the 2pnc model for compositional gas+oil simulation and I think
>>> the way TwoPNCVolumeVariables::completeFluidState works now does not
>>> satisfy my needs. One thing is MiscibleMultiPhaseComposition being not
>>> designed for non-ideal mixtures, the other is ComputeFromReferencePhase
>>> machinery which I find puzzling, interfering and not related to the problem
>>> I am trying to solve.
>>>
>>> So I thought, DuMux is flexible and I should be able to set my own
>>> properties for my problem tag. I added the following into problem.hh
>>>
>>> template<class TypeTag>
>>> struct VolumeVariables<TypeTag, TTag::My>
>>> {
>>> private:
>>> using PV = GetPropType<TypeTag, Properties::PrimaryVariables>;
>>> using FSY = GetPropType<TypeTag, Properties::FluidSystem>;
>>> using FST = GetPropType<TypeTag, Properties::FluidState>;
>>> using SSY = GetPropType<TypeTag, Properties::SolidSystem>;
>>> using SST = GetPropType<TypeTag, Properties::SolidState>;
>>> using PT = typename GetPropType<TypeTag,
>>> Properties::SpatialParams>::PermeabilityType;
>>> using MT = GetPropType<TypeTag, Properties::ModelTraits>;
>>> static constexpr auto DM = GetPropType<TypeTag,
>>> Properties::GridGeometry>::discMethod;
>>> static constexpr bool enableIS = getPropValue<TypeTag,
>>> Properties::EnableBoxInterfaceSolver>();
>>> using SR = TwoPScvSaturationReconstruction<DM, enableIS>;
>>> using BaseTraits = TwoPVolumeVariablesTraits<PV, FSY, FST, SSY,
>>> SST, PT, MT, SR>;
>>>
>>> using DT = GetPropType<TypeTag,
>>> Properties::MolecularDiffusionType>;
>>> using EDM = GetPropType<TypeTag,
>>> Properties::EffectiveDiffusivityModel>;
>>> template<class BaseTraits, class DT, class EDM>
>>> struct NCTraits : public BaseTraits
>>> {
>>> using DiffusionType = DT;
>>> using EffectiveDiffusivityModel = EDM;
>>> };
>>>
>>> public:
>>> using type = MyVolumeVariables<NCTraits<BaseTraits, DT, EDM>>;
>>> };
>>>
>>> It partially works because I am
>>>
>>> using PrimaryVariableSwitch = MyPrimaryVariableSwitch;
>>>
>>> in MyVolumeVariables and it gets properly called.
>>>
>>>
>>> But the following line the VtkOutputModule
>>>
>>> auto elemVolVars =
>>> localView(gridVariables_.curGridVolVars());
>>>
>>> is template-instantiated with VolumeVariables = TwoPNCVolumeVariables, not
>>> MyVolumeVariables. I tried tracking down why, got lost in GridVariables and
>>> GridVolumeVariables, tried as the last resort adding the following in
>>> problem.hh
>>>
>>> //! The grid volume variables vector class
>>> template<class TypeTag>
>>> struct GridVolumeVariables<TypeTag, TTag::My>
>>> {
>>> private:
>>> static constexpr bool enableCache = getPropValue<TypeTag,
>>> Properties::EnableGridVolumeVariablesCache>();
>>> using Problem = GetPropType<TypeTag, Properties::Problem>;
>>>
>>> using PV = GetPropType<TypeTag, Properties::PrimaryVariables>;
>>> [...]
>>>
>>> using VolumeVariables = MyVolumeVariables<NCTraits<BaseTraits,
>>> DT, EDM>>;
>>> public:
>>> using type = BoxGridVolumeVariables<Problem, VolumeVariables,
>>> enableCache>;
>>> };
>>>
>>> template<class TypeTag>
>>> struct GridVariables<TypeTag, TTag::My>
>>> {
>>> private:
>>> using GG = GetPropType<TypeTag, Properties::GridGeometry>;
>>> using GVV = GetPropType<TypeTag,
>>> Properties::GridVolumeVariables>;
>>> using GFVC = GetPropType<TypeTag,
>>> Properties::GridFluxVariablesCache>;
>>> public:
>>> using type = FVGridVariables<GG, GVV, GFVC>;
>>> };
>>>
>>> And got the following error from
>>> dumux/dumux/assembly/fvlocalassemblerbase.hh:315:29: error: invalid
>>> initialization of reference of type ...
>>>
>>> The problematic line is
>>>
>>> { return elemVolVars[scv]; }
>>>
>>> At this point I am not sure I am on the right path. Any help will be much
>>> appreciated.
>>>
>>>
>>> Best regards,
>>>
>>> Dmitry
>>>
>>>
>>>
>>> _______________________________________________
>>> DuMux mailing list
>>> [email protected]
>>> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
>>
> _______________________________________________
> DuMux mailing list
> [email protected]
> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
_______________________________________________
DuMux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux