CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Equation Problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 26, 2007, 09:36
Default Equation Problem
  #1
Velan
Guest
 
Posts: n/a
Hi I am having the data which containing x,y,z coordinates for different i,j,k. My problem is i want to find the distance between two points and find the total distance along one direction(i or j or z direction).

for example i am adding all the values of "i" and store it in "a" a=0 do i=1,50 a=a+i enddo Now "a" will have the total value of all "i" Like above example i written a equation for calculating total distance.

In my case V1=x,V2=y,V3=z {distance}=SQRT((V1(i+1,j,k)-V1(i,j,k))**2+(V2(i+1,j,k)-V2(i,j,k))**2+V3(i+1,j,k)-V3(i,j,k))**2)

But it not working well. Can you help me to sort it out ?

Velan
  Reply With Quote

Old   September 26, 2007, 16:30
Default Re: Equation Problem
  #2
Ananda Himansu
Guest
 
Posts: n/a
I take it you are approximating arc length in i, j or k directions. Your expression lacks a left parenthesis before the V3(i+1,j,k) term, but other than that, everything looks okay. Why do you say it is not working well?
  Reply With Quote

Old   September 27, 2007, 07:54
Default Re: Equation Problem
  #3
Velan
Guest
 
Posts: n/a
can you please check the below link(Zoom it for clear vision)

http://homepages.iitb.ac.in/~vadivel...nline-skel.jpg Above figure shows my geomety, where i and k are constants, and j varying from "a" to "e".

http://homepages.iitb.ac.in/~vadivel...ine-z-temp.jpg Above figure shows the plot between z-axis VS temperature.

Then i added the equation

{distance}=SQRT((V1(i,j+1,k)-V1(i,j,k))**2+(V2(i,j+1,k)-V2(i,j,k))**2+(V3(i,j+1,k)-V3(i,j,k))**2)

http://homepages.iitb.ac.in/~vadivel...tance-temp.jpg

Above figure shows the plot between distance VS temperature. In this figure line should come almost straight. But here its coming strange. I not able to figure it out where the problem is ?

Thanks Velan

  Reply With Quote

Old   September 27, 2007, 12:32
Default Re: Equation Problem
  #4
Ananda Himansu
Guest
 
Posts: n/a
Sorry, but I am unable to view those jpg files. My browser reports some "Invalid Gateway" error. Could be some firewall/security related issue. Perhaps someone else would be able to view your files and help.
  Reply With Quote

Old   September 27, 2007, 13:36
Default Re: Equation Problem
  #5
Velan
Guest
 
Posts: n/a
Hi Himansu, Due to some technical reason, today our homepage server was down. It will be bootup soon. I will intimate you after boot or i will try someother way(can you give me ur mail id. I will send that picture)

Thanks Velan
  Reply With Quote

Old   September 27, 2007, 17:10
Default Re: Equation Problem
  #6
Ananda Himansu
Guest
 
Posts: n/a
I will try your links again tomorrow. I prefer not to use e-mail, thanks.
  Reply With Quote

Old   September 27, 2007, 22:25
Default Re: Equation Problem
  #7
Velan
Guest
 
Posts: n/a
Hi Its working now. Can you please check it !
  Reply With Quote

Old   September 27, 2007, 22:26
Default Re: Equation Problem
  #8
Velan
Guest
 
Posts: n/a
Hi I am sorry still its not working
  Reply With Quote

Old   October 1, 2007, 11:39
Default Re: Equation Problem
  #9
Ananda Himansu
Guest
 
Posts: n/a
okay, I can see the jpg files now, the server appears to be up now. You are probably just missing the "accumulator" variable 'a' that you mentioned in your first post. Your equation should be

distance = 0

do j = 1, jmax-1

dssq = (x(j+1)-x(j))**2 + (y(j+1)-y(j))**2 + (z(j+1)-z(j))**2

distance = distance + SQRT(dssq)

end do

From your second jpg plot, the distance should vary from 0 to at least 0.3, whereas your final jpg plot (of T2 vs distance) shows T2 in the right range, but distance ranging only from 0 to about 0.015 (which is more the order of magnitude of the increments in arc length than their sum), and T2 appears a multivalued function of "distance", which leads to my diagnosis of probable cause.

  Reply With Quote

Old   October 1, 2007, 21:32
Default Re: Equation Problem
  #10
Velan
Guest
 
Posts: n/a
Yes, you are correct. But how can i write equation for that formula in tecplot. I though earlier about the accumulator. But i dont know how to write it in tecplot.
  Reply With Quote

Old   October 2, 2007, 17:14
Default Re: Equation Problem
  #11
Ananda Himansu
Guest
 
Posts: n/a
Quite difficult to do in Tecplot. If it can be done at all in Tecplot, it would be using a macro with a loop and loop-dependent equation LHS range specification and equation RHS loop-dependent value-blanking. Would also be computationally highly inefficient. It is intimidating even thinking about it. Why not write the data out to a file, add a new distance variable using simple Fortran loops, and read it back in to Tecplot for display?
  Reply With Quote

Old   October 2, 2007, 17:20
Default Re: Equation Problem
  #12
Ananda Himansu
Guest
 
Posts: n/a
Alternatively, Tecplot will allow you to "Extract Data" along a polyline. You could extract along a polyline that approximates the line you have in mind, and specify that Tecplot include a "distance" variable when extracting the data into a line zone. This option pops up in a dialog box when you extract data.
  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
Problem with Poisson equation with Neumann BC Jeff67 Main CFD Forum 0 March 27, 2011 11:23
Solve single but higher order equation by OF 1.6 suffering Problem alundilong OpenFOAM Programming & Development 0 December 23, 2010 13:53
Assistance with one-way wave equation Frank Main CFD Forum 5 March 14, 2007 10:56
Problem with momentum equation Francisco Main CFD Forum 4 August 5, 2004 20:04
Energy equation convergence problem Reza Main CFD Forum 0 August 27, 2003 13:09


All times are GMT -4. The time now is 23:27.