-
-
October 11, 2021 at 5:08 amMadhu_KalyanSubscriber
If you can do it then kindly guide me through the steps to do it. I learnt from some other forums that it can be done using a code but it wasn't clear on how it can be done. If you know the answer then please share it since I have to do close to 100 simulations on a single geometry and it would be of great help if I could get to parametrise the mass flow rate
October 11, 2021 at 1:57 pmRKAnsys EmployeeHello,
Please refer to this section in the user's guide : https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v212/en/flu_ug/flu_ug_uns_sec_periodic_flow_inputs.html
October 12, 2021 at 3:33 amMadhu_KalyanSubscriberThank you RK for your response but sadly I don't have an account to read what's given there since I use the student version. If there is any other way can you please guide me?
October 13, 2021 at 7:35 amMadhu_KalyanSubscriberHello RK. I have gone through the documentation and it specifies nowhere that I can parameterize the mass flow rate. Kindly tell me if it is possible or not at least, so that I don't have to waste my time going through everything.
October 13, 2021 at 8:54 amAmine Ben Hadj AliAnsys EmployeeYou can do it in the way: you create an Expression based input parameter. When it comes to providing the mass flow rate you tell Fluent to compute the expression there and pick-up the value. Other ways will use Scheme code.
October 13, 2021 at 9:49 amMadhu_KalyanSubscriberThank you DrAmine. I tried to use the scheme code but I couldn't understand what was going on. Can you please elaborate if it isn't too much trouble. Also in the periodic dialogue box there isn't an option to enter an expression
October 13, 2021 at 9:57 amAmine Ben Hadj AliAnsys EmployeeYou create the expression outside but use the value in the field via Calculation Activity.
October 13, 2021 at 10:12 amMadhu_KalyanSubscriberOk.thanks for the help. I will let you know after I try it
October 15, 2021 at 2:56 pmAmine Ben Hadj AliAnsys EmployeeWelcome!
October 18, 2021 at 5:45 amMadhu_KalyanSubscriberDear DrAmine I have tried the Scheme procedure as given below
(lambda (value )
(ti-menu-load-string (format #f "/solve/set/under-relaxation/pressure ~g" value)))
Now my problem is that, how can I assign the mass flow rate to this variable lambda? Kindly help me
October 18, 2021 at 6:52 amAmine Ben Hadj AliAnsys EmployeeYou found an example for pressure under relaxation and you to apply it directly for your massflow. You cannot use that construct as it is intended as scheme based input parameter but the massflow under periodic does not allow that (as far as I remember)
1/Create one expression and make it your input parameter
2/per TUI: find the whole command to setup the massflow
3/once Fluent ask you for value you compute the return value of the expression
Steps 1 to 3 can be coded as calculation activity.
October 18, 2021 at 9:02 amMadhu_KalyanSubscriberI have tried the above steps. In the parameter box I have created a variable with the name mdot with the value 0. then I tried the following in the TUI. I tried to write mdot when fluent asked me to enter the mass flow rate but it just returned an error
/define/periodic-conditions> massflow-rate-specification
Enter Mass Flow Rate(Kg/s) [0.005] mdot
Error: eval: unbound variable
Error Object: mdot
Invalid real.
October 18, 2021 at 9:22 amAmine Ben Hadj AliAnsys Employeeyou need to evaluate mdot and to write mdot
October 18, 2021 at 9:22 amAmine Ben Hadj AliAnsys EmployeeExample: (pick-a-real "/define/named-expression/compute mdot" 3) assuming mdot is the name of the Expression! Does it all make a sense?
October 18, 2021 at 9:24 amMadhu_KalyanSubscriberI apologize for bothering you so much. But m dot is a number I want to give directly as an input to the periodic boundary. How do you propose I write an expression for it and then evaluate it? I am very much confused by this
October 18, 2021 at 9:32 amMadhu_KalyanSubscriberI got it upto this point.
/define/named-expressions> compute
available-list: (mdot)
select-to-edit/delete ["mdot"] mdot
--------------------------
Expression Value Unit
--------------------------
mdot 0 []
--------------------------
What can I do after this?
October 18, 2021 at 9:48 amAmine Ben Hadj AliAnsys EmployeeCreate an Fluent Expression for mdot. 5.1. Introduction to Expressions (ansys.com) (In Fluent "type F1", a browser opens, add a new window and click then on the link)
October 18, 2021 at 9:50 amMadhu_KalyanSubscriberOk. I will go through it and let you know after I tried it out. Thank you so much
October 18, 2021 at 9:58 amAmine Ben Hadj AliAnsys EmployeeWelcome
October 19, 2021 at 6:38 amOctober 19, 2021 at 11:17 amAmine Ben Hadj AliAnsys EmployeeI think you kindly ask me to assume your task :)
October 19, 2021 at 11:20 amAmine Ben Hadj AliAnsys EmployeeI already shared what do above: (pick-a-real "/define/named-expression/compute mdot" 3) whenever you are asked to change the mass flow rate in the periodic panel using TUI command. You will end up with long command which needs to be executed every N iterations or time step size or only at the beginning of the run. If you are working under the Workbench you might use Automatic modify case to adjust the mdot for every design point by using a Pre-Initialization modification.
October 19, 2021 at 11:29 amMadhu_KalyanSubscriber. Sorry but that wasn't my intention. I am in a kind of hurry and wasn't able to fully sit down and learn all of the basics. THis is also not my main problem. I am trying to get the help I can for this simple 2D problem so that I can apply it to a much larger problem. That is why I have been troubling you so much. It's not like I am not trying anything but it's just that it is so new to me that I haven't been able to keep up. Also there is one more anomaly in the periodic BC which I have been giving my 100% to figure out. The mass flow average temperature suddenly dips down during heating for first few mm and then it tries to cover up the difference by giving a sudden spike upwards for the last few mm. I can elaborate you on this but since this thread is concerned with parametrization I will not trouble you with that. If you are willing to help me a bit more I would greatly appreciate the help and will also think of a way to put the detailed steps in the web so that others might not need to go through this trouble again. So its your call.
And regarding my effort for this, I have been exploring all the options in the TUI but I couldn't find them and scheme programming is still very confusing to me. Only after doing this I have asked for your help. I truly apologise If you feel that you are spoonfeeding me but one way or other I will figure it out, rather I have to.October 19, 2021 at 12:01 pmAmine Ben Hadj AliAnsys EmployeeActually that is now simple given the Quick Search Tab Function in Fluent. First of all let Fluent record TUI Commands by starting Journal under File Menu. Afterwards use the search bar to find periodic and then you will find your way. You will end up with something like
/define/periodic-conditions/massflow-rate-specification? 5 0. 0.5 2 300 1. 0. 0. The fist value corresponds to mdot. Now one needs to return the value of the expression: You need to test if the return value is what you expect:
(pick-a-real "define/named-expressions/compute mdot" 4) is working for me and return the value I input
So the whole command will be then /define/periodic-conditions/massflow-rate-specification? (pick-a-real "define/named-expressions/compute mdot" 4) 0. 0.5 2 300 1. 0. 0. With that command you can use to adjust the run every iteration or to adjust at the beginning.
October 19, 2021 at 12:10 pmMadhu_KalyanSubscriberI will try it and let you know. I think it is starting to get more and more clear. Thank you
October 19, 2021 at 3:23 pmMadhu_KalyanSubscriberSo, I have successfully created the expression "mdot" and assigned it the units and value in its definition as 0.05[kg s^-1]. I have done this part "/define/periodic-conditions/massflow-rate-specification? 5 0. 0.5 2 300 1. 0. 0" correctly. I have also verified by using "define/named-expressions/compute mdot" and it returned the value 0.05 kg/s. "mdot" shows up in the workbench 'parameter set' window and I tried to change the value of mdot by adding more cases over there and simulate it. But the mass flow rate did not change for each case and it was the same thing that I put in the periodic dialog box for the first case. So this confirms that the parameter I have created wasn't accepted as the parameter for the massflow rate in the periodic condition. Can you tell me what I have done wrong? I have created a journal file too and tried to edit in that but it seems I have to read the journal file every time I have to change my mass flow rate or put in the TUI commands to change the mass flow rate. Either I am understanding it wrong or I am not using it the right way. Can you clarify?
October 20, 2021 at 10:33 amRobForum ModeratorWhere in this command is the reference to mdot? "/define/periodic-conditions/massflow-rate-specification? 5 0. 0.5 2 300 1. 0. 0"
October 20, 2021 at 11:30 amAmine Ben Hadj AliAnsys EmployeeRead carefully my solution...
October 22, 2021 at 4:14 pmMadhu_KalyanSubscriberI have read the solution and I was successfully able to assign the variable mdot to the periodic mass flow rate. But whenever I change the parameter in the workbench it is not updating the massflow rate unless I go back into the setup and put the command again to initialize. I tried to record a journal file but to make it read in the next case also I need to open the fluent tab. I am attaching the image for reference. Initially, I ran a case with a mass flow rate of 0.005 kg/s and I changed the mdot value to 0.02 in this tab and updated it but the result was showing that the old mass flow rate has been used to calculate and the change hasn't been reflected. Kindly point out my mistake and I will search for the solution
October 30, 2021 at 2:02 amMadhu_KalyanSubscriber
October 30, 2021 at 5:44 amMadhu_KalyanSubscriberI finally found a solution and I don't know whether it is correct or not. The forum admins can clarify if anything is wrong or missing but it worked for me.
After making the zones periodic, click on Named Expressions in the Setup and create a variable. In my case, it was created as "mdot" with an arbitrary value say "1" with the unit specified as "[kg s^-1]" and check the "Use as parameter" box at the bottom. It should look something like the image below.
Then give the command "define/named-expressions/compute mdot. The slashes can always be avoided if you typed enter in the place of the slash. This command is to just check whether the variable is added and compute the value you give.
The next step is to go to the "calculation activities" tab and select "Create/edit" in the "execute commands" sections. Define a command by putting this line - define/periodic-conditions/massflow-rate-specification? (pick-a-real "define/named-expressions/compute mdot" 4) . The number of iterations can be set at any number but for safe side keep it anything between 1 to 10. This means that the command is going to get executed thereby assigning the mass flow rate to the simulation every n iterations. I checked it with multiple values and it did not change the end result when it converged. I also checked the result of these simulations with the original simulation having no parameters for mass flow rate and the values checked out. The image is given below.
I tried various other methods and this is the closest I have gotten to solve it. Now I can change the mdot value in the workbench parameter and the simulations are done with correct values as intended.
The Forum coordinators are welcome to give any input to this method and I thank DrAmine for being patient and guiding me through this.
Cheers
Viewing 30 reply threads- The topic ‘Can you parametrize mass flow rate input in Periodic boundary conditions in Fluent?’ is closed to new replies.
Ansys Innovation SpaceTrending discussions- Non-Intersected faces found for matching interface periodic-walls
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
- Facing trouble regarding setting up boundary conditions for SOEC Modeling
- UDF, Fluent: Access count of iterations for “Steady Statistics”
Top Contributors-
1406
-
599
-
591
-
550
-
366
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-