|
[Sponsors] |
May 16, 2012, 12:44 |
Constant velocity field
|
#1 |
New Member
Per Christian Endresen
Join Date: Feb 2012
Location: Trondheim, Norway
Posts: 13
Rep Power: 14 |
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 |
|
May 16, 2012, 12:49 |
|
#2 |
Member
fisch
Join Date: Feb 2010
Posts: 97
Rep Power: 16 |
Using a boundary condition at this point could solve your problem
but then you have to define a BC for p etc, too... |
|
May 22, 2012, 04:29 |
|
#3 |
New Member
Per Christian Endresen
Join Date: Feb 2012
Location: Trondheim, Norway
Posts: 13
Rep Power: 14 |
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 |
|
May 22, 2012, 10:28 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
- 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 |
||
May 23, 2012, 05:23 |
|
#5 |
New Member
Per Christian Endresen
Join Date: Feb 2012
Location: Trondheim, Norway
Posts: 13
Rep Power: 14 |
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 |
|
May 23, 2012, 07:01 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
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) |
||
September 4, 2015, 04:18 |
|
#7 | |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
Quote:
I have the intention to do something similar. Could you give me some feedback about the methods you tested? What were pros and cons? What finally worked? Thanks! Eloïse |
||
February 27, 2018, 01:11 |
|
#8 | |
Member
Join Date: Jan 2018
Location: Malaysia
Posts: 58
Rep Power: 8 |
Quote:
|
||
February 27, 2018, 02:00 |
|
#9 |
Senior Member
Join Date: Aug 2013
Posts: 407
Rep Power: 16 |
Hi,
Does not a combination of fvOptions and codedSource boundary condition help? Cheers, Antimony |
|
February 27, 2018, 12:52 |
|
#10 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Try the "fixedValue" fvOption
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
|
February 28, 2018, 11:04 |
|
#11 | |
Member
Join Date: Jan 2018
Location: Malaysia
Posts: 58
Rep Power: 8 |
Quote:
Hi, Thanks for the help and suggestions. I learned a new thing FvOptions works, i use scalarFixedValueConstraint and vectorFixedValueConstraint as following: Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: plus | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // carIntFixedScalar { type scalarFixedValueConstraint; active yes; scalarFixedValueConstraintCoeffs { selectionMode cellZone; cellZone carIntCZ; fieldValues { P 0; k 0; epsilon 0; } } } carIntFixedVector { type vectorFixedValueConstraint; active yes; vectorFixedValueConstraintCoeffs { selectionMode cellZone; cellZone carIntCZ; fieldValues { U (0 0 0); } } } // ************************************************************************* // |
||
February 28, 2018, 11:22 |
|
#12 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
February 28, 2018, 13:46 |
|
#13 | |
Member
Join Date: Jan 2018
Location: Malaysia
Posts: 58
Rep Power: 8 |
Quote:
PimpleDyMFoam --Simulate turbulence caused by moving object Linear motion of a solid inside a fluid Actually, i am trying to build a 3D hollow box(car) moving in a rectangular tube domain (shaft), and i aim to mesh the space btwn hollow box and rectangular tube to study the external airflow and pressure and turbulence parameters. This is my starting step to learn the simulation of aerodynamic outside vehicle or body within a domain. It seems didnt work if delete the cells within the box to make it hollow. So, i am now trying to set every fields of cellZone in the car (carIntCZ) to be zero value. Is appropriate? I am sry for my dummy questions. Thanks a lot =) |
||
March 8, 2018, 08:27 |
|
#14 |
Senior Member
Eloïse
Join Date: Jul 2012
Location: Trondheim, Norway
Posts: 113
Rep Power: 14 |
||
Tags |
constant, field, setfields, vector, velocity |
|
|
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 |