# Requesting case sugestion for imposing a velocity source term, that simulates a pump

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

 June 18, 2014, 10:02 Requesting case sugestion for imposing a velocity source term, that simulates a pump #1 New Member   Lala Sasa Join Date: Jun 2014 Posts: 16 Rep Power: 5 Hi guys! I need to impose a velocity source term, that simulates a pump, in a closed loop. The fluid is turbulent and incompressible, interested both in stationary and transitory condition. Could someone indicate me a similar case study so I can extrapolate how to impose such condition? THX in advance.

June 18, 2014, 11:34
#2
Senior Member

Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 407
Rep Power: 15
Quote:
 Originally Posted by ChukerSweet Hi guys! I need to impose a velocity source term, that simulates a pump, in a closed loop. The fluid is turbulent and incompressible, interested both in stationary and transitory condition. Could someone indicate me a similar case study so I can extrapolate how to impose such condition? THX in advance.
In OF >= 2.2, there is a pressureGradientExplicitSource source available through fvOptions. This allows one to specify a target velocity and the source term will adjust the pressure gradient to achieve the target velocity. See \$FOAM_SRC/fvOptions/sources/derived/pressureGradientExplicitSource for all the details. It can even be used for specific cell zones. This however, is a steady-state value.

If you need a time-varying source, there is - to my knowledge - none available. Your options would be to write a new fvOptions source for a time varying velocity or use swak4Foam which gives the ability to code in generic source term into your solver and one specifies the form of the source term in a dictionary.

The nice thing about the swak4Foam approach is once the generic source term is hooked into the solver, the mathematical form is specified through the dictionary. Therefore, if one wants to modify either the form or the parameters, no compilation is necessary. So one can easily experiment with the source term and the parameters. In fact, if one was so inclined, a parametric study of the source would be straightforward with a script.

 June 18, 2014, 13:10 #3 New Member   Lala Sasa Join Date: Jun 2014 Posts: 16 Rep Power: 5 Thank you very much for the reply. The fvOption will work for now. Eventually I will need to use a variable pump condition but for the time being, and benchamrking porpoises a static one will do just fine. Again THX allot

 June 18, 2014, 13:49 #4 New Member   Lala Sasa Join Date: Jun 2014 Posts: 16 Rep Power: 5 Just one little more. I can't seem able to "activate" the option... One could write, from the header suggestion: pressureGradientExplicitSourceCoeffs { fieldNames (U); // name of velocity field Ubar (10.0 0 0); // desired average velocity gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient flowDir (1 0 0); // flow direction } Or from the PimpleFoam/Channel395 example (found it ! ) momentumSource { type pressureGradientExplicitSource; active on; //on/off switch selectionMode all; //cellSet // points //cellZone pressureGradientExplicitSourceCoeffs { fieldNames (U); Ubar ( 0.1335 0 0 ); } } In which the pressure is applied all over the place, I think. Anyhow whter I put one or the other file in, let's say, the Cavity example (in the systemo folder) nothing happens. This is logical, the control files need to know that I'm trying to impose a velocity somewere, but how do I do this? Sorry, and THX

June 18, 2014, 14:59
#5
Senior Member

Chris Sideroff
Join Date: Mar 2009
Location: Ottawa, ON, CAN
Posts: 407
Rep Power: 15
Quote:
 Originally Posted by ChukerSweet In which the pressure is applied all over the place, I think. Sorry, and THX
Yes but as I mentioned and as indicated in the sample fvOptions from the channel395 tutorial, one can apply to specific regions.

Code:
```momentumSource
{
active          on;        // on/off switch
selectionMode   all;       // cellSet // points //cellZone <= HERE

{
fieldNames  (U);
Ubar        ( 0.1335 0 0 );
}
}```
You would replace 'all' with one of cellSet/points/cellZone and then specify the name of your set, e.g.

Code:
```selectionMode cellSet;
cellZone rotor_zone;```
and you would have to had previously created a cell zone called 'rotor_zone'. If your mesh generator doesn't support creating zones, use the setSet utility. The details of how fvOptions works on sub-regions is found in \$FOAM_SRC/fvOptions/fvOptions/fvOption.C

 June 23, 2014, 11:04 #6 New Member   Lala Sasa Join Date: Jun 2014 Posts: 16 Rep Power: 5 THX allot for the info! Yes, the fvOption should be accompanied with the topoSet function. Looking into it. The multiphase-> throttle exampe seams to implement it, though not combined with the fvOption

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post [swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 11 November 1, 2016 07:43 hsieh OpenFOAM 9 August 16, 2015 14:53 sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44 Joseph CFX 14 April 20, 2010 15:45 Fan Main CFD Forum 10 September 9, 2006 12:24

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