Hi Helena,

you saw correctly that this is not implemented so far.

However, this is a relatively straight-forward modification of the 
EnergyVolumeVariables 
(https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/porousmediumflow/nonisothermal/volumevariables.hh)
since AFAIK, the flux implementation (Fourier’s law) already supports tensorial 
conductivities.

Steps:
(1) You would have to implement a custom VolumeVariables class, .e.g. 
MyOnePVolumeVariables,
which is essentially a copy OnePVolumeVariables only that inherits from a 
custom EnergyVolumeVariables class, e.g. MyEnergyVolumeVariables.
(2) You can then modify MyEnergyVolumeVariables (a copy EnergyVolumeVariables) 
such that it stores a conductivity Tensor instead of a Scalar and obtains the 
tensor values from the SpatialParams (where you implement a corresponding 
interface returning the tensor).
(3) You can then make Dumux use your custom class MyOnePVolumeVariables by 
setting it via the property system (specialise Property::VolumeVariables for 
your problem’s TypeTag).

Best wishes
Timo

On 12 Sep 2022, at 18:40, Helena Kschidock 
<[email protected]<mailto:[email protected]>> wrote:

Hi Bernd,

thanks a lot for your help, I am now able to set the conductivity locally this 
way.

I am still wondering if it is possible to set the 2x2 conductivity tensor 
somehow (also locally), to enable anisotropic upscaled conductivities? 
Something similar seems to exist for the permeability tensor, but looking at 
the handbook, I am getting the impression that this would require deeper 
modifications of the model used by DuMuX. If this is the case  then I might 
simply modify my selected example problem a bit. Or is it easily possible, 
could I e.g. overload the suggested `solidThermalConductivity` function with an 
non-Scalar (e.g. auto) type function instead?

Best regards,
Helena

On Wed, 7 Sept 2022 at 15:48, 
<[email protected]<mailto:[email protected]>>
 wrote:
Send DuMux mailing list submissions to
        [email protected]<mailto:[email protected]>

To subscribe or unsubscribe via the World Wide Web, visit
        https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
or, via email, send a message with subject or body 'help' to
        
[email protected]<mailto:[email protected]>

You can reach the person managing the list at
        
[email protected]<mailto:[email protected]>

When replying, please edit your Subject line so it is more specific
than "Re: Contents of DuMux digest..."


Today's Topics:

   1. Anisotropic heat conductivity tensor in heat conduction
      simulation (Helena Kschidock)
   2. Re: Anisotropic heat conductivity tensor in heat conduction
      simulation (Flemisch, Bernd)
   3. Re: Anisotropic heat conductivity tensor in heat conduction
      simulation (Flemisch, Bernd)


----------------------------------------------------------------------

Message: 1
Date: Wed, 7 Sep 2022 14:51:08 +0200
From: Helena Kschidock <[email protected]<mailto:[email protected]>>
To: [email protected]<mailto:[email protected]>
Subject: [DuMux] Anisotropic heat conductivity tensor in heat
        conduction simulation
Message-ID:
        
<CABGjjsYFHmd9GoZukbiCJjOGuN3GRMV_zm2XHVQU=eeojh6...@mail.gmail.com<mailto:[email protected]>>
Content-Type: text/plain; charset="utf-8"

Hi all,

I am attempting to simulate a heat conduction problem in a simple porous
medium using macro-micro coupling via preCICE. Currently, I am implementing
the macro problem to be coupled with an existing micro problem, basing my
code on the existing implementation in dumux-heat (which solves a simple
heat conduction problem as a OnePNI problem with boundary and initial
conditions set in such a way that there is no flow, leaving only the heat
problem).

The micro problem communicates the porosity and a potentially anisotropic
thermal conductivity tensor as inputs to the macro problem. I now need to
incorporate these into my DuMuX macro simulation, and set them locally for
each subcontrolvolume.

>From what I have understood (and please correct me), this is pretty
straightforward for the porosity, and can be done by overloading
`template<class ElementSolution>
Scalar porosity (const Element& element, const SubControlVolume& scv, const
ElementSolution& elemSol) const{}`
in spatialparams.hh.

However, I have not yet found any way to incorporate a local, scv-specific
conductivity, much less a local conductivity tensor in DuMux. The only
thing coming up seem to be the two parameters SolidThermalConductivity and
LiquidThermalConductivity, but these are static, even in my case. Any
suggestions on how to achieve this with DuMuX?

I'd be thankful for any and all ideas,
Best regards,
Helena Kschidock
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.uni-stuttgart.de/pipermail/dumux/attachments/20220907/e844a949/attachment-0001.htm>

------------------------------

Message: 2
Date: Wed, 7 Sep 2022 13:33:59 +0000
From: "Flemisch, Bernd" 
<[email protected]<mailto:[email protected]>>
To: "[email protected]<mailto:[email protected]>"
        
<[email protected]<mailto:[email protected]>>
Subject: Re: [DuMux] Anisotropic heat conductivity tensor in heat
        conduction simulation
Message-ID: 
<[email protected]<mailto:[email protected]>>
Content-Type: text/plain; charset="iso-8859-1"

Hi Helena,


it should be possible to add a function

solidThermalConductivity
to your spatial params taking
(element, scv, elemSol, solidState)
as parameters. There is an example in the dumux-lecture module, have a look at
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-lecture/-/blob/master/lecture/mm/fuelcell/fuelcellspatialparams.hh.
Return your upscaled conductivity there, ignoring the "solid" misnomer.

Copy
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/material/fluidmatrixinteractions/1p/thermalconductivityaverage.hh

to a new file upscaledconductivity.hh in dumux-heat.


Rename the class ThermalConductivityAverage to UpscaledConductivity and adapt 
the function effectiveThermalConductivity to just return

volVars.solidThermalConductivity()


Include the header upscaledconductivity.hh in your properties.hh and set the 
property by

struct ThermalConductivityModel<TypeTag, TTag::MyTypeTag> { using type = 
UpscaledConductivity<GetPropType<TypeTag, Properties::Scalar>>; }
where MyTypeTag is the type tag of your problem.

Let me know if this helps.

Kind regards
Bernd



--
_________________________________________________________________

Bernd Flemisch
IWS, Universit?t Stuttgart               phone: +49 711 685 69162
Pfaffenwaldring 61              email: 
[email protected]<mailto:[email protected]>
D-70569 Stuttgart           url: 
www.iws.uni-stuttgart.de/en/lh2/<http://www.iws.uni-stuttgart.de/en/lh2/><http://www.iws.uni-stuttgart.de/en/lh2/>
_________________________________________________________________
________________________________
Von: DuMux 
<[email protected]<mailto:[email protected]>>
 im Auftrag von Helena Kschidock 
<[email protected]<mailto:[email protected]>>
Gesendet: Mittwoch, 7. September 2022 14:51:08
An: [email protected]<mailto:[email protected]>
Betreff: [DuMux] Anisotropic heat conductivity tensor in heat conduction 
simulation

Hi all,

I am attempting to simulate a heat conduction problem in a simple porous medium 
using macro-micro coupling via preCICE. Currently, I am implementing the macro 
problem to be coupled with an existing micro problem, basing my code on the 
existing implementation in dumux-heat (which solves a simple heat conduction 
problem as a OnePNI problem with boundary and initial conditions set in such a 
way that there is no flow, leaving only the heat problem).

The micro problem communicates the porosity and a potentially anisotropic 
thermal conductivity tensor as inputs to the macro problem. I now need to 
incorporate these into my DuMuX macro simulation, and set them locally for each 
subcontrolvolume.

>From what I have understood (and please correct me), this is pretty 
>straightforward for the porosity, and can be done by overloading
`template<class ElementSolution>
Scalar porosity (const Element& element, const SubControlVolume& scv, const 
ElementSolution& elemSol) const{}`
in spatialparams.hh.

However, I have not yet found any way to incorporate a local, scv-specific 
conductivity, much less a local conductivity tensor in DuMux. The only thing 
coming up seem to be the two parameters SolidThermalConductivity and 
LiquidThermalConductivity, but these are static, even in my case. Any 
suggestions on how to achieve this with DuMuX?

I'd be thankful for any and all ideas,
Best regards,
Helena Kschidock

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.uni-stuttgart.de/pipermail/dumux/attachments/20220907/f629efa7/attachment-0001.htm>

------------------------------

Message: 3
Date: Wed, 7 Sep 2022 13:48:22 +0000
From: "Flemisch, Bernd" 
<[email protected]<mailto:[email protected]>>
To: DuMux User Mailing List 
<[email protected]<mailto:[email protected]>>
Subject: Re: [DuMux] Anisotropic heat conductivity tensor in heat
        conduction simulation
Message-ID: 
<[email protected]<mailto:[email protected]>>
Content-Type: text/plain; charset="iso-8859-1"

Instead of what I said between "Copy" and "solidThermalConductivity()", you can 
simply copy

https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-lecture/-/blob/master/lecture/mm/fuelcell/material/thermalconductivityconstant.hh

to dumux-heat and use that in your properties.hh.


Kind regards

Bernd


--
_________________________________________________________________

Bernd Flemisch
IWS, Universit?t Stuttgart               phone: +49 711 685 69162
Pfaffenwaldring 61              email: 
[email protected]<mailto:[email protected]>
D-70569 Stuttgart           url: 
www.iws.uni-stuttgart.de/en/lh2/<http://www.iws.uni-stuttgart.de/en/lh2/><http://www.iws.uni-stuttgart.de/en/lh2/>
_________________________________________________________________
________________________________
Von: DuMux 
<[email protected]<mailto:[email protected]>>
 im Auftrag von Flemisch, Bernd 
<[email protected]<mailto:[email protected]>>
Gesendet: Mittwoch, 7. September 2022 15:33:59
An: [email protected]<mailto:[email protected]>
Betreff: Re: [DuMux] Anisotropic heat conductivity tensor in heat conduction 
simulation


Hi Helena,


it should be possible to add a function

solidThermalConductivity
to your spatial params taking
(element, scv, elemSol, solidState)
as parameters. There is an example in the dumux-lecture module, have a look at
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux-lecture/-/blob/master/lecture/mm/fuelcell/fuelcellspatialparams.hh.
Return your upscaled conductivity there, ignoring the "solid" misnomer.

Copy
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/-/blob/master/dumux/material/fluidmatrixinteractions/1p/thermalconductivityaverage.hh

to a new file upscaledconductivity.hh in dumux-heat.


Rename the class ThermalConductivityAverage to UpscaledConductivity and adapt 
the function effectiveThermalConductivity to just return

volVars.solidThermalConductivity()


Include the header upscaledconductivity.hh in your properties.hh and set the 
property by

struct ThermalConductivityModel<TypeTag, TTag::MyTypeTag> { using type = 
UpscaledConductivity<GetPropType<TypeTag, Properties::Scalar>>; }
where MyTypeTag is the type tag of your problem.

Let me know if this helps.

Kind regards
Bernd



--
_________________________________________________________________

Bernd Flemisch
IWS, Universit?t Stuttgart               phone: +49 711 685 69162
Pfaffenwaldring 61              email: 
[email protected]<mailto:[email protected]>
D-70569 Stuttgart           url: 
www.iws.uni-stuttgart.de/en/lh2/<http://www.iws.uni-stuttgart.de/en/lh2/><http://www.iws.uni-stuttgart.de/en/lh2/>
_________________________________________________________________
________________________________
Von: DuMux 
<[email protected]<mailto:[email protected]>>
 im Auftrag von Helena Kschidock 
<[email protected]<mailto:[email protected]>>
Gesendet: Mittwoch, 7. September 2022 14:51:08
An: [email protected]<mailto:[email protected]>
Betreff: [DuMux] Anisotropic heat conductivity tensor in heat conduction 
simulation

Hi all,

I am attempting to simulate a heat conduction problem in a simple porous medium 
using macro-micro coupling via preCICE. Currently, I am implementing the macro 
problem to be coupled with an existing micro problem, basing my code on the 
existing implementation in dumux-heat (which solves a simple heat conduction 
problem as a OnePNI problem with boundary and initial conditions set in such a 
way that there is no flow, leaving only the heat problem).

The micro problem communicates the porosity and a potentially anisotropic 
thermal conductivity tensor as inputs to the macro problem. I now need to 
incorporate these into my DuMuX macro simulation, and set them locally for each 
subcontrolvolume.

>From what I have understood (and please correct me), this is pretty 
>straightforward for the porosity, and can be done by overloading
`template<class ElementSolution>
Scalar porosity (const Element& element, const SubControlVolume& scv, const 
ElementSolution& elemSol) const{}`
in spatialparams.hh.

However, I have not yet found any way to incorporate a local, scv-specific 
conductivity, much less a local conductivity tensor in DuMux. The only thing 
coming up seem to be the two parameters SolidThermalConductivity and 
LiquidThermalConductivity, but these are static, even in my case. Any 
suggestions on how to achieve this with DuMuX?

I'd be thankful for any and all ideas,
Best regards,
Helena Kschidock

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://listserv.uni-stuttgart.de/pipermail/dumux/attachments/20220907/2b0bec48/attachment.htm>

------------------------------

Subject: Digest Footer

_______________________________________________
DuMux mailing list
[email protected]<mailto:[email protected]>
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


------------------------------

End of DuMux Digest, Vol 138, Issue 4
*************************************
_______________________________________________
DuMux mailing list
[email protected]<mailto:[email protected]>
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

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

Reply via email to