
[Sponsors] 
March 9, 2015, 19:03 
rpm as function of time in SRF model ?

#1 
New Member
Ron Bardell
Join Date: Aug 2012
Posts: 3
Rep Power: 6 
Sponsored Links
I've added SRF functionality to porousInterFoam v.2.3.1 to model conditions in a vial of fluid (a suspension) in a spinning centrifuge. It works , but we want the centrifuge to slowly come up to full speed. I'd like to use a table to specify a timedependent rpm in the SRFProperties file, but the code is expecting a scalar. I see that swirlFlowRateInletVelocityFvPatchVectorField.C, for example, can update omega with rpm specified as table. How can I implement this in my SRFPorousInterFoam solver? Essentially, how can I get updated values each time step of rpm and then FCoriolis and FCentrifugal? I'm not so good at C++, but pretty good at following examples. Can you help me? Thanks! Ron. 

Sponsored Links 
March 10, 2015, 03:02 

#2 
Senior Member

Hi,
Straightforward implementation can be something like: you take src/finiteVolume/cfdTools/general/SRF/SRFModel/rpm model as a base and create varyingRpm model where you change this Code:
class rpm : public SRFModel { // Revolutions per minute scalar rpm_; ... } Code:
class varyingRpm : public SRFModel { // Revolutions per minute autoPtr<DataEntry<scalar> > rpm_; ... } You can find examples of DataEntry constructor and data interpolation in swirlFlowRateInletVelocityFvPatchVectorField.C. 

March 10, 2015, 18:43 

#3  
New Member
Ron Bardell
Join Date: Aug 2012
Posts: 3
Rep Power: 6 
Thanks, alexeym!
Now my faded C++ skills are showing. I've modified rpm.H and rpm.C as varyingRpm.H and varyingRpm.C (see attached). It compiles with error since the constructor now needs a dictionary. Where do I override SRFModel's omega, Fcoriolis, Fcentrifugal, velocity, U methods? In varyingRpm.C or in a modified SRFModel.C ? If you can give me one override example, I can probably replicate for the rest. I would not have gotten this far without your help! Thanks, Ron. Quote:


March 11, 2015, 09:28 

#4 
Senior Member

Hi,
I have looked more closely at SRFModel and have two news. About your implementation: 1. You can't change number of constructor arguments in children classes. So your constructor should look like Code:
varyingRpm(const volVectorField& U); Code:
Foam::SRF::varyingRpm::varyingRpm ( const volVectorField& U ) : SRFModel(typeName, U), rpm_(DataEntry<scalar>::New("varyingRpm", SRFModelCoeffs_)) { ... } 

March 12, 2015, 03:40 

#5  
New Member
Ron Bardell
Join Date: Aug 2012
Posts: 3
Rep Power: 6 
Thanks again, alexeym!
I've corrected varyingRpm as you suggested and no compiler errors. I'm okay with modifying SRFModel and it seems I should be able to use its omega() function to obtain the new omega value from varyingRpm's read() function. I haven't programmed C++ for 20 years, so I'm puzzled how SRFModel obtains omega_.value from varyingRpm. Can you help me with that? Since I can call omega() when calculating FCoriolis and FCentrifugal, it seems it could work if omega() has gotten the new value from varyingRpm::read() Thanks for all your help, Ron. Quote:


March 14, 2015, 12:47 

#6 
Senior Member

Hi,
You are right, read method of SRFModel can be overridden and using this method it is possible to change value of omega. But this method is called only when SRFProperties dictionary was modified. While it is necessary to modify omega on every time step. My idea was to create mSRFModel class which has virtual method (i.e. that can be overridden in children). SRF(PS)impleFoam solvers call Su method every time they construct UrelEqn, so this will be our candidate for virtualization. Problem is this approach is necessity to:  correct SRFModel  correct derived patch fields  correct solvers You can find POC implementation of these corrections with modified tutorial case attached to the message. To build modified versions of library and solvers, you untar mSRF.tar.gz archive, run wmake in src/finiteVolume folder (this will create mSRF.so library), and finally run wmake in applications/solvers/incompressible/mSRF(PS)impleFoam folders (these operations will create two solver mSRFPimpleFoam and mSRFSimpleFoam). Then you can try to run rotor2D test case. Unfortunately on my laptop the case diverged due to turbulence model. I have added RPM value output and it seems to be growing according to the interpolation table. 

May 6, 2017, 15:59 
Euler force

#7 
New Member
Join Date: Jun 2009
Posts: 22
Rep Power: 10 
Hi,
Google led me to this old thread... and I have one small comment that may be useful for anyone attempting something similar. In a rotating frame of reference with varying rotation rate a third fictitious force appear (apart from centrifugal and Coriolis), the so called Euler force, Another comment is that it doesn't make sense to me to have a non transient Simple solver with time varying rotation rate. 

Tags 
omega, srf, table (time) 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Extrusion with OpenFoam problem No. Iterations 0  Lord Kelvin  OpenFOAM Running, Solving & CFD  8  March 28, 2016 11:08 
Contribution a new utility: refine wall layer mesh based on yPlus field  lakeat  OpenFOAM Mesh Utilities  57  February 1, 2015 09:25 
Sudden jump in Courant number  NJG  OpenFOAM Running, Solving & CFD  7  May 15, 2014 13:52 
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3  bookie56  OpenFOAM Installation  8  August 13, 2011 04:03 
Could anybody help me see this error and give help  liugx212  OpenFOAM Running, Solving & CFD  3  January 4, 2006 19:07 
Sponsored Links 