-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
link mutation++ to SU2 with meson/ninja #146
Comments
Hello, Do you get the same error with other databases, like NASA-9? |
thanks for helping! this happens for any database. which is expected, since the work I am doing is linking Mutation to another code, so there's probably some link missing for the databases in general. which is strange, because it does not complain about mixture file or mechanism file, which suggests the folder Mutationpp/data is being recognized. so I'm a bit confused about this "contradiction" also, this error is not reproducible with any executable from Mutation++, because the point is that we are running SU2 and not mutation++. simply inside SU2 we have #include<mutation.h>, and declaration of Mixture object, and then calls to mixture functions. the only way to reproduce the problem is to install SU2 with mutation++ the way I did. If you'd be willing to help, I can explain to you the necessary steps! let me know :) thanks again |
Hey @CatarinaGarbacz, indeed this seems to be some type of linking problem. In fact, as you can see from the error message |
could you tell me what these files are, the ones which provide ThermoDB loaders? The thing is, with meson, Mutation++ is not compiled explicitly, at leats not the way I did it - so I do not have that log. Now, my way is obviously wrong and maybe this is exactly the problem, i.e, the lack of an explicit compilation. It's bit hard to explain all of what I did here, since I also do not master it, I wonder if it would make more sense to set up a meeting and I could show you all this ? |
Let's try to see if we can solve it here before :). I'd kindly ask if you can provide:
This will help us to understand how to fix that. Don't worry if you do not master it, just try to do your best to provide those information. |
Hey @CatarinaGarbacz, it seems @rubendibattista beat me to it, but I think indeed if you could provide that info first, it would be helpful. I am super swamped with work for next week or so, but I will definitely be happy chat with you offline if it is not resolved by then. Like this, @rubendibattista can also help out if I'm not responding. The benefit of working it out here is that potentially others can find the solution useful in the future. |
Oups, sorry @jbscoggi :). |
No problem @rubendibattista, thanks for helping! |
@rubendibattista sounds good, thanks a lot for getting back to me in a detailed way. Not sure if I will be able to respond to every point, because of the way I did things, but I will explain precisely what I did. And if you have more questions please ask! a)I did this in the past, with cmake/make, and things worked perfectly well a)
b) with meson/ninja things work differently. I don't know exactly how the linking process should be done, this is what I am trying to figure out. The point of using meson/ninja is: instead of doing all these manual steps, simply configuring SU2 in the following way:
so simply tell the configure string we want to enable mutation++, and all the rest would be done automatically.
|
Ehi @CatarinaGarbacz, I think the problem is in the meson files. Is your code available somewhere? Is it standard SU2? |
it is. not standard SU2, but you can checkout to this branch: https://github.com/su2code/SU2/tree/feature_NEMO_streamline |
The right way of using Mutation++ with meson should be:
project('example', 'cpp')
mutation = dependency('mutation++', method: 'cmake')
exe = executable('main', 'main.cpp', dependencies : mutation) Theoretically Unfortunately
Possible workarounds:
I'm not familiar with |
Ok, it seems to work.
# Mutation++
if get_option('enable-mpp')
cmake = import('cmake')
mpp_subproj = cmake.subproject('Mutationpp')
mpp_dep = mpp_subproj.dependency('mutation++')
su2_deps += mpp_dep
su2_cpp_args += '-DHAVE_MPP'
endif
diff --git TestCases/nonequilibrium/invwedge/invwedge.cfg TestCases/nonequilibrium/invwedge/invwedge.cfg
index ccc48f23f2..45dba0d328 100644
--- TestCases/nonequilibrium/invwedge/invwedge.cfg
+++ TestCases/nonequilibrium/invwedge/invwedge.cfg
@@ -16,7 +16,7 @@
% POISSON_EQUATION)
SOLVER= NEMO_EULER
%
-GAS_MODEL= AIR-5
+GAS_MODEL= air_5
%
GAS_COMPOSITION= (0.77, 0.23, 0.0, 0.0, 0.0)
%
@@ -56,7 +56,7 @@ FREESTREAM_TEMPERATURE_VE= 288.15
%
% Fluid model (STANDARD_AIR, IDEAL_GAS, VW_GAS, PR_GAS,
% CONSTANT_DENSITY, INC_IDEAL_GAS, INC_IDEAL_GAS_POLY, MUTATIONPP, USER_DEFINED_NONEQ)
-FLUID_MODEL= USER_DEFINED_NONEQ
+FLUID_MODEL= MUTATIONPP
%
% -------------------- BOUNDARY CONDITION DEFINITION --------------------------%
%
(END)
../../../builddir/SU2_CFD/src/SU2_CFD invwedge.cfg This gives me the following output:
It explodes, but at least it seems to not complain about Mutation. What do you think @CatarinaGarbacz? |
Uau I'm very impressed, that was quick! it definitely works perfectly well in term of linking mutation with SU2 :D Probably the reason why it explodes is simply because in MPP we have N,O,NO,N2,O2 as the list of species and in the userdefined model we have N2,O2,N,O,NO, so you're giving 0.77, 0.23 mass fractions to N and O. which shoud be fine generally, but this test-case was only configured and tested for 0.77 N2 and 0.23 O2 so might give some issues if we change that. in any case, I will implement this and test with the right mass fractions. and let you know how it went. But many thanks, this is incredibly helpful. I can tell you understand more about this scripting/compilation/installation stuff than I do, so very much appreciated. |
Amazing! 👍 I'll close this issue since it's resolved in terms of build systems shenanigans, feel free to drop a message to let us know if you manage to make the simulation work as expected. PS: I should probably checkout SU2, sooner or later, it looks a cool project! :) |
Up to now, we were linking mpp to SU2 by means of:
1.install mpp - with cmake
2.compile mpp - with make
3.configure su2 with linking flags to mpp
4.compile su2 - with make
now SU2 has a new way of configuring/compiling, that uses building software called meson/ninja. So I have been working on making the previous process completely automatic within this software. The idea is:
1.configure su2 with meson, with flag mutationpp=true
2.compile su2 with ninja
and everything else is done in the background with meson scripting.
It is generally going well. I specify the sources in the meson.build file (all .cpp files in Mutationpp/src/), as well as and include folders (all folders in Mutationpp/src/), and su2 configures and compiles well. However, when I run the code, I get the following error:
**M++ error: invalid input.
input: key = RRHO
Provider for type ThermoDB is not registered. Possible providers are:
Was trying to load the thermodynamic database.**
In the attempt to solve this, I tried also including all the folders in Mutationpp/data/ but as expected this did not work. Could you explain to me the origin of this error and perhaps any guess of what is missing in the meson.build linking files?
Thank you
The text was updated successfully, but these errors were encountered: