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

Field Function

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 19, 2014, 06:09
Default Field Function
  #1
New Member
 
Daniel GRimbs
Join Date: Nov 2014
Posts: 2
Rep Power: 0
Dgrimbs is on a distinguished road
hey,

I have problems with my Field Function. I would like to simulate movement and move the object in the Z-axis (dependent on time).
the equation of motion I have already written, but I have a problem that does not move the object in the negative direction of the coordinate system.

I hope someone of you can help me further.

Here is the definition of Field Function:

[($ Time <0.4)? 10 : (($ time>= 1.3) && ($ Time <1.7))? - 10: 0,0,0]
Dgrimbs is offline   Reply With Quote

Old   November 20, 2014, 03:03
Default
  #2
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,683
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Quote:
Originally Posted by Dgrimbs View Post
hey,

I have problems with my Field Function. I would like to simulate movement and move the object in the Z-axis (dependent on time).
the equation of motion I have already written, but I have a problem that does not move the object in the negative direction of the coordinate system.

I hope someone of you can help me further.

Here is the definition of Field Function:

[($ Time <0.4)? 10 : (($ time>= 1.3) && ($ Time <1.7))? - 10: 0,0,0]
I cannot promise that it will help, but I would really split this into two definitions to make sure that the parser works okay, especially with the ternary operation in there. It might also make your code easier to understand and maintain.

The position
Code:
MyPosition = ($Time < 0.4) ? 10 : (($Time >= 1.3 && $Time < 1.7) ? -10 : 0)
and then use
Code:
[${MyPosition}, 0, 0]
Note that you must also ensure that third element of the ternary is bracketed. This is not needed for C/C++/Java etc, but does seem to be needed for STARCCM.

Valid for STARCCM (and C/C++/Java etc)
Code:
conditon1 ? val1 : (condition2 ? val2 : val3)
Valid for C/C++/Java etc, but invalid for STARCCM
Code:
conditon1 ? val1 : condition2 ? val2 : val3
olesen is offline   Reply With Quote

Reply

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 04:50
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 04:49
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Rectangular pulse as field function Jul1731 STAR-CCM+ 3 April 4, 2014 11:54
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21


All times are GMT -4. The time now is 07:27.