mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
Merge pull request #137 from tmjnijssen/feature/lubrication
Feature/lubrication
This commit is contained in:
@ -124,6 +124,7 @@ particleDeformation,
|
||||
potentialRelaxation,
|
||||
"surfaceTensionForce"_forceModel_surfaceTensionForce.html,
|
||||
terminalVelocity,
|
||||
"transferFluidProperties"_forceModel_transferFluidProperties.html,
|
||||
turbulentDispersion,
|
||||
turbulentVelocityFluctuations,
|
||||
"virtualMassForce"_forceModel_virtualMassForce.html,
|
||||
|
||||
42
doc/forceModel_transferFluidProperties.txt
Normal file
42
doc/forceModel_transferFluidProperties.txt
Normal file
@ -0,0 +1,42 @@
|
||||
"CFDEMproject Website"_lws - "Main Page"_main :c
|
||||
|
||||
:link(lws,http://www.cfdem.com)
|
||||
:link(main,CFDEMcoupling_Manual.html)
|
||||
|
||||
:line
|
||||
|
||||
forceModel transferFluidProperties command :h3
|
||||
|
||||
[Syntax:]
|
||||
|
||||
Defined in "couplingProperties"_CFDEMcoupling_dicts.html#couplingProperties
|
||||
dictionary.
|
||||
|
||||
forceModels
|
||||
(
|
||||
transferFluidProperties
|
||||
);
|
||||
transferFluidPropertiesProps
|
||||
\{
|
||||
verbose switch1;
|
||||
interpolation switch2;
|
||||
\} :pre
|
||||
|
||||
{switch1} = (optional, default false) sub model switch, see "forceSubModel"_forceSubModel.html for details :ulb,l
|
||||
{switch2} = (optional, default false) sub model switch, see "forceSubModel"_forceSubModel.html for details :l
|
||||
:ule
|
||||
|
||||
[Description:]
|
||||
|
||||
This "force model" does not influence the particles or the flow - it transfer to fluid density and (dynamic)
|
||||
viscosity from OpenFOAM to LIGGGHTS.
|
||||
|
||||
|
||||
[Restrictions:]
|
||||
|
||||
This model requires {fix cfd/coupling/fluidproperties} to work.
|
||||
|
||||
[Related commands:]
|
||||
|
||||
"forceModel"_forceModel.html
|
||||
|
||||
@ -96,6 +96,7 @@ $(forceModels)/potentialRelaxation/potentialRelaxation.C
|
||||
$(forceModels)/BeetstraDrag/BeetstraDrag.C
|
||||
$(forceModels)/BeetstraDragPoly/BeetstraDragPoly.C
|
||||
$(forceModels)/dSauter/dSauter.C
|
||||
$(forceModels)/transferFluidProperties/transferFluidProperties.C
|
||||
$(forceModels)/Fines/Fines.C
|
||||
$(forceModels)/Fines/FinesFields.C
|
||||
$(forceModels)/Fines/FanningDynFines.C
|
||||
|
||||
@ -0,0 +1,129 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
License
|
||||
This is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
|
||||
|
||||
Description
|
||||
transfer fluid properties to LIGGGHTS
|
||||
|
||||
SourceFiles
|
||||
transferFluidProperties.C
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "error.H"
|
||||
|
||||
#include "transferFluidProperties.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(transferFluidProperties, 0);
|
||||
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
forceModel,
|
||||
transferFluidProperties,
|
||||
dictionary
|
||||
);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
// Construct from components
|
||||
transferFluidProperties::transferFluidProperties
|
||||
(
|
||||
const dictionary& dict,
|
||||
cfdemCloud& sm
|
||||
)
|
||||
:
|
||||
forceModel(dict,sm),
|
||||
propsDict_(dict.subDict(typeName + "Props"))
|
||||
{
|
||||
particleCloud_.registerParticleProperty<double**>("fluidDensity",1);
|
||||
particleCloud_.registerParticleProperty<double**>("fluidViscosity",1);
|
||||
|
||||
// init force sub model
|
||||
setForceSubModels(propsDict_);
|
||||
// define switches which can be read from dict
|
||||
forceSubM(0).setSwitchesList(SW_VERBOSE,true); // activate search for verbose switch
|
||||
forceSubM(0).setSwitchesList(SW_INTERPOLATION,true); // activate search for interpolate switch
|
||||
forceSubM(0).readSwitches();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
transferFluidProperties::~transferFluidProperties()
|
||||
{
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * public Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void transferFluidProperties::setForce() const
|
||||
{
|
||||
double**& fluidDensity_ = particleCloud_.getParticlePropertyRef<double**>("fluidDensity");
|
||||
double**& fluidViscosity_ = particleCloud_.getParticlePropertyRef<double**>("fluidViscosity");
|
||||
|
||||
const volScalarField& rhoField = forceSubM(0).rhoField();
|
||||
const volScalarField& nufField = forceSubM(0).nuField();
|
||||
|
||||
interpolationCellPoint<scalar> rhoInterpolator_(rhoField);
|
||||
interpolationCellPoint<scalar> nufInterpolator_(nufField);
|
||||
|
||||
label cellI = 0;
|
||||
double rho = 0.;
|
||||
double nuf = 0.;
|
||||
vector position(0,0,0);
|
||||
|
||||
for(int index = 0; index < particleCloud_.numberOfParticles(); ++index)
|
||||
{
|
||||
cellI = particleCloud_.cellIDs()[index][0];
|
||||
if (cellI >= 0)
|
||||
{
|
||||
if(forceSubM(0).interpolation())
|
||||
{
|
||||
position = particleCloud_.position(index);
|
||||
rho = rhoInterpolator_.interpolate(position,cellI);
|
||||
nuf = nufInterpolator_.interpolate(position,cellI);
|
||||
}
|
||||
else
|
||||
{
|
||||
rho = rhoField[cellI];
|
||||
nuf = nufField[cellI];
|
||||
}
|
||||
|
||||
fluidDensity_[index][0] = rho;
|
||||
fluidViscosity_[index][0] = nuf*rho;
|
||||
}
|
||||
}
|
||||
|
||||
particleCloud_.dataExchangeM().giveData("fluidDensity","scalar-atom",fluidDensity_);
|
||||
particleCloud_.dataExchangeM().giveData("fluidViscosity","scalar-atom",fluidViscosity_);
|
||||
|
||||
if (forceSubM(0).verbose()) Info << "give data done" << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,79 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
License
|
||||
This is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this code. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Copyright (C) 2015- Thomas Lichtenegger, JKU Linz, Austria
|
||||
|
||||
Description
|
||||
transfer fluid properties to LIGGGHTS
|
||||
|
||||
SourceFiles
|
||||
transferFluidProperties.C
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef transferFluidProperties_H
|
||||
#define transferFluidProperties_H
|
||||
|
||||
#include "forceModel.H"
|
||||
#include "interpolationCellPoint.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class transferFluidProperties Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class transferFluidProperties
|
||||
:
|
||||
public forceModel
|
||||
{
|
||||
private:
|
||||
|
||||
dictionary propsDict_;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("transferFluidProperties");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
transferFluidProperties
|
||||
(
|
||||
const dictionary& dict,
|
||||
cfdemCloud& sm
|
||||
);
|
||||
|
||||
// Destructor
|
||||
|
||||
~transferFluidProperties();
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setForce() const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -90,6 +90,7 @@ $(forceModels)/directedDiffusiveRelaxation/directedDiffusiveRelaxation.C
|
||||
$(forceModels)/BeetstraDrag/BeetstraDrag.C
|
||||
$(forceModels)/BeetstraDragPoly/BeetstraDragPoly.C
|
||||
$(forceModels)/dSauter/dSauter.C
|
||||
$(forceModels)/transferFluidProperties/transferFluidProperties.C
|
||||
$(forceModels)/Fines/Fines.C
|
||||
$(forceModels)/Fines/FinesFields.C
|
||||
$(forceModels)/Fines/FanningDynFines.C
|
||||
|
||||
Reference in New Issue
Block a user