CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

INTERPOLATEXY format entry for the Xold and Yold

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2007, 10:18
Default Hi OF community, I'm trying t
  #21
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
Hi OF community,
I'm trying to interpolate data from experiments to a circular inlet. data are avaible on a radius so, I need to interpolate them on one radius and then put them on all the area.
my file look like this:

r_old [m] ur[m.s^-1] uz[m.s^-1] uteta[m.s^-1]

... ... ... ...



first 1 cut this file in 3 (i=1->3) files ui to get:

r_old[m] ui[m.s^-1]

... ...




to keep the same notation, xNew =xmesh, xOld=xexperiments
then, this is the main idea of my "code":

//definition of xnew which correspond to r_grid

(same definition as anne dejoan)
scalarField rnew=sqrt(pow(ybc,2)+pow(zbc.2));

//reading experimental data then creation of the graphs
// i velocity[m s^-1]
IFstream myui("Ui"); //Ui in the current directory
graph expe
(
"ui"
"rold" //radius from experiments in Ui files
"i_velocity"
myui
)

//interpolation procedure for all parameters
scalarField Ui=interpolateXY
(
rnew,
exp.rold(),
exp.ui()
)

then, I do the same for ur, uteta,uz to get at the end :
Uinlet=vector(Ur, Uteta, Uz);}
I used the upper piece of code from anne to start and then I "tried" to use the Hrvoje explications but, I don't really get where I can compile the code to check if it works correctly or not ?
Do you see any mistake(s), I'm not a real C++ programer ?
With this, I (should) get the interpolation only on one radius, Have you got an idea to extend it to all radius ?
using ux=fct(ur,uteta) and uy=fct(ur,uteta) ...I can get ux and uy but then ...
Thanks for helping...
cedric_duprat is offline   Reply With Quote

Old   August 21, 2007, 08:40
Default Hi all, sorry for this evid
  #22
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
Hi all,

sorry for this evident C++ question but, I've some problem with this.

I tried tips which are in upper messages to get an inlet from experimental data :

# include "interpolateXY.H"
# include "graph.H"

IFstream fichierProfil(runTime.constant()/"U-25.dat");
Info << "Reading file U-25.dat " << endl;

graph expeGraph
(
"expe_profil",
"r",
"Uaxial",
fichierProfil
);

scalarField Uxexpe = interpolateXY
(
rbc2,
expeGraph.x(),
expeGraph.y()
);
where rbc2 is well defined.

this are the mistake :
error: 'IFstream' was not declared in this scope
error: expected `;' before 'fichierProfil'
error: 'graph' was not declared in this scope
error: expected `;' before 'expeGraph'
error: 'expeGraph' was not declared in this scope
error: 'interpolateXY' was not declared in this scope

Maybe I forgot to declare something but, interpolate.H and Graph.H are already declared ...

I need some help in this regard, even if it is quite evident for most of you.

Regards,

Cedric
cedric_duprat is offline   Reply With Quote

Old   August 22, 2007, 03:28
Default Hi all, I won't be long, I
  #23
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
Hi all,

I won't be long, I have fixed the problem .... shame on me :-)

just add #include "IFstream.H" and #include "OFstream.H" .... and It compile, so # include "interpolateXY.H" and # include "graph.H" are not enought ...

that's all, sorry for such stupid question

Regards,

Cedric
cedric_duprat is offline   Reply With Quote

Old   August 28, 2007, 05:26
Default Hello, It's again me. my int
  #24
Senior Member
 
Cedric DUPRAT
Join Date: Mar 2009
Location: Nantes, France
Posts: 195
Rep Power: 17
cedric_duprat is on a distinguished road
Hello,
It's again me.
my interpolation is running well, profiles are the same ...

However I still have a question more, I would like to use the interpolation to get an inlet profile as anne dejoan in the upper message:

I understand how to do with a fixed direction (like inlet normal direction) but, I've got a pipe and one of my interpolate field is orthoradial velocity so, the direction is changing for each "teta" angle.

this is my code where I used the interpolate fields (Uxexpe and Utetaexpe) to write my inlet velocity wUe:
forAll(wUe, faceI)
{
const vector& c = faceCentrese[patchIDe];
vector OM = c - center;
vector ur = OM - (OM & ux)*ux;
scalar rad = mag(ur);
ur /= rad + VSMALL;
vector uteta = ux^ur;
scalar rad2 = mag(uteta);
uteta /= rad2 + VSMALL;
wUe = Uxexpe*ux + Utetaexpe*uteta;
}
where patchIDe is my inlet.

so my question is can I do something like that because, Utetaexpe is define for all my patch
so I'm afraid that the result field (wUe) won't be the right one ...
I'm afraid to get only the last loop with just one uteta ...

Well, I'm not sure to be clear but, ... can someone give his/her point of vue on that and if something is wrong give me some hint ...

Thank you,

Cedric
cedric_duprat is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FluxRequired entry msrinath80 OpenFOAM Running, Solving & CFD 4 May 1, 2015 11:30
Entry point lucian OpenFOAM Pre-Processing 1 March 13, 2007 04:04
table entry carno Siemens 1 May 28, 2005 11:29
entry, dump losses Babu FLUENT 0 February 25, 2005 02:59


All times are GMT -4. The time now is 09:47.