|
[Sponsors] | |||||
Adding an acceleration source term to interFoam |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 13 ![]() |
Dear Foamers,
I want to study the shape oscillation an translation motion of a single bubble in a liquid container under vibration while the imposed displacement of the container is y=Acos(wt). for this purpose,i should add an acceleration source term to momentum equation. I'm trying to modify the interFoam equations by adding a source term to the momentum equation, UEqn.H : Code:
dimensionedVector accY
(
"accY",dimensionSet(0, 1, -2, 0, 0),vector(0, 1, 0)
);
scalar Pi = 3.14;
dimensionedVector acc = (-396270.25*0.0002*Foam::cos(629.5*runTime.value())*accY);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U)
==
(acc*rho)
);
UEqn.relax();
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
) * mesh.magSf()
)
);
}
I would appreciate your comments! Thanks a lot, Arsalan. |
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 19 ![]() |
hello,
Take a look at how gravity source term is take into account. And do the same. regards, olivier |
|
|
|
|
|
|
|
|
#3 |
|
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 13 ![]() |
Well, with the extra help of Olivier I got the following to compile:
UEeqn.H : Code:
dimensionedVector accY
(
"accY",dimensionSet(0, 1, -2, 0, 0),vector(0, 1, 0)
);
scalar Pi = 3.14;
dimensionedVector acc = (-396270.25*0.0001*Foam::cos(629.5*runTime.value())*accY);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
+ turbulence->divDevRhoReff(rho, U)
);
UEqn.relax();
if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1)
- ghf*fvc::snGrad(rho)
+ acc*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
) * mesh.magSf()
)
);
}
Code:
UEqn.H:35:40: instantiated from here /opt/openfoam221/src/OpenFOAM/lnInclude/FieldFunctions.C:700:1: error: no match for ‘operator+’ in ‘*(f2P ++) + *(f3P ++) Code:
+ acc*fvc::snGrad(rho) Every help, idea, hint... will be greatly apprecitated! Thanks a lot, Arsalan. |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 19 ![]() |
hello,
Try to follow more closely what's done with g: acc = ...; //ok gh = (acc+g) &mesh.C(); ghf = (acc+g) & mesh.Cf(); .. then you don't have to add acc in momentum predictor. regards, Olivier |
|
|
|
|
|
|
|
|
#5 |
|
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 13 ![]() |
Dear Olivier,
thank u for your reply,but how do i modify the gh and ghf(and at which file)? Best regards, Arsalan |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 12:32 |
| OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 10:17 |
| Adding volumetric Source Term | mohanamuraly | OpenFOAM | 0 | May 17, 2009 23:00 |
| OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
| DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 18:51 |