Time-dependent pulsating source/sink in interFoam
I am trying to model a time-dependent pulsating source/sink in interFoam.
The source/sink is of the form:
Source = SV * C * cos(f * t)
C is a coefficient
f is the frequency of the source/sink
SV is a volScalarField equal to 1 for the source cells and 0 otherwise.
All three are constant and given as input.
The source/sink is in the alpha1 = 1 zone.
My first approach was to change the interFoam solver as follows:
- definition of the source/sink
SV * Foam::cos(f * runTime.time().value())
fvm::laplacian(rUAf, p) == fvc::div(phi) – Source
MULES::explicitSolve(oneField(),alpha1, phi, phiAlpha, zeroField(),Source, 1, 0);
This seemed to work, but unfortunately I found that the overall (alpha1 = 1) mass of the system increases. Boundary Conditions are all slip type except one (the top side) which is an inlet/outlet for the alpha1 = 0 phase. The source/sink is a symmetric function and, during a full cycle, it extracts from the system as much mass as it introduces.
Therefore the overall (alpha1 = 1) mass of the system should remain constant.
I have also tried a number of variations, but with more or less the same results.
Can anyone help? What am I missing?
Thanks a million.
Foam::cos(f * runTime.time().value()) - I think this is not working.
Info<< "Time = " << runTime.timeName() << nl << endl;
Source = SV * Foam::cos(f * runTime.time().value()); // This is working. :)
mass source in interDyMFoam
I am trying to do the same but with moving meshes aka. interDyMFoam from OpenFOAM-2.0.x.
With a similar source definition but without changing anything in the gamma equation(!) everything seems fine if I do not move the mesh. (dynamicMotionSolverFvMesh but no motion specified in pointDisplacement.)
Moving the mesh leads to the maximum alpha1 value to grow over time, even when using Gamm01 or vanLeer01 schemes.
I do not really understand why a source should be influenced by the motion since the fluxes and divergence should still be valid but I am clearly missing something here.
Attempts to use limited Schemes did not help.
As previous posts show a change to MULES should be necessary, (but does the non-moving mesh case work fine?).
MULES::explicitSolve(rho,alpha1, phi, phiAlpha,Source,zeroField(), 1, 0);
For a moving mesh this also leads to alpha1 values increasing...
Any comments would be very much appreciated, I am happy to share any code or test case.
PS: After a weekend InterDyMFoam with a moving mesh also works in OF 2.1.x without changing the alpha equation..
|All times are GMT -4. The time now is 17:17.|