Thank you, Kilian! Trying to follow your advice, I implemented in
dumux/porousmediumflow/2p2c/implicit/model.hh the following:
*void**massFlow*(){
ElementVolumeVariableselemVolVars;
FVElementGeometryfvGeometry;
// Loop over elements
*for*(*const**auto*& element : elements(*this*->problem_().gridView())) {
*if*(element.partitionType() != Dune::/InteriorEntity/)
*continue*;
*const*GlobalPosition&globalPos = element->geometry().center();
*if*(0.251 < globalPos[0])
*continue*;
fvGeometry.update(*this*->gridView_(), element);
elemVolVars.update(*this*->problem_(), element, fvGeometry, *false*);
*this*->localResidual().evalFluxes(element, elemVolVars);
*this*->localResidual().evalStorage(element);
PrimaryVariablesflux(0.0);
// Loop over subcontrol volumes
*for*(*int*i = 0; i < fvGeometry.numScv; i++) {
flux += *this*->localResidual().residual(i);
}
std::cout << "globalPos: "<< globalPos << ", flux: "<< flux << std::endl;
}
}
The function aims to get the mass flow for the cells (horizontal
dimension each = 0.5) at the left boundary at which Neumann boundary
conditions are set. The problem is isotherm, so only two conservation
equations (mass) are solved. But I cannot interpret the calculated
values for the variable “flux”. I’d like to get the mass flow rate
[kg/s] for each component in each direction (2D), thus 4 values.
I would be grateful for another hint. Best regards,
Gergő
Am 08.03.2017 um 18:59 schrieb [email protected]:
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: Mass flow through boundary (Kilian Weishaupt)
----------------------------------------------------------------------
Message: 1
Date: Wed, 8 Mar 2017 18:58:52 +0100
From: Kilian Weishaupt <[email protected]>
To: [email protected], [email protected]
Subject: Re: [DuMuX] Mass flow through boundary
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Dear Gergely,
sorry for the late response. Without having seen your code it is quite
hard to tell why your program stops.
Have you tried running valgrind?
Anyway, there might be a different solution for getting the fluxes
across the boundary (unfortunately, no standard method is implemented yet):
You can call
localResidual.evalFluxes(element, elemVolVars);
localResidual.evalStorage(element);
and then sum up the entries of the element residual
localResidual.residual() (in case you are using box).
If you have no object of localResidual at hand, you can simply
instantiate one and initialize it with the problem.
LocalResidual localResidual;
localResidual.init(problem);
This has to be repeated for all elements on the boundary of interest.
Best regards
Kilian
On 03/01/2017 03:26 PM, Gergely Schmidt wrote:
Dear Dumux community,
I?d like to calculate the mass flow through a boundary face for an
implicit 2p2c case for multiple time steps. Is there an already
implemented way? If not, is it possible to duplicate the
localresidual.hh/computeFlux function and extend its parameter list
with specific entities of the types Problem, Element,
FVElementGeometry and ElementVolumeVariables which can then be used to
update fluxVars? The new computeFlux function could then be called
with onBoundary=true, couldn?t it? But how can I proceed from there?
My compiled program stops without errors after the first call of
asImp_()->computeAdvectiveFlux(flux, fluxVars) inside the new
computeFlux function.
Many thanks and best regards,
Gerg? Schmidt
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
--
***********************************************************
Gergely Schmidt M.Sc.
Wissenschaftl. Mitarbeiter
Institut für Strömungsmechanik und Umweltphysik im Bauwesen
Leibniz Universität Hannover
Appelstr. 9 a
30167 Hannover
tel +49 (0) 511 / 762 4205
***********************************************************
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux