|
[Sponsors] |
How to adjust the velocity field during the CFX solver running? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 16, 2019, 09:55 |
How to adjust the velocity field during the CFX solver running?
|
#1 |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Hello everyone.
Recently I am simulating a case discribed as follows, (of course, I did some simplification) I got a cylinder pipe here, it has an inlet, an outlet and a wall. The temperature of the wall and the temperature of the inlet are constants. And I am going to solve the temperature field of the fluid inside the pipe.(we got only fluid domain here.) while solving this problem, I am not going to solve the momentum equation of x,y,z direction, I disable the momentum equation solving by adjust the "expert parameter". Because I write the analytic solution to the initial file by CEL. So the CFX just solve the energy equation with the given velocity field. OK, now, the problem is coming. This is a trasient case, during the CFX solver running, I wanna adjust the velocity field according to the volume average temperature of the fluid. For example, I want to increase the velocity and write another velocity field instead of the initial one when the tenperature reachs a certain point. how can I realize this? Thank you all and best regards. |
|
January 16, 2019, 18:15 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144 |
You could stop and restart, writing a new velocity field as initial condition on the restart. Take all other variables from the previous simulation as an initial condition.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
January 16, 2019, 18:48 |
|
#3 |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
This approach is conducive to a lot of subtle problems that will be difficult to diagnose later on.
Using a user-defined velocity field w/o solving the momentum+continuity equation is extremely dangerous since you MUST be certain it satisfy the continuity equation in discrete form for the given mesh; otherwise, there will be numerical sinks/sources due to the discretization coming from the discretization of the advection term in the energy equation. Numerical sinks/sources can produce unpredictable temperature variations very difficult to pinpoint. In addition, freezing the solution of the continuity+momentum equation in a transient problem can only be done for a case with constant properties and w/o temperature dependencies. Otherwise, the problem will come from a different angle. What is your primary goal here? |
|
January 16, 2019, 19:34 |
|
#4 | |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Quote:
The solution you mentioned is realizable, But the problem is that, there is a lot of swicthes(velocity field changing) should be done during the whole trasient case, I can not stop the solve every time the velocity field needs to be change. Do you have a better way to deal this problem automatically? |
||
January 16, 2019, 19:41 |
|
#5 | |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Quote:
The rubust of the program is robust, I already did some test of the solution with some steady state simulation, I compared the solution of CFX FLUENT and my oven code. the result is coincident. And for a triansient case. The velocity switch only cost 1 or 2 seconds. but the whole case lasts for half an hour, so I do not care about the numercial error during the swithing time. |
||
January 16, 2019, 20:31 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144 |
It is simple to implement a stop/restart. It can be scripted so it all happens automatically, and it very simple to do. I would not dismiss it.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
January 16, 2019, 21:13 |
|
#7 |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Thanks again. Could you please tell me more about how to do this by compile a script. It my take times to tell the whole story. But Could you please give some brief guidance. I have been trapped here for a long time. Thank you for your time,Sir.
|
|
January 16, 2019, 23:01 |
|
#8 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144 |
Look up running CFX from the command line. Your script will be something like:
cfx5solve -def DefinitionFile1.def cfx5solve -def DefinitionFile2.def -initial DefinitionFile1_001.res cfx5solve -def DefinitionFile3.def -initial DefinitionFile2_001.res
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
January 21, 2019, 10:30 |
|
#9 |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
I am still confused about how to do it. but thank you very much Sir.
|
|
January 22, 2019, 05:12 |
|
#10 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
||
January 22, 2019, 05:40 |
|
#11 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
In CFX-Pre (Outside Workbench), you should make a lot definition files with several profiles.
Then you should write a script (textfile) with the following content: cfx5solve -def profile1.def cfx5solve -def profile2.def cfx5solve -def profile3.def cfx5solve -def profile4.def This results in 4 result files with 4 different profiles. If you want to use an initial guess at the start of the calculation, do what Glenn suggested and add an initial guess: cfx5solve -def profile4.def -ini profile3_001.res In principle it is not necessary to write multiple def-files. You can also just modify the settings outside CFX-Pre using a .ccl-file (just copy the contents from a output file) and use this in the script file (see link given before). So, if you can manage to write your profile in simple text, you can get away with: cfx5solve -def profile1.def -ccl profile4.ccl Good Luck, Gert-Jan |
|
January 22, 2019, 09:29 |
|
#12 | |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Quote:
And an other thing is, I only want to change the velocity field of the fluid domain, and remain the temperature field . If the script file changs .def file during the running. Will the solver overwrite the temprature field with a initial value? Thanks and regards Tang Lei |
||
January 22, 2019, 10:08 |
|
#13 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
Follow the link I send before. Alternatively take this one:
Workbench And HPC Cluster So, learn to use CFX outside Workbench. Open the CFX-launcher and open a Command line the directory where your def-files are. This works like the good-old MS DOS. A script sound very cryptic. It is not. It is nothing more than plain text. So: - open a text editor (notepad) - copy the command lines with cfx5solve (see query here above) into the text. - Save the text as run.bat (or a.bat, or whatsoever.bat, or itdoesnotmatter.bat) in the directory where your def-files are. Then in the command line type 'run' (or a, or whatsoever, or itdoesnotmatter) and off you go. Now your calculation runs in the background. If you want to monitor it, open the solver manager from the Launcher and select "monitor run in Progress". |
|
January 22, 2019, 10:14 |
|
#14 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
Regarding the initialisation......
When changing the profile, do you run from a def file only or do you use a previous results-file as initial guess? |
|
January 22, 2019, 10:31 |
|
#15 | |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Quote:
I will try, and could you please give an answer about the other question I mentioned. Will CFX change all the physical field when I load another .def file? thanks again. |
||
January 22, 2019, 10:47 |
|
#16 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
I already did, see thread #14.
|
|
January 22, 2019, 11:21 |
|
#17 |
New Member
tang lei
Join Date: Jan 2019
Location: Shenzhen China
Posts: 15
Rep Power: 7 |
Actually I just want to adjust the velocity field during the running.
First, the momentum equation has been disabled. The solver only use the given velocity to deal with the energy equation. After 10 time steps, I want to adjust the velocity field (for example,set u=0,v=0,w=0), Such as pump on and pump off. So what I want is step1:I give a initial field.(pumo on) step2:End the solution automatically when the pump should be shut down step3:Change the velocity field(velocity=0) but remain the Temperature field, then continue calculating. |
|
January 22, 2019, 12:42 |
|
#18 |
Senior Member
Gert-Jan
Join Date: Oct 2012
Location: Europe
Posts: 1,928
Rep Power: 28 |
Like Glen already told, it is not possible to do this during the running, of a single run.
But is possible in a batch of multiple sequential runs, like I explained. Step 1: just do what you always do. Step 2: This run stops if the end time is reached (or you stop it manually beforehand) Step 3: Start with a def file and take the results file as initial guess. In the def file you should set the Initial velocity files to "Value" (not "Automatic", or "Automatic with value"), and keep "solve fluids =f". Keep temperature to automatic to pick up the initial guess from the results file. |
|
Tags |
i/o solver |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Unsteady field advected by steady velocity field | t.oliveira | OpenFOAM Running, Solving & CFD | 2 | December 28, 2015 14:42 |
new workstation for running 5 Million size mesh on CFX with rigid body solver | aks | Hardware | 5 | August 20, 2013 08:12 |
Inlet Velocity in CFX | aeroman | CFX | 12 | August 6, 2009 19:42 |
Neumann pressure BC and velocity field | Antech | Main CFD Forum | 0 | April 25, 2006 03:15 |
Predefined velocity field implementation CFX 5.7 | Matjaz | CFX | 3 | September 13, 2004 08:26 |