Dear Ali, good to know that the code was helpful. Please stay on the mailing list when asking Dumux specific questions.
> In the code that you sent me, you only calculate the total advetive flux for > each phase. To do the same thing for each component, i should only multiply > them by the mass fractions in the corresponding phase. Am i right? yes. You can also check the 2p2clocalresidual.hh where the component flux is calculated. > Now for diffusive flux : please find attached a modified code. > I used the explanations of 2p2c local residuals to write this function. > Can you please, if possible, take a look at this code and confirm it? Sorry I cannot read the file in this format. But the 2p2clocalresidual.hh is the right place to look for such a formulation. I suggest that you set up a test problem where you only consider diffusion (no advetion or no pressure gradient in the system) to verify your results. > As I know, in 2p2c model, the diffusion of each component in other phase is > taken into account. So I should change the equation index once the diffusive > flux in a particular phase is calculated. > To be more clear, What we calculate for wetting phase is the diffusion of co2 > in water and therefor it should be added to co2 (as a component) mass balance > equation. Yes that is correct, if you want to calculate a component flux (see computeDiffusiveFlux(...) in 2p2clocalresidual.hh). Best wishes Alex On 05/17/2013 09:29 PM, Ali Nowamooz wrote: > Dear Alex, > > Sorry for my very late answer. I was out of office for the week and i > couldn't thank you earlier for your help. > Your code helped me a lot and i think i finally found how to calculate > different fluxes (advective and diffusive). However, if you don't mind, i > would like to ask you some questions. > > In the code that you sent me, you only calculate the total advetive flux for > each phase. To do the same thing for each component, i should only multiply > them by the mass fractions in the corresponding phase. Am i right? > > Now for diffusive flux : please find attached a modified code. > I used the explanations of 2p2c local residuals to write this function. > Can you please, if possible, take a look at this code and confirm it? > > My main question concerns the way that i defined the EqIdx : > > int eqIdx = (phaseIdx == wPhaseIdx) ? contiNEqIdx : contiWEqIdx; > > As I know, in 2p2c model, the diffusion of each component in other phase is > taken into account. So I should change the equation index once the diffusive > flux in a particular phase is calculated. > To be more clear, What we calculate for wetting phase is the diffusion of co2 > in water and therefor it should be added to co2 (as a component) mass balance > equation. > > Once again thanks a lot for your help. > Hope you a great weekend > Best wishes > Ali > > > ________________________________________ > De : Alexander Kissinger [[email protected]] > Date d'envoi : lundi 13 mai 2013 03:15 > À : DuMuX User Forum > Cc : Ali Nowamooz > Objet : Re: [DuMuX] Advective and Diffusive Flux > > Dear Ali, > > attached to this mail are two files (problem and model file) where > diffussive and advective fluxes over a certain area or layer are written > into the command line output at the end of every timestep. You can use > these files as an orientation. > However, this output is only useful if the layer is situated > perpendicular to the coordinate axis and cuts the axis at a certain > coordinate. If you need something else you have to adjust the function > "calculateFluxAcrossLayer(...)" in eco2model.hh to your needs. > To use this function you can derive a new model file from the > co2model.hh and include the function "calculateFluxAcrossLayer(...)" > there and then call this function from the function "postTimeStep()" in > your problem file (as done in the attached eco2problem.hh). > Alternatively you can also adjust the attached files to your problem > demands. > > best regards > Alex > > > > On 05/13/2013 06:15 AM, Ali Nowamooz wrote: >> Dear Dumux, >> >> I worked really hard on my problem but i didn't find a solution. I really >> need your help. >> >> I am working on HeterogeneousProblem (co2 injection) and I wanted to know if >> I have any possibility to write advective and diffusive fluxes over faces of >> sub-control-volume on an external file (for example a text file). >> >> I think both these fluxes are calculated inside 2p2clocalresidual.hh >> (computeAdvectiveFlux and computeDispersiveFlux). >> >> I tried to call them as PrimaryVariables but i couldn't go further. My >> problem is obviously due to my lack of knowledge of c++. >> >> Can you please help me and give me some information? >> >> best regards >> Ali >> >> _______________________________________________ >> Dumux mailing list >> [email protected] >> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux >> > > -- > ******************************************************* > !!!! CMWR 2014: 9th - 13th June 2014 in Stuttgart !!!! > Please visit www.cmwr14.de > ******************************************************* > 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] > -- ******************************************************* !!!! CMWR 2014: 9th - 13th June 2014 in Stuttgart !!!! Please visit www.cmwr14.de ******************************************************* 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
