Re: [DuMuX] Accessing phase velocities in source method

2019-05-13 Thread Birger Hagemann
Dear Johannes,


thanks a lot for your help. I adapted the following from your suggestion:


 auto elemSol = elementSolution(element, elemVolVars, fvGeometry);

 const auto gradients = evalGradients(element,
 element.geometry(),
 this->fvGridGeometry(),
 elemSol,
 scv.center());

 auto velocityW = this->gravity();
 velocityW *= -volVars.density(liquidPhaseIdx);
 velocityW += gradients[pressureIdx];
 velocityW *= 
-volVars.permeability()*volVars.mobility(liquidPhaseIdx);
 Scalar velocityWMag = velocityW.two_norm();


It seems to work fine.


Regards Birger


Von: Dumux  im Auftrag von Johannes 
Hommel 
Gesendet: Donnerstag, 9. Mai 2019 18:13:27
An: dumux@listserv.uni-stuttgart.de
Betreff: Re: [DuMuX] Accessing phase velocities in source method


Dear Birger,

sorry for the late reply, but I was quite busy this week.

I am not sure about the velocities, but you can at least get the gradient quite 
easily with the box discretization using:

auto elemSol = elementSolution(element, elemVolVars, fvGeometry);
const auto gradP = evalGradients(element,
element.geometry(),
this->fvGridGeometry(),
elemSol,
scv.center())[pressureIdx];


With the gradient, you should be able to recalculate your velocity (magnitude).

I hope that helps, best regards
Johannes

Am 03.05.2019 um 18:25 schrieb Birger Hagemann:
Dear all,

is there any quick solution to access the phase (Darcy) velocities within the 
source method of the problem class?
I only need the magnitude (not the direction) to calculate bacteria 
attachment/detachment terms. I am using an extended 2pnc model and the box 
discretization.

Thank you in advance.

Regards Birger



___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de<mailto:Dumux@listserv.uni-stuttgart.de>
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux



***

Johannes Hommel

Lehrstuhl für Hydromechanik und Hydrosystemmodellierung (LH2)
Institut für Wasser- und Umweltsystemmodellierung (IWS), Universität Stuttgart
https://www.iws.uni-stuttgart.de/lh2/
email: 
johannes.hom...@iws.uni-stuttgart.de<mailto:johannes.hom...@iws.uni-stuttgart.de>
Pfaffenwaldring 61
70569 Stuttgart
Tel.: ++49  711 / 685-64600

Department of Hydromechanics and Modelling of Hydrosystems (LH2)
Institute for Modelling Hydraulic and Environmental Systems (IWS), University 
of Stuttgart
https://www.iws.uni-stuttgart.de/en/lh2/
email: 
johannes.hom...@iws.uni-stuttgart.de<mailto:johannes.hom...@iws.uni-stuttgart.de>
Pfaffenwaldring 61
70569 Stuttgart
Tel.: ++49  711 / 685-64600

--
***

Johannes Hommel

Lehrstuhl für Hydromechanik und Hydrosystemmodellierung (LH2)
Institut für Wasser- und Umweltsystemmodellierung (IWS), Universität Stuttgart
https://www.iws.uni-stuttgart.de/lh2/
email: 
johannes.hom...@iws.uni-stuttgart.de<mailto:johannes.hom...@iws.uni-stuttgart.de>
Pfaffenwaldring 61
70569 Stuttgart
Tel.: ++49  711 / 685-64600

Department of Hydromechanics and Modelling of Hydrosystems (LH2)
Institute for Modelling Hydraulic and Environmental Systems (IWS), University 
of Stuttgart
https://www.iws.uni-stuttgart.de/en/lh2/
email: 
johannes.hom...@iws.uni-stuttgart.de<mailto:johannes.hom...@iws.uni-stuttgart.de>
Pfaffenwaldring 61
70569 Stuttgart
Tel.: ++49  711 / 685-64600
___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


[DuMuX] Accessing phase velocities in source method

2019-05-03 Thread Birger Hagemann
Dear all,

is there any quick solution to access the phase (Darcy) velocities within the 
source method of the problem class?
I only need the magnitude (not the direction) to calculate bacteria 
attachment/detachment terms. I am using an extended 2pnc model and the box 
discretization.

Thank you in advance.

Regards Birger
___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMuX] Dumux 2.12.0, dune 2.6.0 and opm 2017.10 compatibility

2018-10-23 Thread Birger Hagemann
Dear Felix,


I never tried to combine Dumux version 2.12 with cornerpoint grids. However, 
for previous versions of Dumux I had similar problems. I always solved the 
problem by trying other versions of DUNE and/or OPM. Also the version of cmake 
and the C++ compiler seems to be important. Newer versions resulted sometimes 
in compiling errors.


Regards Birger


Von: Dumux  im Auftrag von Martin 
Schneider 
Gesendet: Dienstag, 23. Oktober 2018 16:51:51
An: DuMuX User Forum; Felix Feldmann
Betreff: Re: [DuMuX] Dumux 2.12.0, dune 2.6.0 and opm 2017.10 compatibility

Dear Felix,

probably the array should be replaced by std::array.
However, I would recommend you to use the opm release 2017.04 and ert by 
installing it using the
installexternal.sh script from the dumux 2.12 release:
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/blob/releases/2.12/bin/installexternal.sh

You should also think about using the Dumux master branch (which will be 
released soon)
which works with the opm 2018.04 release.

I hope this helps. Best regards,
Martin

On 10/23/2018 12:53 PM, Felix Feldmann wrote:
Dear All,

I am currently running some 2D simulations using Dumux 2.12.0 and Dune 2.6.0. 
However, I would like to additionally compute cornerpoint (“petrel grids”) 
problems.
According to 
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/blob/master/CHANGELOG.md,
 this should be possible by combining Dumux 2.12.0, Dune 2.6.0 as well as OPM 
2017.10.
Dumux 2.12.0 and Dune 2.6.0 are running fine, while the OPM installation is 
causing problems: Considering the OPM hierarchy, I am able to successfully 
install the first three OPM modules:

1)  Libecl

2)  Opm-common

3)  Opm-material


However, as I try to add opm-grid, I do receive an error message (the shortened 
message is listed below). Do you think, that Dumux 2.12.0, Dune 2.6.0 and Opm 
2017.10 are compatible? Did you experience similar problems during the 
installation of Dumux, Dune and Opm-grid (former cornerpoint)?

Best regards,
Felix
Felix Feldmann
Research Assistant
[cid:image001.png@01D3DFD3.27E5A010]
SAN Campus
P O Box 2533, Petroleum Institute
Abu Dhabi, UAE
M +971 565624402
felix.feldm...@ku.ac.ae

--
/home/felix/workspace/dune/opm-grid-release-2017.10/dune/grid/cpgrid/CpGridData.hpp:347:29:
 error: template argument 1 is invalid
 std::vector< array >   cell_to_point_;
 ^
/home/felix/workspace/dune/opm-grid-release-2017.10/dune/grid/cpgrid/CpGridData.hpp:347:29:
 error: template argument 2 is invalid
/home/felix/workspace/dune/opm-grid-release-2017.10/dune/grid/cpgrid/CpGridData.hpp:347:31:
 error: expected unqualified-id before ‘>’ token
 std::vector< array >   cell_to_point_;




___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
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: 
martin.schnei...@iws.uni-stuttgart.de
___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMuX] How to implement Peaceman well model in DuMuX?

2018-08-22 Thread Birger Hagemann
Dear Martin,

The unit for the well index is m³. Consequently the unit for your expression 
for values[contiWEEqIdx] is kg/s. However, the source term has the unit 
kg/m³/s. I think you have to divide by the cell volume:
values[contiWEqIdx] = densityW/viscosityW * WI *(pbh - 
pw)/fvGeometry.subContVol[scvIdx].volume;

Am I wrong?

Regards Birger

Von: Dumux [mailto:dumux-boun...@listserv.uni-stuttgart.de] Im Auftrag von 
Martin Schneider
Gesendet: Mittwoch, 22. August 2018 10:03
An: DuMuX User Forum ; Ranjeet Singh 

Betreff: Re: [DuMuX] How to implement Peaceman well model in DuMuX?

Dear Ranjeet,

you can implement the Peaceman well model as a solution-dependent source,
using the following function in your problem file

NumEqVector source(const Element ,
   const FVElementGeometry& fvGeometry,
   const ElementVolumeVariables& 
elemVolVars,
   const SubControlVolume ) const

(see for example porousmediumflow/2pnc/implicit/fuelcellproblem.hh)

With the elemVolVars you have access to the pressure, density, etc.:
const auto& volVars = elemVolVars[scv];
Scalar pw = volVars.pressure(wPhaseIdx);
Scalar densityW = volVars.density(wPhaseIdx);
Scalar viscosityW = volVars.viscosity(wPhaseIdx);

Such that the source term looks as follows (if you inject water and neglect 
gravity)
NumEqVector values(0.0);
values[contiWEqIdx] = densityW/viscosityW * WI *(pbh - pw);

where WI is the well index (see the Peaceman well model); pbh the bottom hole 
pressure, etc.
If gravity is included you have to use the phase potentials.

Kind regards,
Martin


On 08/09/2018 04:03 AM, Ranjeet Singh wrote:
Hi,
  I want use Peaceman well model in DuMuX?.  Could you please some information 
(or any example if already implemented) so that I can implement the well model?


Thank you!


Regards,
Ranjeet






___

Dumux mailing list

Dumux@listserv.uni-stuttgart.de

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: 
martin.schnei...@iws.uni-stuttgart.de
___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMuX] curves of oil production

2016-09-14 Thread Birger Hagemann
Hi Bernd,

thanks, it works fine by using the mentioned sum() function.

Regards Birger

-Ursprüngliche Nachricht-
Von: Dumux [mailto:dumux-boun...@listserv.uni-stuttgart.de] Im Auftrag von 
Bernd Flemisch
Gesendet: Mittwoch, 14. September 2016 15:07
An: DuMuX User Forum
Betreff: Re: [DuMuX] curves of oil production

Hi Birger,

you have to sum on each process by iterating over the elements and then to sum 
over the processes. A GridView offers a Communicator comm() which offers a 
sum() function, see line 373 in 
https://git.iws.uni-stuttgart.de/dumux-repositories/dumux/blob/master/dumux/nonlinear/newtoncontroller.hh

Kind regards
Bernd

On 09/14/2016 02:55 PM, Birger Hagemann wrote:
> Hi Christoph,
>
> thanks for the hints. You are right, it is easy to check for the 
> partitionType() of an element. In my case I have to exclude an element when 
> it is of type OverlapEntity. This means that the problem of double processed 
> elements is solved. However, the iterations are still done separately on each 
> process and I cannot sum up the rate for a well which is perforated in cells 
> which are handled on different processes. Do you have an idea how to do this?
>
> Regards Birger
>
> -Ursprüngliche Nachricht-
> Von: Dumux [mailto:dumux-boun...@listserv.uni-stuttgart.de] Im Auftrag 
> von Christoph Grüninger
> Gesendet: Dienstag, 13. September 2016 16:45
> An: DuMuX User Forum; Birger Hagemann
> Betreff: Re: [DuMuX] curves of oil production
>
> Hi Birger,
> great news!
>
>> Is it possible to use an iterator which runs over all elements only 
>> once also in parallel?
> Yes, that's definitely possible. You have to check for every element whether 
> is of ghost type.
> With the new free functions, you can use the PartitionSet elements and 
> substract the ghosts from it, see
> https://www.dune-project.org/doxygen/master/group__GIIteration.html#ga
> 163b69ed0f5787171662b67ee84af991
> and
> https://www.dune-project.org/doxygen/master/namespaceDune_1_1Partition
> s.html#abd215a904d448bcc2525f579c2d445b8
>
> By the way, this is more related to Dune than to DuMuX.
> Asking at their mailing list might lead to better answers.
>
> Bye
> Christoph
>
> --
> On the one hand [computer "science"] has components of the purest of 
> mathematics and on the other hand of the dirtiest of engineering. -- 
> A. Oettinger 1967 ___
> 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


--
___

Bernd Flemisch phone: +49 711 685 69162
IWS, Universität Stuttgart fax:   +49 711 685 60430
Pfaffenwaldring 61email: be...@iws.uni-stuttgart.de
D-70569 Stuttgarturl: www.hydrosys.uni-stuttgart.de
___

___
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


Re: [DuMuX] Convergence problem for 3D simulations (2p cell-centered model, ALUGrid)

2015-11-26 Thread Birger Hagemann
Hi Tri Dat,



I had recently the same problem with parallel computation on a realistic 
reservoir grid where also the horizontal dimensions are much larger than the 
vertical. The error message was the same. Bernd gave me the hint to install 
SuperLU. However, after installing SuperLU the error was only changed to:

“Newton: Caught exception: "NumericalProblem

>>[newtonSolveLinear:…/dumux/dumux/nonlinear/newtoncontroller.hh:380]:

>>Linear solver did not converge"



Maybe installing SuperLU will solve your problem. My problem is also still 
unsolved, thus, any hints are welcome. I am also using a fully implicit 
cell-centered model. The same simulation is working when started on only one 
processor and the same model is working in parallel on more simple grids.



Kind regards

Birger





Von: Dumux [mailto:dumux-boun...@listserv.uni-stuttgart.de] Im Auftrag von Tri 
Dat NGO
Gesendet: Dienstag, 24. November 2015 20:07
An: DuMuX User Forum
Betreff: Re: [DuMuX] Convergence problem for 3D simulations (2p cell-centered 
model, ALUGrid)



Sorry, I forgot to add my files.

Kind regards,
Tri Dat



2015-11-24 20:03 GMT+01:00 Tri Dat NGO :

Hi Dumuxers,

I would like to run parallel simulations of CO2 injection into a 3D reservoir 
of which the horizontal extents are much higher than the vertical one: Lx/Lz = 
Ly/Lz >> 1 (e.g. a reservoir of 1000m x 1000m x 50 m). A 2p cell-centered model 
is used.

The domain is described on a cartesian grid of 100x100x100 (1E+6) cells. The 
CO2 is injected into the domain at X=500m  and Y = 500m by using the Peaceman's 
well model (bhp). The pressure at the boundaries perpendicular to the Y-axis is 
set to the initial hydrostatic pressure. All others boundaries are no-flux 
Neumann boundaries. At the first step, we consider, for simplicity, an 
homogeneous reservoir. You can find in attachment the *.hh files of my test.

The simulation converges only if the reservoir is anisotropic (Kxx/Kzz = 
Kyy/Kzz >>1), meaning that the medium is lowly permeable in Z-direction. 
Nevertheless, when the domain is isotropic (Kxx = Kzz), a problem occurs: 
Newton solver did not converge. The error message is "MathError 
[mgc:/home/share/soft/dumux-2.6/include/dune/istl/paamg/amg.hh:825]: Coarse 
solver did not converge".


Moreover, the same test works correctly on isotropic but thicker domains (e.g. 
1000m x 1000m x 250 m, the grid is always of 100x100x100).

I don't understand why a same test works on a grid but not on another grid. Is 
this related to the numerical scheme (fully-implicit, cell-centered)?


Any help will be greatly appreciated!



Kind regards,

Tri Dat





___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


Re: [DuMuX] Constant pressure for some given cells in 2p (or 2p2c) implicit CC model

2015-10-31 Thread Birger Hagemann

Hi Beatrix,

yes, the amount of a produced fluid phase depends on its mobility within 
the cell where you have your well. Thus, the amount of a produced 
component is the sum over all (produced) phases multiplied by the 
concentration. For a two phase model it looks like this:


for each component in your model:

values[conti0EqIdx+compIdx]=(fs.moleFraction(nPhaseIdx,compIdx)*mobilityGas_*WellIndex_*(productionPressure_-fs.pressure(nPhaseIdx)) 
+ 
fs.moleFraction(wPhaseIdx,compIdx)*mobilityWater_*WellIndex_*(productionPressure_-fs.pressure(wPhaseIdx)))*(1/fvGeometry.subContVol[scvIdx].volume); 



Regards Birger


Am 30.10.2015 um 21:10 schrieb Beatrix:

Hi Birger,

out of curiosity and because I might need it in the future too, what 
changes if you want to produce? I guess you need to take the presence 
of another phase into account somehow because it might get produced as 
well.


Cheers
Beatrix

On 30.10.2015 12:50, Birger Hagemann wrote:

Hi Tri Dat,

exactly like this we have implemented a well model (Peaceman) in 
solDependentSource. Here you finde the code for an H2 injection well:


Scalar 
mobilityGas_=elemVolVars[scvIdx].relativePermeability(nPhaseIdx)/fs.viscosity(nPhaseIdx)*fs.molarDensity(nPhaseIdx);
Scalar 
WellIndex_=((2*M_PI*elemVolVars[scvIdx].permX()*cellHeight_)/(log(effectiveWellRadius_/(WellDiameter;
values[contiH2EqIdx]=mobilityGas_*WellIndex_*(InjectionPressure_-fs.pressure(nPhaseIdx))*(1/fvGeometry.subContVol[scvIdx].volume); 



Or do you want to produce?

Regards Birger


On Fri, 30 Oct 2015 16:54:47 +0100
 Kilian Weishaupt <kilian.weisha...@iws.uni-stuttgart.de> wrote:

Hello Tri Dat,

I think you can try the solDependentSource for this purpose. If you 
specify an injection rate like q= factor*(p - p_well), where p is 
your actual pressure of your control volume and p_well is the 
desired pressure, your pressure should go towards your desired 
value. The factor might be a constant but it can also depend on 
things like saturation, ect.


Best regards
Kilian

On 10/30/2015 04:33 PM, Tri Dat NGO wrote:


Hello Dumuxers,


I want to implement a simplified well model in which a constant 
pressure is set for some given cells within a 3D domain (not at 
boundaries). So I would like to know if it is possible to do this 
in 2p (or 2p2c)implicit CC model.


I really appreciate any help you can provide.

Kind regards,

Tri Dat



___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


--

Kilian Weishaupt M.Sc.
Institut für Wasser- und Umweltsystemmodellierung (IWS)
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung
Universität Stuttgart, Pfaffenwaldring 61, 70569 Stuttgart
Email: kilian.weisha...@iws.uni-stuttgart.de
Telefon: 0049 711 685-60461 ** fax: 0049-711-685-60430
http://www.hydrosys.uni-stuttgart.de




___
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



___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux