Adding acceleration term in icoDyMFoam
Hey guys, real simple question. My moving reference frame is accelerating 0.5*pi*A*T*sin(2*pi*t/T) in xdirn and sqrt(3)/2*pi*A*T*sin(2*pi*t/T) in ydirn. A, T, pi are constants, t is time. I'm trying to add these to the momentum equation but it doesn't compile. Here's what I've got:
Ueqn.H Code:
volScalarField pi = 3.1415926535897932384626433832795028841971693993751; 
Ok....put it this way,
1. How can I create an empty volScalarField with dimensions acceleration? 2. How do I introduce the runtime class into Ueqn.H? (What header file do I need to introduce) I couldn't find any of this basic stuff in the programmer's guide... 
Hi Pavan,
I am not expert but if I make some comments on your code, I can say that: 1. I wouldn't define pi as volScalarField, because it is a constant scalar, not a field variable which has different values in time and space. So I think, Code:
scalar pi 3.1415926535897932; There might (/or not) also be an already defined macro for the number pi in OpenFOAM but I haven't used it before. 2. I wouldn't define acc as volVectorField neither (if I won't need to use it over and over, or do other calculations with it). Because, if you want to define a volVectorField, then (as far as I understood up to now) then also you will need to construct an IOobjet and make mesh association, defining the dimensions etc., such as: Code:
volVectorField acc What can be done may be writing the acc formula directly into the Ueqn. However, I am not sure about how will the expressions like 0.5*vector(1,0,0) compiled. They might need to be verified separately. 3. I haven't used icoDyMFoam so I don't know anything about it, however, I have been using interDyMFoam for a while and I guess the "DyM" stands for dynamic mesh (and it maybe the same in icoDyMFoam). In interDyMFoam the mesh movement is imposed by an additional utility called gen6DoF, which is in turn equivalent to an extra acceleration term to UEqn. Since your acceleration term is also only a function of time, and is independent of space, use of gen6DoF explicitly might also be considered. Regards, Ozgur 
Hi Pavan,
Since your source term is constant in space you don't need to define a volVectorField, a simple vector would do it. You could try something like: Code:
dimensionedVector accX 
Thanks, Ozgur!
1. Agreed about the scalar pi thing. 2. I don't know I was referring to this thread: http://www.cfdonline.com/Forums/ope...nceframe.html (3rd post by Henry) where Fcent is defined as a volVectorField without being a field variable. 3. Yeah icoDyMFoam is just the dynamic mesh version of icoFoam, the incompressible fluid solver with no turbulence. 
Also, thanks Simon! Will try this asap

Well, with the extra help of an experienced OF user I got the following to compile:
Code:
scalar Pi = mathematicalConstant::pi; 
I notice in dnsFoam the force term is implemented like so:
Code:
Code:
fvVectorMatrix UEqn 
They are different.
In the first, acc is introduced to momentum equation, and in the second acc was introduced into pressure equation and pressure equation should also be altered accordingly (if you don't include acc relative term in pressure, the results should differ much). If acc has effect on the velocity, doing in the second way is more implicit. please see derivation of pressure equation in Henrik Rusche's phd thesis. regards, Junwei 
Thanks for the reply Su Junwei! So I take it the first approach is valid but not as implicit as the second approach (with modification to the pressure equation)?

All times are GMT 4. The time now is 19:57. 