Tudat / tudat

NOTE: This Tudat version is no longer supported. See https://docs.tudat.space/en/stable/ and https://github.com/tudat-team/tudat-bundle for the new version
BSD 3-Clause "New" or "Revised" License
87 stars 142 forks source link

Addition of SPARTA Interface for Rarefied Flow Aerodynamic Analysis #380

Closed mfacchinelli closed 5 years ago

mfacchinelli commented 6 years ago

Hi Dominic,

It's me, yet again :) I am trying to add in Tudat an interface to SPARTA (Stochastic PArallel Rarefied-gas Time-accurate Analyzer, sparta.sandia.gov), based on the Direct Simulation Monte Carlo method, for the aerodynamic analysis in rarefied flow conditions.

I am basing the structure of the program on the hypersonic local inclination analysis, but there are some key differences, which I am not sure how to tackle. I have created a working stand-alone file that carries out the simulation (here), but putting this in a class, is harder than I thought.

I have pushed the changes I have made so far to a new brach on my forked Tudat:

https://github.com/mfacchinelli/tudat/tree/sparta

I had started writing out the questions I had on this post, but I realized it was taking too much space. It would be great if you had some time in the coming weeks to give me some direction. However, the main problems (for now) are:

Thank you!

Kind regards,

Michele

DominicDirkx commented 6 years ago

Hi Michele,

This week is already quite full, would next Monday at 11:00 or 11:30 work for you (depending on whether you think we'll need 1 or 0.5 hours). For your second point (Using molecular speed ratio, instead of Mach number, as independent variable), the enum AerodynamicCoefficientsIndependentVariables defines which types of independent variables are currently supported. You'll need to extend this list for your model. If you do 'Find Usages' in Qt, and have a look at how this enum is used in the Tudat/Astrodynamics/Aerodynamics folder, you should get quite far already.

This may also require some updates to the atmosphere model. Iosto is working on extending the capabilities of the atmosphere models, to be more flexible (also in terms of 'extra' properties, besides the ones now supported),

Dominic

mfacchinelli commented 6 years ago

Hi Dominic,

I have a meeting with Erwin at 10:30, so I think 11:30 works best. But anyway, I think that I am slowly solving the problems.

I have decided to use the Mach number, after all, since this makes it more consistent with the rest. Also, if I used the molecular speed ratio, it would make sense to also use number density, instead of altitude, as independent variables, which for now, would require more work than I plan to spend on this.

The class interface is also not really an issue anymore. What I don't understand is the error that I am getting when I try to compile the new class in an application:

duplicate symbol __ZN5tudat12input_output27readSpartaInputFileTemplateERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    CMakeFiles/application_spartaTest.dir/spartaTest.cpp.o
    /Users/Michele/GitHub/tudat/tudatBundle/tudat/lib/libtudat_aerodynamics.a(rarefiedFlowAnalysis.cpp.o)
duplicate symbol __ZN5tudat12input_output22readSpartaGeometryFileERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    CMakeFiles/application_spartaTest.dir/spartaTest.cpp.o
    /Users/Michele/GitHub/tudat/tudatBundle/tudat/lib/libtudat_aerodynamics.a(rarefiedFlowAnalysis.cpp.o)
ld: 2 duplicate symbols for architecture x86_64

From what I understood by googling the error, the problem is in the #include statements. So, somewhere the definitions of the two functions in spartaDataReader.h (this file) are overwritten?

mfacchinelli commented 6 years ago

Never mind, I don't get the error anymore! (Not sure how I fixed it though...)

DominicDirkx commented 6 years ago

Happy to hear it :) Let me know if you still want to talk next Monday,

mfacchinelli commented 6 years ago

Well, now I would need help in incorporating the interface in Tudat. The main issue is that not all the users will have SPARTA installed, and so it should be something optional (including the unit test). But this of course, is only a problem if you are interested in adding it to the official Tudat.

DominicDirkx commented 6 years ago

Hi Michele,

Having the SPARTA interface in Tudat would definitely be nice! We have a bunch of other external packages (for instance Pagmo), that can be interfaced with Tudat, but are turned off by default. For SPARTA, we could take a similar approach. For now, I'd advice you to write the SPARTA interface code, while mostly ignoring this, and we can make it nice and modular after you've verified that it works well.

Anticipating this possible step, it would help if you limit the places where there is a #include of the sparta package, and if you put things that uses sparta in (a) separate file(s), as much as possible.

Cheers,

Dominic

mfacchinelli commented 6 years ago

Hi Dominic,

I had a meeting with Erwin today, and we discussed the integration of SPARTA in Tudat. He suggested to make SPARTA run on the faculty servers, since it can be a rather slow process.

I just got my credentials today for the servers, and installing it was literally a matter of seconds (thanks to the 14 cores :p). I am now running some examples to see if the installation worked well.

I know that other students have been working with Tudat on the server, so I was wondering if you could give me some tips on how to do it, or redirect me to some of the students who can help (I know Hamid is working with it). Also, in this way it would maybe be even easier to have the software as a part of Tudat, since we already know that it is easy and quick to install on the server (although the license problem is still there).

Thank you and kind regards,

Michele

DominicDirkx commented 6 years ago

Hi Michele,

Thanks for the update. Running it on the server is a good idea. The many-core compilation indeed saves a huge amount of time (provided you have enough RAM to do it).

Indeed Hamid is working on the server, and is by now quite experienced with it. I sent him a short guide some time ago, you can ask him for it (or send me an e-mail again tomorrow, when I'll be in a position to try to find it myself). There are one or two others who are starting to use, but I think Hamid can provide the best input, should you need it.

The SPARTA licence problem only exists (I think) if we integrate it with tudat/tudat bundle. We could proviude the interface for Sparta, instructions for installing Sparta, etc. without actually integrating the Sparta source code ourselves. I'd have to look into it, but I think that this would be fine.

Best regards,

Dominic


Van: Michele Facchinelli notifications@github.com Verzonden: maandag 14 mei 2018 16:06:03 Aan: Tudat/tudat CC: Dominic Dirkx - LR; Comment Onderwerp: Re: [Tudat/tudat] Addition of SPARTA Interface for Rarefied Flow Aerodynamic Analysis (#380)

Hi Dominic,

I had a meeting with Erwin today, and we discussed the integration of SPARTA in Tudat. He suggested to make SPARTA run on the faculty servers, since it can be a rather slow process.

I just got my credentials today for the servers, and installing it was literally a matter of seconds (thanks to the 14 cores :p). I am now running some examples to see if the installation worked well.

I know that other students have been working with Tudat on the server, so I was wondering if you could give me some tips on how to do it, or redirect me to some of the students who can help (I know Hamid is working with it). Also, in this way it would maybe be even easier to have the software as a part of Tudat, since we already know that it is easy and quick to install on the server (although the license problem is still there).

Thank you and kind regards,

Michele

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/Tudat/tudat/issues/380#issuecomment-388829080, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEzj3Pu4QWet9-SMxwhOvu59rLqjCgpEks5tyY9LgaJpZM4Tt5lr.

mfacchinelli commented 6 years ago

Hi Dominic,

I have created a new GitHub repository (https://github.com/mfacchinelli/sparta) where I pushed the SPARTA code, and some instructions on how to install it on the TU Delft server. I will try to test the installation and the interface once I manage to install Tudat and once the SPARTA simulation I am already running is finished.

Michele

PS: A quick update on the installation. Now boost was downloaded without errors, and it compiled successfully. It would indeed appear it was a server error that fixed itself.

DominicDirkx commented 6 years ago

Very nice!

mfacchinelli commented 6 years ago

Hi Dominic,

I have made some further changes to the SPARTA code. Right now it works on the server, and it can even automatically install and build SPARTA, if the user has not done it himself first.

I was trying to make the addition of SPARTA more modular, by adding the option USE_SPARTA in the Tudat CMakeLists.txt file. Also, I added the if statements (#if USE_SPARTA ... #endif) in all the files that are part of the rarefied flow analysis with SPARTA. However, even though I currently set the USE_SPARTA option as ON, it still tells me that it could not find the functions, when I run the test: https://github.com/mfacchinelli/tudatTesting/blob/master/spartaTest.cpp Do I need to add something else, before it can work?

Thank you and kind regards,

Michele