Exporting 1D profiles

Miscellaneous discussion topics about Code_Saturne (development, ...)
Post Reply
Gareth Gretton

Exporting 1D profiles

Post by Gareth Gretton »

Hello,

I'm aware of the functionality in the Code_Saturne GUI for exporting 1D profiles (defined by two
points) and the way that this can be extended in usproj by defining the line by an arbitrary number of points. For those that don't know, this exports data from the cells closest to a set number of points along that line, with the default being 200 (I think).

What I'd like to be able to do is to export data from every cell through which my profile passes. This would sort of 'automatically' set the resolution for the output data in what I would regard as a sensible way!

One suggestion for achieving this end is to check whether a line intersects a cell using something called the "Liang-Basky clipping algorithm". The implementation of this looks fairly straighforward, after a connectivity matrix has been assembled (which lists all the faces belonging to a given cell).

The point of this post is to ask whether anyone has already done this. If not I'll have a go and attach my effort to this thread at an as-yet unspecified future date!

Gareth
Alexandre Douce

Re: Exporting 1D profiles

Post by Alexandre Douce »

Hi Gareth,

As far as I know, nobody has coded a such algorithm for Code_Saturne. This algorithm seems
to be a good idea. Whatever, it needs to construct the connectivity cells-to-faces, which is not available by default. But this connectivity is computed when the lagrangian particles tracking module (lagdeb.f90) is activated. If you are interested I have also a version coded in C :)
Gareth Gretton

Re: Exporting 1D profiles

Post by Gareth Gretton »

Hi Alexandre,

Thanks for your comments. In regards to calculating the cells-to-faces connectivity, a colleague here in Edinburgh has already written some code to do this as we did not realise that this was alread done in lagdeb.f90. I'm just having a look at lagdeb.f90 now and note that it may have a slightly more general algorithm, so possibly I will use that.
Alexandre Douce

Re: Exporting 1D profiles

Post by Alexandre Douce »

That's cool! Do you intend to work in usproj.f90 or in cs_gui.c?
David Olivieri

Re: Exporting 1D profiles

Post by David Olivieri »

It is created in usinv.f90 as a an external module that can be activated in any subroutine through the use of
use connectivity
I hope this helps
David Olivieri
(Colleague of Gareth)
Gareth Gretton

Re: Exporting 1D profiles

Post by Gareth Gretton »

Hi Alexandre,
I think I'll be working in usproj.f90 just for now - but am I right in guessing that changes to cs_gui.c would affect the GUI itself, and so I'd need to recompile ncs?
Alexandre Douce

Re: Exporting 1D profiles

Post by Alexandre Douce »

If you have already the connectivity in Fortran it is easier to work in usproj.f90. Nevertheless, modifications of cs_gui.c will not affect the GUI if the set up for profiles does not change.
David Olivieri

Re: Exporting 1D profiles

Post by David Olivieri »

Dear Alexandre Douce,

   re: translation of comments on subroutine lagdeb.f90

I am writing to you if you know anyone who has translated the comments on subroutine lagdeb.f90, (see attached), into English, since I would like to compare what I have done already in terms of connectivity with this subroutine?
Attachments
lagdeb.f90
(17.57 KiB) Downloaded 237 times
Gareth Gretton

Re: Exporting 1D profiles

Post by Gareth Gretton »

Hi Alexandre/all,

Having looked at lagdeb.f90 I think I see what's going on . . .

However, I think there might be a small (trivial) mistake in the documentation (not in the code itself), specifically in the table which explains itycel.

At the moment the entry reads:

Code: Select all

!        .-----.-------.------.------.-------.------.--------.
!        |  1  |  ...  | iVal | jVal |  ...  |LNDNOD|LNDNOD+1|
!        `-----'-------'------'------'-------'------'--------'
!           1            iPos  iPos+1         nPos-1 nPos=NCELET+1
but as I understand the penultimate entry shouldn't be LNDNOD, but instead "LNDNOD - number of faces associated with final cell + 1".

I may try and come up with a slightly clearer table . . .

Also, I've been having a bash at translating comments from French to English with the aid of Google translate, my French office mates, and my own incredibly limited grasp of French. Results attached!
Attachments
lagdeb.f90
(19.23 KiB) Downloaded 237 times
Post Reply