Is this your complete code? It seems that you are not evaluating the
localresidual at all within your loop (compared to your previous
versions of the code).
Furthermore, I would make sure that you actually pick the right scvs,
maybe by making an output within the respective loop, telling you
the actual position of the scv:
// loop over subcontrol volumes
for (int i = 0; i < fvGeometry.numScv; i++) {
if(fvGeometry.subContVol[i].global[0] <
0.01*this->problem_().discretisationSize().first) {
std::cout << "pos of scv (vertex) : " << fvGeometry.subContVol[i].global
<< std::endl;
flux += this->localResidual().residual(i);
}}
By the way: Why are you using
0.01*this->problem_().discretisationSize().first) instead of
this->bBoxMin()[0] + eps
(where eps is e.g.1e.6) ?
Best regards
Kilian
Here, you compare the
On 04/25/2017 11:02 AM, Gergely Schmidt wrote:
Thank you very much! Still I encounter noticeable mass flow errors
(compared with set neumann boundary condition) rising with mesh
refinement. Could you have a look at the resulting code? There should
be no big changes since the last version.
void massFlow2D(){
ElementVolumeVariables elemVolVars;
FVElementGeometry fvGeometry;
PrimaryVariables flux(0.0);
// loop over elements
for (const auto& element : elements(this->problem_().gridView())) {
if (element.partitionType() != Dune::InteriorEntity)
continue;
fvGeometry.update(this->gridView_(), element);
elemVolVars.update(this->problem_(), element, fvGeometry, false);
// loop over subcontrol volumes
for (int i = 0; i < fvGeometry.numScv; i++) {
if(fvGeometry.subContVol[i].global[0] <
0.01*this->problem_().discretisationSize().first) {
flux += this->localResidual().residual(i);
}}
} // end loop over elements
std::cout << "mass flow through left boundary = " << flux << "
[kg/s/m]" << std::endl;
}
Best regards, Gergoe
**********************************************************
_______________________________________________
Dumux mailing list
[email protected]
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: [email protected]
Telefon: 0049 711 685-60461 ** fax: 0049-711-685-60430
http://www.hydrosys.uni-stuttgart.de
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux