Author |
Message |
sue New member Username: sue
Post Number: 1 Registered: 06-2010
| Posted on Thursday, June 24, 2010 - 11:50 am: | |
Hello. I am novice attempting to navigate FlexPDE. The attached file shows the fluid flux program (essentially just the LaPlace equation with an added third dimension) in which I am having a hard time figuring out how to properly compute an integral. Specifically, I would like to solve the equation: norm_flux = integral [with respect to ro from ro=-1 to ro=1] of dY(theta)_evaluated at Y=1. Ultimately, I would like to generate a 2D graph of norm_flux vs. K and be able to output that data in table format. Here's my attempt (the full file is attached). The integral seems to be 0 and independent of K. Any insight as to what I'm doing wrong? COORDINATES CARTESIAN3('ro','Y','K') DEFINITIONS norm_flux = AREA_INTEGRAL(dY(theta), 'line') EQUATIONS theta: dro(dro(theta)) + (1/K)*dY(dY(theta))=0 BOUNDARIES Region 'line' Start 'outer1' (-1,0) line to (1,0) |
rgnelson Moderator Username: rgnelson
Post Number: 1379 Registered: 06-2003
| Posted on Thursday, June 24, 2010 - 02:26 pm: | |
Looks to me like you don't want K to be a coordinate, but a STAGED parameter. Or perhaps a pseudo-time problem with K=t and SELECT FIXDT, giving the desired timestep in a TIME clause. Then define a named FEATURE from (-1,1) to (1,1) and form a SURF_INTEGRAL. You can plot this result as a HISTORY() VS K and export it to a text file.
|
sue New member Username: sue
Post Number: 2 Registered: 06-2010
| Posted on Thursday, June 24, 2010 - 03:18 pm: | |
Thanks Robert. Great advice. I think I'm on the right track now. |
sue Junior Member Username: sue
Post Number: 3 Registered: 06-2010
| Posted on Friday, June 25, 2010 - 10:35 am: | |
I'm getting closer. Now I can plot norm_flux vs. K. However, the plot shows a strange discontunity and the values are without physical meaning (norm_flux should increase with increasing K and vary between 0 and 1). I don't know if you can help out with this question or not. Any insight? I can't find any errors in the equations or input values. |
sue Member Username: sue
Post Number: 4 Registered: 06-2010
| Posted on Friday, June 25, 2010 - 11:36 am: | |
And one more thing... I would like to export the data as two columns, one with K values (the STAGED parameter) and one with norm_flux values. Can you correct my syntax below? HISTORY (norm_flux) VS K EXPORT format "#1#b#2" file="Flux_vs_K.txt"
|
hof Member Username: hof
Post Number: 6 Registered: 06-2010
| Posted on Friday, June 25, 2010 - 12:36 pm: | |
1) You can specify a format for text output. See "format" in the Help Index, and the example problems referenced at the end of that article. The format facility will output one line per spatial point, with values of as many quantities as you specify in the output command. i use history (variable) export format '#T#R,#I' file 'filename' to get two columns of data with a comma in between |
sue Member Username: sue
Post Number: 5 Registered: 06-2010
| Posted on Friday, June 25, 2010 - 12:52 pm: | |
Thank you. That worked. |
sue Member Username: sue
Post Number: 6 Registered: 06-2010
| Posted on Friday, June 25, 2010 - 02:52 pm: | |
I'm still having problems with the integration in the attached file above. Changing the mesh spacing seems to change the answer a lot. Suggestions? |