Reg. a nonlinear source term

Hello,

I am a new learner to OGS. I would like to give a nonlinear function as a source/ decay term (Q) in the component transport module—for example, the source term as a function of concentration itself.

Q = -(C/(Km+C)), where Km is some constant, and C is the concentration of the component.

Please help me in finding out the ways to do that.

Thanks
Pavan.

Hi!
if source terms depend on primary variables then python source terms are the way to go: Poisson equation using Python for source term specification

Hello,

When I try to run the code built with python source terms, I get the following error from OGS.

“OpenGeoSys has not been built with Python support”

Please help in including python support in OGS.

Thanks
Pavan.

Hi,

this error means that in your compilation of OGS, the support for Python boundary conditions is not enabled.

In order to enable it, you need to recompile OGS with flag -DOGS_USE_PYTHON enabled.

You can have a look at this page for more details: Python boundary conditions - prerequisits.

I hope this helps.

Dear sir,

I couldn’t utilise the python module even after building with cmake successfully.

Build-done

Still, I am getting the following error when I run an example from elliptic module.

Please help me in this regard.

Thanks
Pavan.

Hi,
you have successfully run the configuration step. Now you need to update your OGS build.
To do so, go to the release folder. Based on what I see in your screenshots, for you this would be:

cd /home/pkbuhukya/qt/build/release

and use ninja to rerun the build process:

ninja

This time it should take less time than the original compilation.

For more details, have a look at the page describing build step in our Developer Guide.

Let us know if you have any further problems.

Best,
Feliks

Dear sir,

I have successfully build with ninja. But, still, I couldn’t run python binding-based .prj files.

Please let me know the issue!

Thanks
Pavan.

From what I see, Python boundary conditions should work now.

I see that you run OGS with ogs command. So there is some OGS included in your path. Is it possible that ogs command points to different executable, than the one compiled with support for Python BC (e.g.: different build folder, pip install, etc)? Can you check with which ogs if it points to the correct executable?

Dear Sir,

Yes, I found another ogs on which the files are running, different from the compiled ogs.

The working ogs was installed from “pip install ogs” command. But, compiled ogs is downloaded using git cloning.

I am running my files on WSL-based ubuntu. Now how to change my path to the compiled ogs?

Also, what are the other possibilities to solve this issue?

Thanks
Pavan.

You can call specific executable by calling it with its full path pointing to it. Based on your screenshots it may be for your local build of OGS with Python boundary conditions look as follows:

/home/pkbhukya/qt/build/release/bin/ogs

For convenience, you can add an alias to your .bashrc file:

alias ogs_p_bc='/home/pkbhukya/qt/build/release/bin/ogs'

where ogs_p_bc is a command you will type to call binary specified on the right side of the = sign. You can choose it as you like, but you should avoid using the same names as commends already existing in your system. This is why in this example I have appended ogs with _p_bc, to indicate that this is your build with Python boundary conditions enabled.

Thank you very much. It worked finally.