Solving a problem several times for a... Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Solving a problem several times for an array of one constant « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Andreas Ferber (madprofessor)
Junior Member
Username: madprofessor

Post Number: 3
Registered: 04-2009
Posted on Wednesday, April 15, 2009 - 07:30 am:   

Hello there
Im trying to get some information about the transfer behavior of my system. Therefor I must evaluate the Flexpde script thousand times but for different Peclet-numbers Pe. I tried to make it easy by using the array function for the Peclet-number but unfortunately it didnīt work.
Another way is to do it manual but this is very time-consuming. Particularly because I must alter other Constants as well.
My question is:
Is there any way to run a FelxPDE script several times automaticaly and thereby changing the value of an Constant in the defenition section(in my case Pe).
Or can I implement an arry of Pecletnumbers so that I get the information in one run?
My script is down below.


Thanks for your help

Andreas





TITLE 'Dynamisches Kompressionsverhalten Kartesich'
COORDINATES cartesian1
VARIABLES
Phii
Phir
Thetai
Thetar

DEFINITIONS
gamma = 1.4
h0=5e-3
h=.001e-3
p0=10e5
T0=273.15+23
Rg=287
rho0=p0/Rg/T0
lambda=0.025
cp=gamma/(gamma-1)*Rg
cv=cp/gamma
a_s=sqrt(T0*Rg*gamma)
D=lambda/rho0/cp
!kappa = a_s*h0/D
kappa=10^5
!hplus = h/h0
hplus=0.1
!Pe = h0^2*omega/D
Pe= pi/2*kappa ! 10^(-1) 10^(0.625) 10^4 pi*kappa
Pr = 0.71
omega=Pe*D/h0^2

EQUATIONS
Thetar: Thetar + hplus*(gamma - 1)*dx(Phir) + (gamma/Pe)*( - dxx(Thetai)) = 0
Thetai: Thetai + hplus*(gamma - 1)*dx(Phii) + (gamma/Pe)*( dxx(Thetar) ) = 0

Phir: gamma*(Pe^2)*Phir - ((kappa^2)/hplus)*dx(Thetar) + (kappa^2)*(dxx(Phir)) + (4/3)*gamma*Pr*Pe*(-dxx(Phii)) = 0
Phii: gamma*(Pe^2)*Phii - ((kappa^2)/hplus)*dx(Thetai) + (kappa^2)*(dxx(Phii)) + (4/3)*gamma*Pr*Pe*( dxx(Phir)) = 0

BOUNDARIES { The domain definition }
REGION 1 { For each material region }
START(0) Point Value(Phir) = 0 Point Value(Phii) = 0 Point natural(Thetar) = 0 Point natural(Thetai) = 0
LINE TO (1) Point Value(Phir) = 1 Point Value(Phii) = 0 Point value(Thetar) = 0 Point value(Thetai) = 0
! TIME 0 TO 1 { if time dependent }
MONITORS { show progress }
PLOTS { save result displays }
elevation( ABS(sqrt(Phir^2+Phii^2)))from(0)to(1)RANGE( 0,1 )
elevation( ABS(sqrt(Thetar^2+Thetai^2)/hplus))from(0)to(1) RANGE( 0,1 )
elevation( ABS(sqrt( dx(Phir)^2 + dx(Phii)^2 )) ) from(0)to(1)RANGE( 0,2 )
elevation( ABS(sqrt(Thetar^2+Thetai^2)/hplus +{-} sqrt( dx(Phir)^2+ dx(Phii)^2 ) ))from(0)to(1)RANGE( 0,2 )
END
Top of pagePrevious messageNext messageBottom of page Link to this message

Jared Barber (jared_barber)
Member
Username: jared_barber

Post Number: 42
Registered: 01-2007
Posted on Wednesday, April 15, 2009 - 12:57 pm:   

Hello,

You may be looking for the "staged" function. You should look it up. Your code line starting Pe:

Pe= pi/2*kappa ! 10^(-1) 10^(0.625) 10^4 pi*kappa

would become

Pe= staged(value1,value2,value3).

You'll notice it will start saving files (if you are exporting files) like:
filename_#.p01
where # is the stage number corresponding to the Pe value being used during the solve used to create that file.

Important "select" solution controls to look at are "autostage" and "reinitialize".

For your code then, e.g.:

TITLE 'Dynamisches Kompressionsverhalten Kartesich'
SELECT
autostage = "off" {pauses in between each "stage" for you to look at stuff if you want...not necessary, it is "on" by default and doesn't pause between each stage}
reinitialize = "on" {doesn't use any initial guesses or initial meshes from the previous time step}

COORDINATES cartesian1
VARIABLES
Phii
Phir
Thetai
Thetar

DEFINITIONS
gamma = 1.4
h0=5e-3
h=.001e-3
p0=10e5
T0=273.15+23
Rg=287
rho0=p0/Rg/T0
lambda=0.025
cp=gamma/(gamma-1)*Rg
cv=cp/gamma
a_s=sqrt(T0*Rg*gamma)
D=lambda/rho0/cp
!kappa = a_s*h0/D
kappa=10^5
!hplus = h/h0
hplus=0.1
!Pe = h0^2*omega/D
Pe= pi/2*kappa ! 10^(-1) 10^(0.625) 10^4 pi*kappa
Pr = 0.71
omega=Pe*D/h0^2

EQUATIONS
Thetar: Thetar + hplus*(gamma - 1)*dx(Phir) + (gamma/Pe)*( - dxx(Thetai)) = 0
Thetai: Thetai + hplus*(gamma - 1)*dx(Phii) + (gamma/Pe)*( dxx(Thetar) ) = 0

Phir: gamma*(Pe^2)*Phir - ((kappa^2)/hplus)*dx(Thetar) + (kappa^2)*(dxx(Phir)) + (4/3)*gamma*Pr*Pe*(-dxx(Phii)) = 0
Phii: gamma*(Pe^2)*Phii - ((kappa^2)/hplus)*dx(Thetai) + (kappa^2)*(dxx(Phii)) + (4/3)*gamma*Pr*Pe*( dxx(Phir)) = 0

BOUNDARIES { The domain definition }
REGION 1 { For each material region }
START(0) Point Value(Phir) = 0 Point Value(Phii) = 0 Point natural(Thetar) = 0 Point natural(Thetai) = 0
LINE TO (1) Point Value(Phir) = 1 Point Value(Phii) = 0 Point value(Thetar) = 0 Point value(Thetai) = 0
! TIME 0 TO 1 { if time dependent }
MONITORS { show progress }
PLOTS { save result displays }
elevation( ABS(sqrt(Phir^2+Phii^2)))from(0)to(1)RANGE( 0,1 )
elevation( ABS(sqrt(Thetar^2+Thetai^2)/hplus))from(0)to(1) RANGE( 0,1 )
elevation( ABS(sqrt( dx(Phir)^2 + dx(Phii)^2 )) ) from(0)to(1)RANGE( 0,2 )
elevation( ABS(sqrt(Thetar^2+Thetai^2)/hplus +{-} sqrt( dx(Phir)^2+ dx(Phii)^2 ) ))from(0)to(1)RANGE( 0,2 )
END

I should say to make sure to check the staged answers with unstaged answers as "staged" in the past has given me a couple of problems in that the answers it gives me for, say, value3 doesn't always correspond to the answer I got if I just plugged in Pe = value3 with no staging. I'll leave it at that for now and good luck.

Jared
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 1245
Registered: 06-2003
Posted on Wednesday, April 15, 2009 - 01:15 pm:   

See Help->User Guide->Some Common Variations->Parameter Studies Using STAGES

See also "STAGED" in the Help Index.
Top of pagePrevious messageNext messageBottom of page Link to this message

Andreas Ferber (madprofessor)
Member
Username: madprofessor

Post Number: 4
Registered: 04-2009
Posted on Wednesday, April 15, 2009 - 03:38 pm:   

Thanks a lot!

owing to your suport I think now I have finished my first work with FlexPDE. Its a very nice Programm.

kind regards

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration