|
[Sponsors] |
Adding an acceleration source term to interFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 10, 2015, 07:19 |
Adding an acceleration source term to interFoam
|
#1 |
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11 |
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. |
|
July 10, 2015, 09:32 |
|
#2 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17 |
hello,
Take a look at how gravity source term is take into account. And do the same. regards, olivier |
|
July 10, 2015, 12:16 |
|
#3 |
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11 |
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. |
|
July 10, 2015, 12:56 |
|
#4 |
Senior Member
Olivier
Join Date: Jun 2009
Location: France, grenoble
Posts: 272
Rep Power: 17 |
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 |
|
July 10, 2015, 17:00 |
|
#5 |
Member
Arsalan
Join Date: Jul 2014
Posts: 74
Rep Power: 11 |
Dear Olivier,
thank u for your reply,but how do i modify the gh and ghf(and at which file)? Best regards, Arsalan |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem compiling a custom Lagrangian library | brbbhatti | OpenFOAM Programming & Development | 2 | July 7, 2014 11:32 |
OpenFOAM without MPI | kokizzu | OpenFOAM Installation | 4 | May 26, 2014 09:17 |
Adding volumetric Source Term | mohanamuraly | OpenFOAM | 0 | May 17, 2009 22:00 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 19:08 |
DecomposePar links against liblamso0 with OpenMPI | jens_klostermann | OpenFOAM Bugs | 11 | June 28, 2007 17:51 |