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

Prescribe velocity field as essential B.C.

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 7, 2022, 08:42
Default Prescribe velocity field as essential B.C.
  #1
New Member
 
Michelle
Join Date: Jan 2022
Posts: 8
Rep Power: 4
Michelle197 is on a distinguished road
Hi all,

I am new to star ccm+ so this is probably a stupid question.
I have a cube and I want to prescribe the velocity on the cube faces to create a uniaxial extensional flow: velocity = [strain_rate*x,-strain_rate/2*y,-strain_rate/2*z]. So what I did is created a velocity_inlet boundary condition on the surfaces. Since the velocity depends on the local coordinates on the surfaces I thought it was best to define it via a field function, but I can not figure out how this works. I want to have a strain_rate of 1, but I don't know how to set a user variable. I tried to define a user field function but I keep getting syntax errors because the dimension is not right: [$$Position[1]*1, -0.5*$$Position[2],-0.5*$$Position[3]].

I also saw that there is a velocity field function, so I tried to add that to the boundary condition, but now I can't find how to define the velocity.

Can anyone please help me out? Thanks in advance!

Kind regards,
Michelle
Michelle197 is offline   Reply With Quote

Old   January 8, 2022, 02:50
Default
  #2
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,676
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
The velocity field function is a primitive function that you should never try to edit. That's your velocity solution when you iterate... You don't want to mess with it (you can't either how).

Use indexing 0, 1, and 2 for the x,y,and z components of a vector. Enclose variable names in curly brackets if they are fancy. I.e. ${strain_rate} if strain_rate is a defined scalar function. Single $ are for referencing scalar functions and dbl dollar signs $$ are for referencing vectors. Note that you could also define parameters that can be referenced in field functions rather than creating an entire field function for a simple constant value.

What is wrong with?
Code:
[$${Position}[0]*1, -0.5*$${Position}[1],-0.5*$${Position}[2]]

Last edited by LuckyTran; January 8, 2022 at 11:54.
LuckyTran is offline   Reply With Quote

Old   January 8, 2022, 06:16
Default
  #3
New Member
 
Michelle
Join Date: Jan 2022
Posts: 8
Rep Power: 4
Michelle197 is on a distinguished road
Thank you for your answer!

The problem with that line was that it has the wrong dimensions. It gives as result the unit of Position and not Velocity. If I want to define a scalar Strain_rate [1/s] do I have to do that via a field function as well, or is there an easier way?

Thanks!
Michelle
Michelle197 is offline   Reply With Quote

Old   January 8, 2022, 11:53
Default
  #4
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,676
Rep Power: 66
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Easy? There's no such thing as a free lunch.

If cowabunga has a value of 1 then why not just hard code it as-is? If you plan on changing its value later one day to 189 and on another day to -256, then I recommend to use a parameter. You can find parameters in the tree in tools if you look a little further down past field functions. If cowabunga is spatially/temporally varying field, then use a field function.


Units are units. Just take care of them. If you define dimensionless stuff and try to use it as an input to dimensioned things, Star will assume SI units for the dimensionless stuff. If you define dimensions, then you are in charge of making sure the dimensions match. Position obviously has units of length. 1, and -0.5 has units of no-dimensions.

Instead of 1, which has no units, type 1 [1/s]
LuckyTran is offline   Reply With Quote

Old   January 8, 2022, 15:09
Default
  #5
New Member
 
Michelle
Join Date: Jan 2022
Posts: 8
Rep Power: 4
Michelle197 is on a distinguished road
Thank you I will try that!
Michelle197 is offline   Reply With Quote

Reply

Tags
field function, prescribed velocity


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
Import .csv - velocity profile - error eSKa CFX 9 April 3, 2021 13:38
Same pressure gradient but different velocity field TurbJet Main CFD Forum 22 April 28, 2018 03:35
potential flows, helmholtz decomposition and other stuffs pigna Main CFD Forum 1 October 26, 2017 08:34
velocity field of MRF, GGI and rotatingWallVelocity tonky OpenFOAM Programming & Development 1 October 14, 2016 11:04
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20


All times are GMT -4. The time now is 13:16.