CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Constant velocity field (http://www.cfd-online.com/Forums/openfoam-solving/101895-constant-velocity-field.html)

Per May 16, 2012 11:44

Constant velocity field
 
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

fisch May 16, 2012 11:49

Using a boundary condition at this point could solve your problem
but then you have to define a BC for p etc, too...

Per May 22, 2012 03:29

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

gschaider May 22, 2012 09:28

Quote:

Originally Posted by Per (Post 362355)
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

Per May 23, 2012 04:23

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

gschaider May 23, 2012 06:01

Quote:

Originally Posted by Per (Post 362614)
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)


All times are GMT -4. The time now is 08:39.