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

what does kinematicCloud.SU(Uc) return?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 17, 2022, 10:37
Default what does kinematicCloud.SU(Uc) return?
  #1
Member
 
Huan Zhang
Join Date: Nov 2020
Posts: 55
Rep Power: 5
Jasper Z is on a distinguished road
Dear all,

I want to know what does the momentum source function return when we call it which is defined in KinematicCloudI.H:

Code:
template<class CloudType>
 inline Foam::tmp<Foam::fvVectorMatrix>
 Foam::KinematicCloud<CloudType>::SU(volVectorField& U, bool incompressible)
 const
 {
     if (debug)
     {
         Pout<< "UTrans min/max = " << min(UTrans()).value() << ", "
             << max(UTrans()).value() << nl
             << "UCoeff min/max = " << min(UCoeff()).value() << ", "
             << max(UCoeff()).value() << endl;
     }
  
     dimensionSet dim(dimForce);
     if (incompressible)
     {
         dim.reset(dimForce/dimDensity);
     }
  
     if (solution_.coupled())
     {
         if (solution_.semiImplicit("U"))
         {
             volScalarField::Internal
                 Vdt(mesh_.V()*this->db().time().deltaT());
  
             if (incompressible)
             {
                 Vdt.dimensions() *= dimDensity;
             }
  
             return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
         }
         else
         {
             tmp<fvVectorMatrix> tfvm(new fvVectorMatrix(U, dim));
             fvVectorMatrix& fvm = tfvm.ref();
  
             fvm.source() = -UTrans()/(this->db().time().deltaT());
  
             return tfvm;
         }
     }
  
     return tmp<fvVectorMatrix>::New(U, dim);
 }
If I use semiImplicit, does it return
Code:
UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U
or
Code:
tmp<fvVectorMatrix>::New(U, dim)
?
I think the code returns the latter, so what does
Code:
tmp<fvVectorMatrix>::New(U, dim)
mean?

Kind regards,
Jasper
Jasper Z 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
No matching function error: Phase change source term added to interMixingFoam wavefunction OpenFOAM Programming & Development 2 February 4, 2022 07:46
Warning:no return statement in function returning non-void [-Wreturn-type] 3014214149 OpenFOAM Programming & Development 1 January 19, 2021 11:40
undefined reference to a C++'s class member function linyanx OpenFOAM Programming & Development 5 May 12, 2017 12:44
error adding void fraction into the solver & Error when chemistry is on cmigueis OpenFOAM Programming & Development 23 August 14, 2016 14:53
Missing math.h header Travis FLUENT 4 January 15, 2009 11:48


All times are GMT -4. The time now is 04:34.