mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Adding check for density < VSMALL to avoid FPE.
Modifying nanoNozzle tutorial to shorten the run and increase the density.
This commit is contained in:
@ -548,6 +548,15 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
zoneDict.lookup("numberDensity")
|
||||
);
|
||||
|
||||
if (numberDensity < VSMALL)
|
||||
{
|
||||
WarningIn("moleculeCloud::initialiseMolecules")
|
||||
<< "numberDensity too small, not filling zone "
|
||||
<< zone.name() << endl;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
latticeCellScale = pow
|
||||
(
|
||||
latticeIds.size()/(det(latticeCellShape)*numberDensity),
|
||||
@ -572,6 +581,16 @@ void Foam::moleculeCloud::initialiseMolecules
|
||||
zoneDict.lookup("massDensity")
|
||||
);
|
||||
|
||||
if (massDensity < VSMALL)
|
||||
{
|
||||
WarningIn("moleculeCloud::initialiseMolecules")
|
||||
<< "massDensity too small, not filling zone "
|
||||
<< zone.name() << endl;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
latticeCellScale = pow
|
||||
(
|
||||
unitCellMass/(det(latticeCellShape)*massDensity),
|
||||
|
||||
@ -20,7 +20,7 @@ startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 1e-10;
|
||||
endTime 5e-12;
|
||||
|
||||
deltaT 1e-15;
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ FoamFile
|
||||
|
||||
sectionA
|
||||
{
|
||||
massDensity 980;
|
||||
massDensity 1004;
|
||||
temperature 298;
|
||||
bulkVelocity (0.0 0.0 0.0);
|
||||
latticeIds
|
||||
@ -46,7 +46,7 @@ sectionA
|
||||
|
||||
sectionB
|
||||
{
|
||||
massDensity 980;
|
||||
massDensity 1004;
|
||||
temperature 298;
|
||||
bulkVelocity (0.0 0.0 0.0);
|
||||
latticeIds
|
||||
@ -65,7 +65,7 @@ sectionB
|
||||
|
||||
sectionC
|
||||
{
|
||||
massDensity 980;
|
||||
massDensity 1004;
|
||||
temperature 298;
|
||||
bulkVelocity (0.0 0.0 0.0);
|
||||
latticeIds
|
||||
|
||||
Reference in New Issue
Block a user