diff --git a/doc/CFDEMcoupling_models.txt b/doc/CFDEMcoupling_models.txt index 00ce8e28..073082dd 100644 --- a/doc/CFDEMcoupling_models.txt +++ b/doc/CFDEMcoupling_models.txt @@ -124,6 +124,7 @@ particleDeformation, potentialRelaxation, "surfaceTensionForce"_forceModel_surfaceTensionForce.html, terminalVelocity, +"transferFluidProperties"_forceModel_transferFluidProperties.html, turbulentDispersion, turbulentVelocityFluctuations, "virtualMassForce"_forceModel_virtualMassForce.html, diff --git a/doc/forceModel_transferFluidProperties.txt b/doc/forceModel_transferFluidProperties.txt new file mode 100644 index 00000000..8606da78 --- /dev/null +++ b/doc/forceModel_transferFluidProperties.txt @@ -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 + diff --git a/src/lagrangian/cfdemParticle/Make/files b/src/lagrangian/cfdemParticle/Make/files index 00d33dbd..b0f4449f 100644 --- a/src/lagrangian/cfdemParticle/Make/files +++ b/src/lagrangian/cfdemParticle/Make/files @@ -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 diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/transferFluidProperties/transferFluidProperties.C b/src/lagrangian/cfdemParticle/subModels/forceModel/transferFluidProperties/transferFluidProperties.C new file mode 100644 index 00000000..5c2695d5 --- /dev/null +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/transferFluidProperties/transferFluidProperties.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 . + + 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("fluidDensity",1); + particleCloud_.registerParticleProperty("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("fluidDensity"); + double**& fluidViscosity_ = particleCloud_.getParticlePropertyRef("fluidViscosity"); + + const volScalarField& rhoField = forceSubM(0).rhoField(); + const volScalarField& nufField = forceSubM(0).nuField(); + + interpolationCellPoint rhoInterpolator_(rhoField); + interpolationCellPoint 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 + +// ************************************************************************* // diff --git a/src/lagrangian/cfdemParticle/subModels/forceModel/transferFluidProperties/transferFluidProperties.H b/src/lagrangian/cfdemParticle/subModels/forceModel/transferFluidProperties/transferFluidProperties.H new file mode 100644 index 00000000..1dc52f85 --- /dev/null +++ b/src/lagrangian/cfdemParticle/subModels/forceModel/transferFluidProperties/transferFluidProperties.H @@ -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 . + + 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 + +// ************************************************************************* // diff --git a/src/lagrangian/cfdemParticleComp/Make/files b/src/lagrangian/cfdemParticleComp/Make/files index 2907a3ea..dfccc6e6 100644 --- a/src/lagrangian/cfdemParticleComp/Make/files +++ b/src/lagrangian/cfdemParticleComp/Make/files @@ -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