Mapping boundary conditions
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
-
- Posts: 8
- Joined: Fri Apr 13, 2012 2:05 pm
Mapping boundary conditions
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
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
-
- Posts: 4206
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Mapping boundary conditions
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
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
-
- Posts: 8
- Joined: Fri Apr 13, 2012 2:05 pm
Re: Mapping boundary conditions
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
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
-
- Posts: 8
- Joined: Fri Apr 13, 2012 2:05 pm
Re: Mapping boundary conditions
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
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
-
- Posts: 4206
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Mapping boundary conditions
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
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
-
- Posts: 8
- Joined: Fri Apr 13, 2012 2:05 pm
Re: Mapping boundary conditions
Thank you Yvan, I appreciate.
Best
Fabio
Best
Fabio
-
- Posts: 4206
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Mapping boundary conditions
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
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
- Attachments
-
- INTERPOL.tgz
- (11.16 KiB) Downloaded 633 times
-
- Posts: 8
- Joined: Fri Apr 13, 2012 2:05 pm
Re: Mapping boundary conditions
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
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
-
- Posts: 8
- Joined: Fri Apr 13, 2012 2:05 pm
Re: Mapping boundary conditions
Hi Yvan,
Just started going through it...
I suppose a header file's missing (spline.h).
Can you provide it, please?
Thanks. Regards,
fabio
Just started going through it...
I suppose a header file's missing (spline.h).
Can you provide it, please?
Thanks. Regards,
fabio
-
- Posts: 4206
- Joined: Mon Feb 20, 2012 3:25 pm
Re: Mapping boundary conditions
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
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