Re: [DuMux] Gas Injection - Time

2022-11-23 Thread Timo Koch
Hi Mohammad,

This seems like a C++ problem not a Dumux issue. What have you tried so far? 
What does it mean “it will abort”?

"Method 2” has the wrong logic. “Method 1” looks correct (apart from underscore 
missing for injectionEnd_). Your attached file neither implements 1 nor 2.

Best
Timo


On 23 Nov 2022, at 10:30, Mohammad Hodroj (Student) 
mailto:mn...@mail.aub.edu>> wrote:

Dear DuMux Community,

I hope this email finds you well.

I am writing to kindly ask for your support in the following:

a) I am using porous medium flow
b) I am using injection problem

I need to inject gas between  injectionDuration_ = 4.7304e8 seconds and time = 
injectionEnd_ = 4.80816e8 seconds (3months) but it is not working. Once it 
reaches the time it will abort.

I tired the following:

Method:1

 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
{
BoundaryTypes bcTypes;


bcTypes.setAllNeumann();

return bcTypes;
}


NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
{

NumEqVector values(0.0);


if (time_ > injectionDuration_ && time_ < injectionEnd
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = -5e-5;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}



return values;
}


Method 2


NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
NumEqVector values(0.0);


if (time_ < injectionDuration_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = 0.0;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

else if (time_ > injectionDuration_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = -5e-5;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

 else if (time_ < injectionEnd_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = -5e-5;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

   else if (time_ > injectionEnd_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = 0.0
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

return values;
}



Looking forward to your help.


Best Regards,
Mohammad Hodroj



___
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] Gas Injection - Time

2022-11-23 Thread Mohammad Hodroj (Student)
Dear DuMux Community,

I hope this email finds you well.

I am writing to kindly ask for your support in the following:

a) I am using porous medium flow
b) I am using injection problem

I need to inject gas between  injectionDuration_ = 4.7304e8 seconds and time = 
injectionEnd_ = 4.80816e8 seconds (3months) but it is not working. Once it 
reaches the time it will abort.

I tired the following:

Method:1

 BoundaryTypes boundaryTypesAtPos(const GlobalPosition &globalPos) const
{
BoundaryTypes bcTypes;


bcTypes.setAllNeumann();

return bcTypes;
}


NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
{

NumEqVector values(0.0);


if (time_ > injectionDuration_ && time_ < injectionEnd
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = -5e-5;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}



return values;
}


Method 2


NumEqVector neumannAtPos(const GlobalPosition &globalPos) const
{
// initialize values to zero, i.e. no-flow Neumann boundary conditions
NumEqVector values(0.0);


if (time_ < injectionDuration_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = 0.0;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

else if (time_ > injectionDuration_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = -5e-5;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

 else if (time_ < injectionEnd_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = -5e-5;
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

   else if (time_ > injectionEnd_
 && globalPos[0] <3.15 + eps_ && globalPos[0] > 3.075 - eps_ && 
globalPos[1] < 0.9*this->gridGeometry().bBoxMax()[1])
{

values[Indices::conti0EqIdx + FluidSystem::CH4Idx] = 0.0
values[Indices::conti0EqIdx + FluidSystem::H2OIdx] = 0.0;
}

return values;
}



Looking forward to your help.


Best Regards,
Mohammad Hodroj



// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
 *   See the file COPYING for full copying permissions.  *
 *   *
 *   This program is free software: you can redistribute it and/or modify*
 *   it under the terms of the GNU General Public License as published by*
 *   the Free Software Foundation, either version 2 of the License, or   *
 *   (at your option) any later version. *
 *   *
 *   This program is distributed in the hope that it will be useful, *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of  *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the*
 *   GNU General Public License for more details.*
 *   *
 *   You should have received a copy of the GNU General Public License   *
 *   along with this program.  If not, see .   *
 */
/*!
 * \file
 *
 * \brief The two-phase porousmediumflow problem for exercise-basic
 */

#ifndef DUMUX_EX_BASIC_PROBLEM_2P_HH
#define DUMUX_EX_BASIC_PROBLEM_2P_HH

#include 
#include 
#include 
#include 
#include 

namespace Dumux {

/*!
 * \ingroup TwoPModel
 * \ingroup ImplicitTestProblems
 * \brief Gas injection problem where a gas (here  nitrogen) is injected into a fully
 *water saturated medium. During buoyancy driven upward migration the gas
 *passes a high temperature area.
 *
 * The domain is sized 60 m times 40 m.
 *
 * For the mass conservation equation neumann boundary conditions are used on
 * the top, on the bottom and on the right of the domain, while dirichlet conditions
 * apply on the left boundary.
 *
 * Gas is injected at the right boundary from 7 m to 15 m at a rate of
 * 0.001 kg/(s m), the remaining neumann boundaries are no-flow
 * boundaries.
 *
 * At the dirichlet bo

Re: [DuMux] Printing Flow Rate or Flux in VTK

2022-11-23 Thread Timo Koch
Dear Mohammad,

please reply to your own question with a follow-up instead of posting the same 
question twice.

Have you looked into the mail archive 
(https://www.mail-archive.com/dumux@listserv.uni-stuttgart.de/)?

A similar question was just answered a few weeks ago. Maybe this solves your 
problem


Re: [DuMux] Computing Boundary 
Fluxes
mail-archive.com
[apple-touch-icon-114x114.png] 


and

Re: [DuMux] Output face fluxes in 
VTU
mail-archive.com
[apple-touch-icon-114x114.png] 




Best
Timo

23. nov. 2022 kl. 08:19 skrev Mohammad Hodroj (Student) :


Dear DuMux Community,

I hope this email finds you well and safe.

I am writing to kindly ask for your support in the following:

a) I am working on porousmedium flow model (injection problem)
b) I am using CCtpfa

Question:
How can I print the flow rate of gas (Q) or gas flux in vtk files?  because I 
need to know the change in gas flow rate with time?

Thanks for your help.

Best Regards,
Mohammad Hodroj
___
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