|
[Sponsors] |
Run each simulation based on initial condition of previous run results |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 9, 2015, 01:55 |
Run each simulation based on initial condition of previous run results
|
#1 |
Member
Hamidreza Bijanyar
Join Date: Jun 2015
Posts: 40
Rep Power: 11 |
Hello.
I face a new problem ! I have a simulation that contain a fixed geometry and mesh and several pressure boundary condition. I reed other post in this forum to automatically change pressure and run several time. I did this: I made a cfx analyze system and defined parameter for pressure boundary condition. then i duplicate it and change the parameters and continue to duplicating and changing parameters until all pressure finished. Updating setup cells and updating solution cell. Runs send to RSM and execute 1 by 1 automatically. The problem in that i want each run based on initial condition of previous run result. But because cfx , cfx 1 , cfx 2 , cfx 3 , cfx 4 , ..... have different working directory this not happen. How can i do this ??? And is my way for doing some repetitive job for several pressure correct ? |
|
September 9, 2015, 04:23 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
This is easy to do using the command line to start the jobs. Just define the initial condition as the result file from the previous run.
I am no expert on running this stuff under RSM so I cannot say for how it is done that way. |
|
September 9, 2015, 04:48 |
|
#3 |
Member
Hamidreza Bijanyar
Join Date: Jun 2015
Posts: 40
Rep Power: 11 |
Yes, I know i can set initial condition on "Update from current solution data if possible" .
But problem is that this option use current solution data in that case. but in my problem there is cfx , cfx1 , cfx2 , ... how to use last result of cfx , in initial condition of cfx 1 ?? And about command line , i know nothing !!! How can i do this using command ? and where is it ?? in WorkBench ? in cfx setup ?? |
|
September 9, 2015, 07:08 |
|
#4 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
I always prefer the command line options when doing anything like what you propose. That way you can directly specify what is input to what.
Have a look in the documentation under "Starting CFX from the Command Line". |
|
September 15, 2015, 15:16 |
|
#5 |
Member
Hamidreza Bijanyar
Join Date: Jun 2015
Posts: 40
Rep Power: 11 |
Ok,
I did it using command line: Code:
# encoding: utf-8 # Release 16.1 SetScriptVersion(Version="16.1.91") i = 1 while (i < 3): j=1 while (j < 10): designPoint1 = Parameters.GetDesignPoint(Name="0") p1 = Parameters.GetParameter(Name="P1") p2 = Parameters.GetParameter(Name="P7") p3 = Parameters.GetParameter(Name="P8") p1v = designPoint1.GetParameterValue(Parameter=p1) p2v = designPoint1.GetParameterValue(Parameter=p2) p3v = designPoint1.GetParameterValue(Parameter=p3) dp1 = Quantity ("10 [degree]") dp2 = Quantity ("10000 [Pa]") dp3 = Quantity ("100000 [Pa]") p2v = p2v + dp2 p93v=p2v p2v = str ( p2v ) designPoint1.SetParameterExpression( Parameter=p2, Expression=p2v) system1 = GetSystem(Name="CFX") setup = system1.GetComponent(Name="Setup") setup.Update(AllDependencies=True) solution = system1.GetComponent(Name="Solution") solution.Update(AllDependencies=True) results = system1.GetComponent(Name="Results") results.Update(AllDependencies=True) solution = system1.GetContainer(ComponentName="Solution") solution.ClearOldSolutionData(KeepReferenced=False) p4 = Parameters.GetParameter(Name="P4") p5 = Parameters.GetParameter(Name="P5") p6 = Parameters.GetParameter(Name="P9") p7 = Parameters.GetParameter(Name="P10") p8 = Parameters.GetParameter(Name="P11") p9 = Parameters.GetParameter(Name="P12") p10 = Parameters.GetParameter(Name="P13") p11 = Parameters.GetParameter(Name="P94") p4v = designPoint1.GetParameterValue(Parameter=p4) p5v = designPoint1.GetParameterValue(Parameter=p5) p6v = designPoint1.GetParameterValue(Parameter=p6) p7v = designPoint1.GetParameterValue(Parameter=p7) p8v = designPoint1.GetParameterValue(Parameter=p8) p9v = designPoint1.GetParameterValue(Parameter=p9) p10v = designPoint1.GetParameterValue(Parameter=p10) p11v = designPoint1.GetParameterValue(Parameter=p11) f= open ("result.txt","a") f.write("%s %s %s %s %s %s %s %s %s %s %s \n \n" %(round(p1v.Value),p93v.Value,p3v.Value,p4v.Value,p5v.Value,p6v.Value,p7v.Value,p8v.Value,p9v.Value,p10v.Value,p11v.Value)) f.close() Save( FilePath="E:/2 Phase - all degree - 6 inch/%s [degree]---(%s).wbpj" %(round(p1v.Value),p2v), Overwrite=True) j=j+1 p1v = p1v + dp1 p1v=p1v.ConvertUnit("degree") p1v= str (p1v) designPoint1.SetParameterExpression( Parameter=p1, Expression=p1v) designPoint1.SetParameterExpression( Parameter=p2, Expression="100000") i=i+1 exit |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
transsonic nozzle with rhoSimpleFoam | Unseen | OpenFOAM Running, Solving & CFD | 8 | July 1, 2022 07:54 |
Wrong fluctuation of pressure in transient simulation | caitao | OpenFOAM Running, Solving & CFD | 2 | March 5, 2015 22:33 |
Simulation seems to converge but crashes suddenly | xxxx | OpenFOAM | 16 | September 12, 2014 09:07 |
should Courant number always be kept below 1? | wc34071209 | OpenFOAM Running, Solving & CFD | 16 | March 9, 2014 20:31 |
Error while running rhoPisoFoam.. | nileshjrane | OpenFOAM Running, Solving & CFD | 8 | August 26, 2010 13:50 |