Merge branch 'feature/cfdemSolverRhoPimple' of https://github.com/ParticulateFlow/CFDEMcoupling into feature/cfdemSolverRhoPimple
This commit is contained in:
@ -17,10 +17,10 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
|
||||
forAll(Y, i)
|
||||
{
|
||||
if (Y[i].name() != inertSpecie)
|
||||
if (Y[i].name() != inertSpecie || ignoreInertSpecie)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
|
||||
|
||||
fvScalarMatrix YiEqn
|
||||
(
|
||||
fvm::ddt(rhoeps, Yi)
|
||||
@ -52,6 +52,17 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
||||
// calculate total mole in Volume
|
||||
N = rho/W;
|
||||
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
if (ignoreInertSpecie)
|
||||
{
|
||||
forAll(Y,i)
|
||||
{
|
||||
volScalarField& Yi = Y[i];
|
||||
Yi = Yi/Yt;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Y[inertIndex] = scalar(1) - Yt;
|
||||
Y[inertIndex].max(0.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +119,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
#include "rhoEqn.H"
|
||||
}
|
||||
volScalarField rhoeps("rhoeps",rho*voidfraction);
|
||||
|
||||
rhoeps = rho * voidfraction;
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
@ -133,7 +134,7 @@ int main(int argc, char *argv[])
|
||||
#include "pEqn.H"
|
||||
rhoeps=rho*voidfraction;
|
||||
}
|
||||
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
|
||||
@ -20,6 +20,8 @@
|
||||
// read molecular weight
|
||||
volScalarField W(composition.W());
|
||||
|
||||
bool ignoreInertSpecie = true;
|
||||
|
||||
const word inertSpecie(thermo.lookup("inertSpecie"));
|
||||
|
||||
if (!composition.contains(inertSpecie))
|
||||
@ -98,6 +100,19 @@
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
volScalarField rhoeps
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rhoeps",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
rho*voidfraction
|
||||
);
|
||||
|
||||
Info<< "\nCreating fluid-particle heat flux field\n" << endl;
|
||||
volScalarField Qsource
|
||||
|
||||
@ -48,8 +48,8 @@ else
|
||||
+ fvc::div(phi)
|
||||
- fvm::laplacian(rhorAUf, p)
|
||||
==
|
||||
// particleCloud.chemistryM(0).Sm()
|
||||
fvOptions(psi, p, rho.name())
|
||||
particleCloud.chemistryM(0).Sm()
|
||||
+ fvOptions(psi, p, rho.name())
|
||||
);
|
||||
|
||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
fvm::ddt(voidfraction,rho)
|
||||
+ fvc::div(phi)
|
||||
==
|
||||
// particleCloud.chemistryM(0).Sm()
|
||||
fvOptions(rho)
|
||||
particleCloud.chemistryM(0).Sm()
|
||||
+ fvOptions(rho)
|
||||
);
|
||||
|
||||
fvOptions.constrain(rhoEqn);
|
||||
|
||||
@ -59,84 +59,50 @@ noChemistry::~noChemistry()
|
||||
void noChemistry::execute()
|
||||
{}
|
||||
|
||||
void noChemistry::tryout(const label i)
|
||||
{
|
||||
mi_.set
|
||||
(
|
||||
i,
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"empty1",
|
||||
particleCloud_.mesh().time().timeName(),
|
||||
particleCloud_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
particleCloud_.mesh(),
|
||||
dimensionedScalar("zero",dimless,0.0)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
tmp<volScalarField> noChemistry ::Smi(const label i) const
|
||||
{
|
||||
return tmp<volScalarField> (mi_[i]);
|
||||
}
|
||||
|
||||
/* tmp<volScalarField> mi_[i]
|
||||
tmp<volScalarField> smi
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"empty1",
|
||||
"dummy",
|
||||
particleCloud_.mesh().time().timeName(),
|
||||
particleCloud_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
particleCloud_.mesh(),
|
||||
dimensionedScalar
|
||||
(
|
||||
"zero",
|
||||
dimMass/dimTime,//dimensionSet(0,2,-1,0,0,0,0),
|
||||
0.0
|
||||
)
|
||||
)
|
||||
),
|
||||
particleCloud_.mesh(),
|
||||
dimensionedScalar("zero",dimMass/(dimVol*dimTime),0.0)
|
||||
)
|
||||
);
|
||||
|
||||
return mi_[i];
|
||||
}*/
|
||||
return smi;
|
||||
}
|
||||
|
||||
tmp<volScalarField> noChemistry::Sm() const
|
||||
{
|
||||
tmp<volScalarField> sm_
|
||||
tmp<volScalarField> sm
|
||||
(
|
||||
new volScalarField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"empty2",
|
||||
"dummy",
|
||||
particleCloud_.mesh().time().timeName(),
|
||||
particleCloud_.mesh(),
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
particleCloud_.mesh(),
|
||||
dimensionedScalar("zero",dimless,0.0)
|
||||
),
|
||||
particleCloud_.mesh(),
|
||||
dimensionedScalar("zero",dimMass/(dimVol*dimTime), 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
return sm_;
|
||||
return sm;
|
||||
}
|
||||
|
||||
|
||||
/*tmp<Foam::fvScalarMatrix> noChemistry::Smi(const label i) const
|
||||
tmp<Foam::fvScalarMatrix> noChemistry::Sm() const*/
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -41,9 +41,6 @@ class noChemistry
|
||||
:
|
||||
public chemistryModel
|
||||
{
|
||||
private:
|
||||
PtrList<volScalarField> mi_;
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -68,12 +65,6 @@ public:
|
||||
|
||||
void execute();
|
||||
|
||||
// tmp<fvScalarMatrix> Smi(const label i) const;
|
||||
|
||||
// tmp<fvScalarMatrix> Sm() const;
|
||||
|
||||
virtual void tryout(const label i);
|
||||
|
||||
tmp<volScalarField> Smi(const label i) const;
|
||||
|
||||
tmp<volScalarField> Sm() const;
|
||||
|
||||
@ -101,7 +101,7 @@ species::species
|
||||
N_(sm.mesh().lookupObject<volScalarField>(totalMoleFieldName_)),
|
||||
partMoleName_(propsDict_.lookup("partMoleName")),
|
||||
partN_(NULL),
|
||||
loopCounter_(0),
|
||||
loopCounter_(-1),
|
||||
Nevery_(propsDict_.lookupOrDefault<label>("Nevery",1))
|
||||
{
|
||||
Info << " Read species list from: " << specDict_.name() << endl;
|
||||
@ -137,7 +137,7 @@ species::species
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh_,
|
||||
dimensionedScalar("0",dimMass/(dimVol*dimTime), 0)
|
||||
dimensionedScalar("zero",dimMass/(dimVol*dimTime), 0.0)
|
||||
)
|
||||
);
|
||||
|
||||
@ -211,7 +211,6 @@ void species::execute()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// realloc the arrays
|
||||
reAllocMyArrays();
|
||||
|
||||
@ -252,13 +251,11 @@ void species::execute()
|
||||
rhofluid = rho_[cellI];
|
||||
voidfraction = voidfraction_[cellI];
|
||||
Nfluid = N_[cellI];
|
||||
|
||||
for (int i = 0; i<speciesNames_.size();i++)
|
||||
{
|
||||
Yfluid_[i] = Y_[i][cellI];
|
||||
}
|
||||
}
|
||||
|
||||
//fill arrays
|
||||
partTemp_[index][0] = Tfluid;
|
||||
// partRho was filled with rhofluid*voidfraction before
|
||||
@ -324,7 +321,7 @@ void species::execute()
|
||||
changeOfSpeciesMassFields_[i].primitiveFieldRef() /= (changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep);
|
||||
changeOfSpeciesMassFields_[i].correctBoundaryConditions();
|
||||
changeOfGasMassField_ += changeOfSpeciesMassFields_[i];
|
||||
Info << "total conversion of species" << speciesNames_[i] << " = " << gSum(changeOfSpeciesMassFields_[i]*1.0*changeOfSpeciesMassFields_[i].mesh().V()) << endl;
|
||||
Info << "total conversion of species" << speciesNames_[i] << " = " << gSum(changeOfSpeciesMassFields_[i]*1.0*changeOfSpeciesMassFields_[i].mesh().V() * Nevery_ * timestep) << endl;
|
||||
}
|
||||
Info << "get data done" << endl;
|
||||
}
|
||||
|
||||
@ -135,11 +135,6 @@ public:
|
||||
|
||||
void reAllocMyArrays() const;
|
||||
|
||||
// tmp<fvScalarMatrix> Smi(const label i) const;
|
||||
//tmp<fvScalarMatrix> Smi(const label i, volScalarField& changeOfSpeciesMassFields_) const;
|
||||
|
||||
// tmp<fvScalarMatrix> Sm() const;
|
||||
|
||||
tmp <volScalarField> Smi(const label i) const;
|
||||
|
||||
tmp <volScalarField> Sm() const;
|
||||
|
||||
@ -38,7 +38,8 @@ boundaryField
|
||||
|
||||
inlet
|
||||
{
|
||||
type zeroGradient;
|
||||
type fixedValue;
|
||||
value uniform 0.0;
|
||||
}
|
||||
|
||||
outlet
|
||||
|
||||
@ -38,7 +38,8 @@ boundaryField
|
||||
|
||||
inlet
|
||||
{
|
||||
type zeroGradient;
|
||||
type fixedValue;
|
||||
value uniform 1.0;
|
||||
}
|
||||
|
||||
outlet
|
||||
|
||||
@ -17,32 +17,37 @@ FoamFile
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0.0 0 0);
|
||||
internalField uniform (1.0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
// Walls in no slip condition
|
||||
top
|
||||
{
|
||||
type zeroGradient;
|
||||
type fixedValue;
|
||||
value uniform (0.0 0 0);
|
||||
}
|
||||
bottom
|
||||
{
|
||||
type zeroGradient;
|
||||
type fixedValue;
|
||||
value uniform (0.0 0 0);
|
||||
}
|
||||
side-walls
|
||||
{
|
||||
type zeroGradient;
|
||||
type fixedValue;
|
||||
value uniform (0.0 0 0);
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0.0 0 0);
|
||||
value uniform (1.0 0 0);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
// type fixedValue;
|
||||
// value uniform (0.0 0 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -111,6 +111,7 @@ speciesProps
|
||||
partMoleName "partN";
|
||||
pressureFieldName "p";
|
||||
partPName "partP";
|
||||
Nevery 10;
|
||||
}
|
||||
|
||||
SyamlalThermCondProps
|
||||
|
||||
@ -31,7 +31,7 @@ vertices
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7)(13 4 4) simpleGrading (1 1 1)
|
||||
hex (0 1 2 3 4 5 6 7)(29 9 9) simpleGrading (1 1 1)
|
||||
|
||||
);
|
||||
|
||||
|
||||
@ -17,19 +17,19 @@ FoamFile
|
||||
|
||||
application cfdemSolverRhoPimpleChem;
|
||||
|
||||
startFrom latestTime;
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 0.5;
|
||||
endTime 20.0;
|
||||
|
||||
deltaT 0.0001;
|
||||
|
||||
writeControl adjustableRunTime;
|
||||
writeControl timeStep;
|
||||
|
||||
writeInterval 0.005;
|
||||
writeInterval 10000;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
@ -53,14 +53,60 @@ maxDeltaT 0.1;
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
/* libs (
|
||||
"libsimpleFunctionObjects.so"
|
||||
libs (
|
||||
// "libsimpleFunctionObjects.so"
|
||||
"libfieldFunctionObjects.so"
|
||||
);
|
||||
|
||||
functions
|
||||
{
|
||||
Average-O2
|
||||
{
|
||||
probes1
|
||||
{
|
||||
type probes;
|
||||
|
||||
functionObjectLibs ("libsampling.so");
|
||||
|
||||
#include "probesDict";
|
||||
}
|
||||
|
||||
globalMassFrac
|
||||
{
|
||||
type volRegion;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
writeControl timeStep;//outputTime;
|
||||
writeInterval 1;
|
||||
log true;
|
||||
writeFields false;
|
||||
regionType all;
|
||||
name c0;
|
||||
operation weightedVolAverage;
|
||||
weightField rhoeps;
|
||||
fields
|
||||
(
|
||||
O2
|
||||
CO2
|
||||
N2
|
||||
);
|
||||
}
|
||||
|
||||
globalMass
|
||||
{
|
||||
type volRegion;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
writeControl timeStep;//outputTime;
|
||||
writeInterval 1;
|
||||
log true;
|
||||
writeFields false;
|
||||
regionType all;
|
||||
name c1;
|
||||
operation volIntegrate;
|
||||
fields
|
||||
(
|
||||
rhoeps
|
||||
);
|
||||
}
|
||||
|
||||
/* Average-O2
|
||||
{
|
||||
type fieldAverage;
|
||||
functionObjectLibs ( "libfieldFunctionObjects.so" );
|
||||
@ -139,10 +185,9 @@ functions
|
||||
(
|
||||
CO2
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
} */
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
|
||||
@ -15,14 +15,14 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
numberOfSubdomains 4;
|
||||
numberOfSubdomains 2;
|
||||
|
||||
//method scotch;
|
||||
method simple;
|
||||
|
||||
simpleCoeffs
|
||||
{
|
||||
n (2 2 1);
|
||||
n (2 1 1);
|
||||
delta 0.001;
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ boundary f f f
|
||||
newton off
|
||||
|
||||
units si
|
||||
processors 2 2 1
|
||||
processors 2 1 1
|
||||
|
||||
region reg block 0. 15. 0. 5. 0. 5. units box
|
||||
create_box 1 reg
|
||||
@ -40,7 +40,7 @@ fix zwalls1 all wall/gran model hertz tangential history primitive type 1 zp
|
||||
fix zwalls2 all wall/gran model hertz tangential history primitive type 1 zplane 5.0
|
||||
|
||||
# create single particle in a specific spot
|
||||
create_atoms 1 single 7.5 2 2 units box
|
||||
create_atoms 1 single 7.5 2.5 2.5 units box
|
||||
set atom 1 diameter 0.2 density 2267 vx 0 vy 0 vz 0
|
||||
|
||||
# particle distributions and insertion
|
||||
|
||||
@ -10,10 +10,11 @@ boundary f f f
|
||||
newton off
|
||||
|
||||
units si
|
||||
processors 2 2 1
|
||||
processors 2 1 1
|
||||
|
||||
# read the restart file
|
||||
read_restart ../DEM/post/restart/liggghts.restart
|
||||
reset_timestep 0
|
||||
|
||||
neighbor 0.0005 bin
|
||||
neigh_modify delay 0 binsize 0.01
|
||||
@ -52,7 +53,7 @@ fix cfd3 all couple/cfd/chemistry n_species 3 species_names O2 CO2 N2
|
||||
|
||||
# this should shrink the particle
|
||||
#fix cfd4 all chem/shrink speciesA O2 molMassA 31.99 speciesC CO2 molMassC 44.01 molMassB 12.01 k 2.5e3 rdef 0.2
|
||||
fix cfd4 all chem/shrink speciesA O2 molMassA 31.99 speciesC CO2 molMassC 44.01 molMassB 12.01 k 2.5e3 rmin 0.005
|
||||
fix cfd4 all chem/shrink speciesA O2 molMassA 31.99 speciesC CO2 molMassC 44.01 molMassB 12.01 k 2.5e1 rmin 0.005 nevery 1000
|
||||
|
||||
# apply nve integration to all particles that are inserted as single particles
|
||||
fix integr all nve/sphere
|
||||
|
||||
0
tutorials/cfdemSolverRhoPimpleChem/Shrinking_particle_model/DEM/post/restart/.gitignore
vendored
Normal file
0
tutorials/cfdemSolverRhoPimpleChem/Shrinking_particle_model/DEM/post/restart/.gitignore
vendored
Normal file
@ -19,7 +19,7 @@ logpath=$casePath
|
||||
headerText="Particle_in_Duct"
|
||||
logfileName="log_$headerText"
|
||||
solverName="cfdemSolverRhoPimpleChem"
|
||||
nrProcs="4"
|
||||
nrProcs="2"
|
||||
machineFileName="none" # yourMachinefileName | none
|
||||
debugMode="off" # on | off| strict
|
||||
testHarnessPath="$CFDEM_TEST_HARNESS_PATH"
|
||||
|
||||
@ -20,7 +20,7 @@ logpath="$casePath"
|
||||
headerText="run_liggghts_init_DEM"
|
||||
logfileName="log_$headerText"
|
||||
solverName="in.liggghts_init"
|
||||
nrProcs=4
|
||||
nrProcs=2
|
||||
machineFileName="none"
|
||||
debugMode="off"
|
||||
#--------------------------------------------------------------------------------#
|
||||
|
||||
Reference in New Issue
Block a user