CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > Siemens > STAR-CCM+

Field function for defining "pressure oulet"

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 7, 2020, 05:06
Default Field function for defining "pressure oulet"
  #1
New Member
 
Jonathan Thilo
Join Date: Jul 2020
Posts: 4
Rep Power: 5
Jonathan_Thilo is on a distinguished road
Hi all,

I'm looking for explanation of the syntax in the field functions.

i need a field function to modify my pressure outlet for each 5000 iteration fx.

an example could be:
0-1000 iteration -> Pressure = 1bar
1000-1500 iteration -> pressure = 2bar
1500-2000 iteration -> pressure = 3bar
...

currently i'm at:
(${Iteration} >= 1000) ? ${P_INLET} = 10e5
but i'm sure it is wrong.

Thanks in advance
Jonathan_Thilo is offline   Reply With Quote

Old   July 7, 2020, 23:06
Default
  #2
Senior Member
 
Ping
Join Date: Mar 2009
Posts: 556
Rep Power: 20
ping is on a distinguished road
you have the syntax wrong and the result is output to your input menu, scene etc and not within the equation:
(${Iteration} < 1000) ? 1e5 : (( ${Iteration} < 1500) ? 2e5 : (( ${Iteration} < 2000) ? 3e5 : 4e5 ))

your stepping of the pressure might cause instability and so you could consider a simple linear ramp with something like this:
(${Iteration} < 2000) ? ${Iteration} * 400.0 : 4e5

(both assume you want the pressure to be get to 4e5 at 2000 iterations - you did not specify what happens after 2000.
ping is offline   Reply With Quote

Old   July 8, 2020, 08:34
Default
  #3
New Member
 
Jonathan Thilo
Join Date: Jul 2020
Posts: 4
Rep Power: 5
Jonathan_Thilo is on a distinguished road
Hi Ping,

Thank you, very helpful.
Jonathan_Thilo is offline   Reply With Quote

Old   July 8, 2020, 09:56
Default
  #4
cwl
Senior Member
 
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 433
Rep Power: 17
cwl is on a distinguished road
Instead of crazy syntax-based nested conditions - I'd suggest external .csv-table (Iteration-Pressure) and interpolateTable() function with LINEAR option.
cwl is offline   Reply With Quote

Old   July 9, 2020, 03:50
Default
  #5
New Member
 
Jonathan Thilo
Join Date: Jul 2020
Posts: 4
Rep Power: 5
Jonathan_Thilo is on a distinguished road
cwl, could you explain the external .csv method?
Jonathan_Thilo is offline   Reply With Quote

Old   July 10, 2020, 09:40
Default
  #6
Senior Member
 
Ping
Join Date: Mar 2009
Posts: 556
Rep Power: 20
ping is on a distinguished road
anyone who has got to this level in their studies should be encouraged to learn the wonderful power of field functions and equations in star since it opens up so much potential.
tables will do this task well too but is painful if you decide to change a setting since a new table is required to be created and imported - better suited to importing a long time series of data and then interpolating. you can read about it in tools, tables.
ping is offline   Reply With Quote

Old   July 11, 2020, 10:43
Default
  #7
cwl
Senior Member
 
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 433
Rep Power: 17
cwl is on a distinguished road
Create a .csv-file table with contents like following
Quote:
"Iteration", "Pressure (bar)"
0000, 1
1000, 2
1500, 3
Load it in Tools -> Tables

Then - you can use it in Field Functions like:
Quote:
interpolateTable(@Table("TableName"), "Iteration", STEP, "Pressure", $Iteration)
cwl is offline   Reply With Quote

Old   July 11, 2020, 10:47
Default
  #8
cwl
Senior Member
 
Chaotic Water
Join Date: Jul 2012
Location: Elgrin Fau
Posts: 433
Rep Power: 17
cwl is on a distinguished road
Quote:
Originally Posted by ping View Post
anyone who has got to this level in their studies should be encouraged to learn the wonderful power of field functions and equations in star since it opens up so much potential.
Honestly speaking - I wouldn't call it wonderful power, for functions they lack functionality of functions:
- arguments;
- loops;
- calling other functions;
- something more handy for dealing with ranges than inhuman ternary operator.


Quote:
Originally Posted by ping View Post
tables will do this task well too but is painful if you decide to change a setting since a new table is required to be created and imported - better suited to importing a long time series of data and then interpolating. you can read about it in tools, tables.
Table can be just reloaded.
Again, I would not call using tables painful in such case - compared to multiple nested (...) ? ... : ... conditions.

No doubt that tables were intended to be used fpr dealing with data series, but given current limitations of capabilities - I'd use them in this case.
cwl is offline   Reply With Quote

Reply

Tags
fieldfunction:iteration

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 91 December 21, 2022 05:50
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 05:49
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51


All times are GMT -4. The time now is 11:30.