Hi Bernd, hi Timo! First I want to thank you for your very fast and helpful replies on my question, I was really surprised by that! 😊
I think it could be helpful, if I would share some more details about the topic I am working on: The project I am working on deals with fuel cell simulation and the reason why I am working on "old" Dumux 2.7 is, that I want to use an existing simulation model, which exhibits some compatibility problems under newer Dumux versions. Regarding multiphase flow and material laws I am actually not expecting the model to have more than two phases at some operation point, I was just interested in implementing the capillary pressure handling for multiple phases in general. Even for the material law I was not only focusing on Brooks-Corey itself, I just wanted to use it was a starting point for the process of understanding. Nonetheless was the information you gave me on BC, Timo, valuable anyway! I followed the implementation of the capillary pressure inside of mpncvariables.hh several times and understood it just as you pointed out below, but thanks for the detailed explanation, this ensured me in my understanding! Starting from this fact, I am aware that the code works as intended, but what I still do not understand, is, why is the capillary pressure inside the 2padapter.hh calculated as a negative value and saved for the index of the wetting phase? It could also be saved as a positive value for the non-wetting phase. There must be an explanation for this, has it to do with some numerical background? Does this somehow relate to the definition of primary variabels? Since there wont be more than two phases in my system, I decided to implement the capillary pressure calculation for only those two phases, so the actual aforementioned "problems" are not really "affecting" me anymore. Nevertheless, I am still interested in these open, generall questions as I think they could help me in my general understanding/ future difficulties (and might also help others while reading)! Thanks again, Bernd & Timo! Best regards Patrick -----Ursprüngliche Nachricht----- Von: Dumux <[email protected]> Im Auftrag von [email protected] Gesendet: Dienstag, 24. April 2018 12:00 An: [email protected] Betreff: Dumux Digest, Vol 86, Issue 12 Send Dumux mailing list submissions to [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] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of Dumux digest..." Today's Topics: 1. Re: Treatment of capillary pressure for multiphase simulations (Bernd Flemisch) ---------------------------------------------------------------------- Message: 1 Date: Mon, 23 Apr 2018 15:46:20 +0200 From: Bernd Flemisch <[email protected]> To: DuMuX User Forum <[email protected]> Subject: Re: [DuMuX] Treatment of capillary pressure for multiphase simulations Message-ID: <[email protected]> Content-Type: text/plain; charset="windows-1252"; Format="flowed" Hi Patrick, On 04/23/2018 03:42 PM, Timo wrote: > > Hi Patrick, > > welcome to the Dumux mailing list. > > If you are just starting Dumux, is there any reason you are doing so > with a very outdated version? The current dumux version is 2.12 and > works with dune 2.5 or dune 2.6. > > I'm not too familiar with the TwoPAdapter, but it is meant to be an > adapter for a two-phase model to fullfill the interface of the more > general mpnc model. > The comments most probably are related to how this law is used in the > volume variables (see mpnc model volumevariables.hh:200). As the mpnc > model is quite general it may be hard to understand because of many > abstractions. For a two-phase system this does what you expected i.e. > pc = pn ? pw. Just a more detailed explanation since I started writing it. Look at mpncvolumevariables.hh lines 161ff. Assuming wPhaseIdx to be 0 and nPhaseIdx to be 1, we have that the vector capPress = {-pc, 0}. Assuming the mostWettingFirst formulation, the first pressure is set to p0 = pw - capPress[0] + capPress[0] = pw - (-pc) + (-pc) = pw and the second to p1 = pw - capPress[0] + capPress[1] = pw - (-pc) + 0 = pw + pc which coincides with pn in your definition of pc. Kind regards Bernd > > Which model are you trying to use? Do you have more than two phases? > If yes, how many? > > If not, simply use a two-phase model and the Brooks-Corey material > law. There is also a three phase VanGenuchten model implemented. > But you would need to write a ThreePAdapter to use it with the mpnc > model. There is currently no Brooks-Corey law for more than 2 phases > implemented, but it should be easy to add if you know what it looks > like for your system. > > I might be easier to help if you describe which problem you are trying > to solve with Dumux (phases, components, miscibility, wettability, ...). > > > Best wishes > Timo > > > On 23.04.2018 15:02, [email protected] wrote: >> >> Hello everyone, >> >> I am new to the Dumux community and therefore, also after completing >> the tutorials, still quite unexperienced. >> >> Since over one week I am focusing on material laws and capillary >> pressure especially, but there are two questions >> >> for which I cant find any answers. The versions I am working with >> right now is dune 2.3 and dumux 2.7 >> >> I am working with the Brooks-Corey material law and call it via the >> TwoPAdapter (?2padapter.hh?), but there are two things I dont >> understand so far: >> >> 1. In function static void capillaryPressures(): Contrary to the >> commentary lines, the nonwetting phase gets nothing added and the >> capillary pressure is actually >> >> subtracted from the pressure of the wetting phase, what is the >> purpose of that? As far as I know, the capillary pressure is defined >> as the difference between >> >> the pressures from nonwetting and wetting phase i.e. pc = pn ? pw >> >> The passage of code I am talking about is lines 61-65 in >> dumux/material/fluidmatrixinteractions/mp/2padapter.hh: >> >> ? >> >> l. 61: // non-wetting phase gets the capillary pressure added >> >> l. 62: values[nPhaseIdx] = 0; >> >> l. 63: >> >> l. 64: // wetting phase does not get anything added >> >> l. 65: values[wPhaseIdx] = - TwoPLaw::pc(params, >> state.saturation(wPhaseIdx)); >> >> ? >> >> 2. The description in file 2padater.hh states, that the TwoPAdapter >> can be used to apply Brooks-Corey to M-phase fluid systems, but I >> dont get it how that can be accomplished >> >> since the number of phases is defined inside class TwoPAdapter as 2 >> (l. 51 ?enum { numPhases = 2};?). ?It is also referred to another >> file called ?MpBrooksCoreyMaterialParams? (l. 42) >> >> but I cant find the respective file anywhere. On the other hand I >> found in the same folder ?mplinearmaterial.hh? and >> ?mplinearmaterialparams.hh? which make the linear material law >> >> applicable for multiple phases. Is it possible that multiphase >> Brooks-Corey was not fully implemented yet in dumux 2.7? If yes, what >> are the alternatives? I was thinking about defining >> >> temporary fluidsystem, each containing two phases with decreasing >> wettability and then calling the TwoPAdapter for those systems, would >> that be possible? >> >> Thanks already for any support, I appreciate any advice! >> >> Best Regards >> >> Patrick >> >> >> >> _______________________________________________ >> 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 -- _______________________________________________________________ Bernd Flemisch phone: +49 711 685 69162 IWS, Universit?t Stuttgart fax: +49 711 685 60430 Pfaffenwaldring 61 email: [email protected] D-70569 Stuttgart url: www.hydrosys.uni-stuttgart.de _______________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listserv.uni-stuttgart.de/pipermail/dumux/attachments/20180423/7bb644f9/attachment-0001.html> ------------------------------ Subject: Digest Footer _______________________________________________ Dumux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux ------------------------------ End of Dumux Digest, Vol 86, Issue 12 ************************************* _______________________________________________ Dumux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
