CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Virtual Mass Force Implementation in icoLagrangianFoam- foam_exd 3.0

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 27, 2014, 11:47
Default Virtual Mass Force Implementation in icoLagrangianFoam- foam_exd 3.0
  #1
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
Hello Dear openFOAMers
I am a bigginer to openFoam and I want to activate virtualMass force in solver icoLagrangianFoam. so in the file constant/kinematicCloudProperties I enable the force and also add a line to determine Cvm value:
Code:
particleForces
{
    gravity         on;
    virtualMass     on;
    Cvm	            0.5;
    pressureGradient on;
	
}
but I receive the error:
Code:
--> FOAM FATAL ERROR: 
Not implemented
    From function Foam::particleForces::calcCoupled(...) - virtual mass force
    in file particleForces/particleForces.C at line 153.
FOAM aborting
Aborted (core dumped)
the error is related to the following lines of src/lagrangian/intermediate/particleForces/particleForces.C:
Code:
Foam::vector Foam::particleForces::calcCoupled
(
    const label cellI,
    const scalar dt,
    const scalar rhoc,
    const scalar rho,
    const vector& Uc,
    const vector& U
) const
{
    vector Ftot = vector::zero;
    // Virtual mass force
    if (virtualMass_)
    {
        notImplemented
        (
            "Foam::particleForces::calcCoupled(...) - virtual mass force"
        );
//        Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt;
    }
does anyone know what i ave to do?

I thankfuuullly apreciate any help
ali_atrian is offline   Reply With Quote

Old   October 30, 2014, 03:40
Default
  #2
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
some one give me just a small hint pleaseee
in file particleForces.C, I uncommented the line:
Code:
 Ftot += Cvm_*rhoc/rho*d(Uc - U)/dt
but I received the error:
Code:
particleForces/particleForces.C: In member function ‘Foam::vector Foam::particleForces::calcCoupled(Foam::label, Foam::scalar, Foam::scalar, Foam::scalar, const vector&, const vector&) const':
particleForces/particleForces.C:154:39: error: 'd' was not declared in this scope
what shoul i do? is there any toutorial shed lights on my problem
in openfoam 2.3 and 2.1 i didt find any library file including the virtual mass formula as included in foam-exd 3.0 and any other tutorials in foam extend 3.1 lead to the same errors when virtualMass" is "on"
I Greatfuuuly appreciate any help
ali_atrian is offline   Reply With Quote

Old   November 6, 2014, 02:26
Default
  #3
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
no help on virtual mass implemention to foam-exd 3.0??!!
ali_atrian is offline   Reply With Quote

Old   November 6, 2014, 09:15
Default
  #4
New Member
 
Kalyan Peri
Join Date: Aug 2014
Posts: 19
Rep Power: 11
kalyan is on a distinguished road
Hi,

even im struck with VIrtualMass. im using openFoam-2.3.x and defined VirtualMass in particle force as

virtualMass
{
Cvm 0.5;
}


but i get a error :

request for volVectorField U from objectRegistry region0 failed available objects of type volVectorField are 1(U.air).

if i remove virtualMass , then simualtion goes fine.. im not sure what this error is..


Regards,
Kalyan
kalyan is offline   Reply With Quote

Old   November 8, 2014, 11:59
Default
  #5
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
I got where the problem arises from:
I used "src/finiteVolume/finiteVolume/fvc" library and change the virtual mass formulation as:
Code:
Ftot += Cvm_*rhoc/rho*fvc::ddt(Uc-U);
but i found that all the class templates defined in fvcDdt.C have their output formats in something like volVectorField! :
Code:
    template<class Type>
    tmp<GeometricField<Type, fvPatchField, volMesh> > ddt
    (
        const GeometricField<Type, fvPatchField, volMesh>&
    );
while we need 'vector' format for 'Ftot' (in particleForces.C) :

Code:
Foam::vector Foam::particleForces::calcCoupled
(
    const label cellI,
    const scalar dt,
    const scalar rhoc,
    const scalar rho,
    const vector& Uc,
    const vector& U
) const
{
    vector Ftot = vector::zero;
so, we need to define a class template something like:
Code:
   /* template<class Type>
    tmp< vector > ddt
    (
        const vector&
    );
*/
and thats the way we can implement virtual mass force (I think so)
I myself have not ever defined any template so I neglected annny eddition because it seems hard for me to go through this way and now im going to simulate my problem using DPMFoam in OF230
however, I appreciate any comment whether on my findings or about template defenition for this problem
GoOoD LucK
ali_atrian is offline   Reply With Quote

Old   November 8, 2014, 12:05
Default
  #6
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
Quote:
Originally Posted by kalyan View Post
Hi,

even im struck with VIrtualMass. im using openFoam-2.3.x and defined VirtualMass in particle force as

virtualMass
{
Cvm 0.5;
}


but i get a error :

request for volVectorField U from objectRegistry region0 failed available objects of type volVectorField are 1(U.air).

if i remove virtualMass , then simualtion goes fine.. im not sure what this error is..


Regards,
Kalyan

I will be engaged in virtual mass force in OF230 so sooon, (as I mentioned in prior post) so I will talk about that if there be any comment to share with u
ali_atrian is offline   Reply With Quote

Old   November 10, 2014, 04:34
Default
  #7
Member
 
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 93
Rep Power: 15
oswald is on a distinguished road
In order to calculate the virtual mass force, I added a new member to kinematicParcel called "Urelold". As the name suggests, it is the relative velocity between fluid and particle at the previous time step. To calculate d(Uc-Up)/dt, you can then use the old and the current relative velocities and the current time step and you don't need fvc::ddt(Uc-U) anymore.
oswald is offline   Reply With Quote

Old   November 10, 2014, 06:22
Default implementation of acceleration in VM force
  #8
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
Hello Oswald
first of all i really thank you to give me some points
Maybe i can't get what you exactly mean, but :
1) here we nead (Uc-U) not an average between particle and fluid velocities!
2) in the formula, we have to insert the acceleration (not velocity) so why do you say
Quote:
you can then use the old and the current relative velocities
?

- can u explane a bit more on code implementation (the code that u say it can be used instead of
Code:
fvc::ddt(Uc-U)
and does it need any other changes in any other files in libs or solver ??
Best Regards
ali_atrian is offline   Reply With Quote

Old   November 10, 2014, 07:00
Default
  #9
Member
 
Join Date: Sep 2010
Location: Leipzig, Germany
Posts: 93
Rep Power: 15
oswald is on a distinguished road
I hope I got you right. The code fvc::ddt(Uc-U) can be seen as the change of the relative particle velocity (Uc-U) per time, i.e. d(Uc-U)/dt. Approximately this is the same as [(Uc-U)_current - (Uc-U)_old]/deltaT. (Uc-U)_current ist the current difference between particle and velocity fluid and can be calculated with the current values. I simply store this value as the value for (Uc-U)_old for the next time step. The change over time is then simply calculated by dividing the difference of the relative velocities by the current deltaT.

A disadvantage here is that you are not free to choose a different interpolation scheme.

The Urelold-value is stored in the kinematicParcel-class like U, d, rho and so on.
oswald is offline   Reply With Quote

Old   November 11, 2014, 03:16
Default
  #10
Member
 
Alireza Atrian
Join Date: May 2014
Posts: 39
Rep Power: 11
ali_atrian is on a distinguished road
Hello Oswald
I really appreciate all your guidance
Its now clear for me
Best Regards
ali_atrian is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turbulent viscosity ration, Virtual mass KP FLUENT 1 February 20, 2011 14:17
Urgently Need the code of Lift force and VM force Kai Yan Main CFD Forum 0 July 16, 2008 07:07
Virtual mass force? bk Siemens 1 June 5, 2007 04:45
Virtual mass force Glen Main CFD Forum 3 September 2, 2006 10:20
ChannelOodles Correcting driving force for a constant mass flow rate maka OpenFOAM Running, Solving & CFD 3 September 21, 2005 05:18


All times are GMT -4. The time now is 07:27.