Page 1 of 2

Mapping boundary conditions

Posted: Mon Apr 18, 2016 6:31 pm
by fabioretti
Hi,

I need to define a non-uniform normal velocity distribution over a rectangular inlet boundary, using data from an external ASCII file (3 columns, for x, y and w resp.)
The (x,y) points for which the velocity is available do not coincide with any mesh points.

The question is how to map the available data onto the boundary by some kind of interpolation.

As far as I understand, one has to work with cs_user_boundary_condition. That's fine, but I cannot figure out an efficient way to read the data in and to process it. I'm trying not to have to code interpolating functions (which I'll finally do, though, if unavoidable).

I might even do the interpolation stuff "outside" (e.g. by some python) and thus get a BC set conformal to the mesh boundary, but still I wouldn't know how to import it.

Thanks to anyone for any hint.
Regards,
Fabio

Re: Mapping boundary conditions

Posted: Tue Apr 19, 2016 12:11 am
by Yvan Fournier
Hello,

A colleague recently wrote an interpolation package for similar situations, which I will be merging into the main code (at least as advanced examples), but I have not had the time to to this yet (I was hoping to do this next summer).

I could post this as a "raw" example, but I need to take a look at the code first, to see how easy or difficult it is to use this... I'll keep you informed within a few days if this seems easy or not...

In any case, cs_user_boundary_conditions.f90 is the place to do this. Simply, with a detailed example, you have less wheels to reinvent....

Best regards,

Yvan

Re: Mapping boundary conditions

Posted: Tue Apr 19, 2016 8:58 am
by fabioretti
Hi Yvan,

Thanks a lot, that is exactly what I was hoping. And reinventing too many wheels is exactly what I would like to avoid!
I'll be looking forward to receiving your raw example. Thanks in advance for that.

Best wishes
fabio

Re: Mapping boundary conditions

Posted: Fri Apr 29, 2016 10:21 am
by fabioretti
Dear Yvan,

You certainly remember and probably have been too busy. Just in case you don't, I remind you about the "example" that you said you would provide. That'd help me a lot.

Many thanks!
Fabio

Re: Mapping boundary conditions

Posted: Fri Apr 29, 2016 1:49 pm
by Yvan Fournier
Hello Fabio,

Not forgotten, but been very busy with other parts of the code. I'll try to check/format that code within a week...

Best regards,

Yvan

Re: Mapping boundary conditions

Posted: Fri Apr 29, 2016 3:15 pm
by fabioretti
Thank you Yvan, I appreciate.
Best
Fabio

Re: Mapping boundary conditions

Posted: Fri May 06, 2016 10:53 pm
by Yvan Fournier
Hello,

I only had time to take a very short look at the code which was provided to by by Romain.

I post it here (it includes an example data file), hoping that this will be useful (the model is quite complete, allowing cubic splines instead of linear interpolation, but you'll need to check the example and function arguments to see how/when to use this.

Any feedback is appreciated (it will help me make the documentation better). Feedback in the form of improvements or text which could become part of the documentation is even better. And questions are less fun for me to answer (I'm happy answering questions, but have a bit too much at the same time these days), but they also help make a better documentation...

Regards,

Yvan

Re: Mapping boundary conditions

Posted: Sun May 08, 2016 6:38 pm
by fabioretti
Hi Yvan

Thank you very much for the example. I'll go through it and certainly get back to you with a feedback, if I manage to get the thing working!

Best wishes
Fabio

Re: Mapping boundary conditions

Posted: Thu May 12, 2016 5:41 pm
by fabioretti
Hi Yvan,

Just started going through it...
I suppose a header file's missing (spline.h).
Can you provide it, please?

Thanks. Regards,
fabio

Re: Mapping boundary conditions

Posted: Thu May 12, 2016 6:56 pm
by Yvan Fournier
Hello,

I'll need to ask the original developer, but you can try commenting the line with "#include "splines.h"", in which case you'll get compiler warnings about missing prototypes, but possibly no other error (i.e. no missing structure, macro, or enum definitions).

I'll check on my side, and keep you informed (if the suggestion above works, it means I have enough info in splines.c to rebuild splines.h).

Regards,

Yvan