CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Constant velocity field

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 16, 2012, 12:44
Default Constant velocity field
  #1
Per
New Member
 
Per Christian Endresen
Join Date: Feb 2012
Location: Trondheim, Norway
Posts: 13
Rep Power: 4
Per is on a distinguished road
Dear all

I have (most likely) an unusual problem. I want to set a constant velocity field in a part of the solution domain. Let's say (1 0 0) for simplicity; and I want this value to be constant throughout the whole simulation. Please note that this not is an investigation of an actual physical problem. I only want to investigate the effect of this imposed velocity field.

I tried to use setFields, but as expected it only gave the desired velocity field as an initial condition at T=0. I have searched the forum, but have not yet found a solution that does not involve altering the source code. Does anyone know if this is possible without altering the source code?

Thanks in advance for replies.
Regards
Per
Per is offline   Reply With Quote

Old   May 16, 2012, 12:49
Default
  #2
Member
 
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 6
fisch is on a distinguished road
Using a boundary condition at this point could solve your problem
but then you have to define a BC for p etc, too...
fisch is offline   Reply With Quote

Old   May 22, 2012, 04:29
Default
  #3
Per
New Member
 
Per Christian Endresen
Join Date: Feb 2012
Location: Trondheim, Norway
Posts: 13
Rep Power: 4
Per is on a distinguished road
I actually want to impose a velocity field on a control volume; not a surface or a point. So I guess a boundary condition will not be sufficient. Is there no way to set a fixed velocity inside some chosen cells (or control volume)?

Regards
Per
Per is offline   Reply With Quote

Old   May 22, 2012, 10:28
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Per View Post
I actually want to impose a velocity field on a control volume; not a surface or a point. So I guess a boundary condition will not be sufficient. Is there no way to set a fixed velocity inside some chosen cells (or control volume)?

Regards
Per
There are two ways:
- you modify the solver to fix the values during the solution of the linear equation. All these methods are based on the setValues-method of fvMatrix. One would be the explicitSource-class in OF (havn't used that yet). The other would be forceEquation in swak4Foam (I think there is a discussion on this somewhere here on the board). explicitSource sets a constant value in a fixed cell region. forceEquation can use any expression (for the value and the location)
- the other method would be to use a functionObject to reset the field in a specific region after the solution process. That is more of a hack but works in a lot of instances. One such functionObject would be manipulateField in the swak4Foam-suite. But maybe there are others
gschaider is offline   Reply With Quote

Old   May 23, 2012, 05:23
Default
  #5
Per
New Member
 
Per Christian Endresen
Join Date: Feb 2012
Location: Trondheim, Norway
Posts: 13
Rep Power: 4
Per is on a distinguished road
Thanks for the reply Bernhard

I guess I have to install swak4Foam. Since I have trouble with compiling (due to dependency problems), is it possible to download and install swak4Foam without compiling? I ask because I read something about it at https://openfoam-extend.svn.sourcefo...ies/swak4Foam/. I did not install OF on the system myself. The one who did had problems with compiling, and therefor installed pre-compiled OF libraries and utilities.

Btw, I use OF 2.1.0.

Regards
Per
Per is offline   Reply With Quote

Old   May 23, 2012, 07:01
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,889
Rep Power: 38
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by Per View Post
Thanks for the reply Bernhard

I guess I have to install swak4Foam. Since I have trouble with compiling (due to dependency problems), is it possible to download and install swak4Foam without compiling? I ask because I read something about it at https://openfoam-extend.svn.sourcefo...ies/swak4Foam/. I did not install OF on the system myself. The one who did had problems with compiling, and therefor installed pre-compiled OF libraries and utilities.

Btw, I use OF 2.1.0.

Regards
Per
Dependencies for swak4Foam are not too bad: only flex and bison

It is true. In the swak4Foam-sources there is everything needed to roll Debian-packages (this is needed for the yearly Workshop-ISO) But I don't have the time (nor am I very motivated as I don't have Ubuntu/Debian systems nor have the people I work for) to roll binary releases in addition to the source releases. I have said it before: if someone volunteers to do that I will gladly assist her (same goes for anyone who wants to package RPM-releases)
gschaider is offline   Reply With Quote

Reply

Tags
constant, field, setfields, vector, velocity

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
real velocity field from energy spectrum Angel Main CFD Forum 7 December 13, 2013 21:40
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 19:44
how to make velocity field constant with time openfoam1 OpenFOAM 0 February 1, 2010 16:53
Constant field inside the volume Ben Makhal CFX 10 February 6, 2008 17:32
fixed velocity field Glen CFX 3 August 28, 2006 13:17


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