cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

RKfixed mathcad prime 10 - compressible nozzle

MC_14395780
4-Participant

RKfixed mathcad prime 10 - compressible nozzle

hi wondering if anyone can give me any tips or help? I'm very new to mathcad and using it to create a compressible nozzle with multiphase gas-particle flow. I'm having trouble calculating the velocity of the droplets with an initial velocity of 1. when implementing with rkfixed the vd0 says 'unknown error-ODEtoofewinit'

Any help would be appreciated if theres a better way to solve? thanks 

(g=gas, d=droplet)

MC_14395780_0-1762859008658.png

MC_14395780_1-1762859156766.pngMC_14395780_2-1762859178099.png

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:Werner_E)

I had a second look and now am pretty sure that the magnitude of the summand 

Werner_E_0-1762988405281.png

is causing the error.

Apart from the implicit multiplication mentioned above which I guess should be a "+" these summands are the only difference from the first system which worked.

This summand is a value in the range from 10^2 to 10^23.

I replaced this expression by a simple constant of similar magnitude and rkfixed still would fail:

Werner_E_1-1762988621268.png

But as soon as I set CONST to 504 or something lower, the error goes away and we get a solution.

So I guess that the failure lies within the definition of F.drag(z). Are you sure that the magnitude this function evaluates to should be that large?

 

View solution in original post

13 REPLIES 13
Werner_E
25-Diamond I
(To:MC_14395780)

I have no experience in your field of work but the Problem with your second 'rkfixed' failing is that rho.g is not a scalar but rather a vector with 301 elements - result of the first system of ODEs solved with 'rkfixed'.

Not sure if it makes sense but one way to make the second ODE based on the result of the first ODE system is to create a function for rho.g and use it in the definition of D.dump. Resulting values are rather large as you can see...

Werner_E_0-1762871554165.png

Numbers in the magnitude of 10^15 are in the range of the precision limit of the used IEEE number format.
Higher precision can be achieved by increasing the number of intervals. The function value for z=0.3 is now decreased by the factor 100, but the main behaviour is the very same:

Werner_E_0-1762872638138.png

 

 

MC_14395780
4-Participant
(To:Werner_E)

Thank you so much for the help, I'm still very much a beginner using this so I appreciate it!

I also have the 2 equations above for vg and v_rel which actually change with length but only seem to output as a scalar, although if i put vg(subscript 20) it will give me a value of a vector. Do you know how I would implement this without an error outputting for the equations after it. 

 

MC_14395780_0-1762893903742.png

 

Werner_E
25-Diamond I
(To:MC_14395780)


@MC_14395780 wrote:

Thank you so much for the help, I'm still very much a beginner using this so I appreciate it!

I also have the 2 equations above for vg and v_rel which actually change with length but only seem to output as a scalar, although if i put vg(subscript 20) it will give me a value of a vector. Do you know how I would implement this without an error outputting for the equations after it. 

 

MC_14395780_0-1762893903742.png

 


If you apply a vector index to v.g you should get an error, not a value  or a vector !!??

v.g is a scalar value because T is vector and also it square root is a vector. This vector is multiplied by vector M and Prime has to apply vector scalar multiplication. That's sure not what you intended. If you would like to see the correct vector, you would have to apply the 'vectorize" operator (the arrow over the expression).

Werner_E_0-1762899331228.png

But as you need the value(s) calculated via rkfixed in your second ODE, I would rather suggest that you turn all the results of the first rkfixed into functions of displacement z.

I showed how to do this with rho.g but the result of the second rkfixed was awfully wrong because this second ODE is based also on other result of the first system of ODEs.

Once you turned the rkfixed results into functions you can still use them for plotting:

Werner_E_1-1762899555623.png

But if you use any of these results in defining another quantity, you must be aware that you not defining a variable but rather a function depending on displacement z:

Werner_E_2-1762899700445.png

Doing this with all quantities solving the second ODE works OK and I think we get more meaningful results now.

Werner_E_3-1762900006999.png

You have to fix the rest of the worksheet yourself and when you got it to work I would suggest that you use one of Prime's strenghts and apply units right from the start.

 

Prime 10 worksheet attached

MC_14395780
4-Participant
(To:Werner_E)

Okay that makes a lot more sense thanks! 

Although I still seem to be running into a problem when implementing the same method for another section: 

MC_14395780_0-1762966980776.png

MC_14395780_2-1762967547941.png

 

MC_14395780_1-1762967012370.png

 

 

Werner_E
25-Diamond I
(To:MC_14395780)

Pls attach your modified worksheet here.

MC_14395780
4-Participant
(To:Werner_E)

 
Werner_E
25-Diamond I
(To:MC_14395780)

At first sight I don't see why this second system failed.

I noticed that when we evaluate the vector function D.f using the initial values for x and the interval ends for z the values calculated are rather huge.

Werner_E_0-1762974019546.png

But I am not sure if this could be the cause for Prime moaning about "This function cannot be used here").

 

BTW, when I open Prime with English language set I see the same error message as you show in your screenshot, but with German language set, the error message is quite different:

Werner_E_1-1762974395804.png

Something along the lines: "Unknown error: A call target caused an exception error."

However, I'm not sure if this could be an indication of a software bug. Perhaps someone else could take a look at it as well.

 

EDIT: I just tried opening the sheet in Prime 11.0.0.0 (in case its a bug which already is fixed) but to no avail. Only difference was the with language set to German i also get the same error message as in English -> "Diese Funktion kann hier nicht verwednet werden."

Somehow, I don't believe it's a software bug either. Maybe an error or an unfavorable assumption in the formulation of the ODE system?

Just a shot in the dark, but is there really an implicit multiplication meant here in front of the second x1?

Werner_E_2-1762975415082.png

Changing it to a "+" as in the first system did not help, though.
Maybe there are other errors?

 

 

Werner_E
25-Diamond I
(To:Werner_E)

I had a second look and now am pretty sure that the magnitude of the summand 

Werner_E_0-1762988405281.png

is causing the error.

Apart from the implicit multiplication mentioned above which I guess should be a "+" these summands are the only difference from the first system which worked.

This summand is a value in the range from 10^2 to 10^23.

I replaced this expression by a simple constant of similar magnitude and rkfixed still would fail:

Werner_E_1-1762988621268.png

But as soon as I set CONST to 504 or something lower, the error goes away and we get a solution.

So I guess that the failure lies within the definition of F.drag(z). Are you sure that the magnitude this function evaluates to should be that large?

 

MC_14395780
4-Participant
(To:Werner_E)

Hi, I have now changed my mathcad slightly to be more readable and better to understand. Although my D function still seems to say it cannot be used in RKfixed solution, so i am not able to obtain results/graphs.

 

 I can't spot any problems with my equation definitions, can you spot any input errors?

 

Thanks for all the help!

 

Werner_E
25-Diamond I
(To:MC_14395780)

Sorry, I can't comment on the correctness of your equations as I have no experience in your field of work.

All I can say is that your D function still returns quite huge values and as we have seen before this might (not sure about this) have been the reason for rkfixed failing.

Werner_E_0-1763652399706.png

Maybe  there is someone here with experience in that area who would be able to provide further insight on this matter.

Your definitions of  h(x) and D_Td(z,x) both include an x6 term.  However, your ORIGIN is zero, so the maximum subscript allowed in x is 5.

 

More importantly, you really must include units.  The dimensions of the terms 4f/Dh(z) and 2Fdrag(x)/(gamma.x2^2.rhod.Ad) are different (the former is inverse length, the latter is length per unit time) so you can't add them together, as you have done in the gradient definitions.

 

Alan

LucMeekes
23-Emerald IV
(To:MC_14395780)

I like your definition of the Cd parameter.

It is as though a number of symbols are dancing on the paper.

 

Success!
Luc

MC_14395780
4-Participant
(To:LucMeekes)

Thank you! My fractions don't always show up so my values appear to float about lol

Announcements

Top Tags