forked from GiordiR/BubbleColumn_OpenFOAM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solved not working fvModels, solved plot comparison errors
- Loading branch information
Showing
5 changed files
with
226 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,173 @@ | ||
/*--------------------------------*- C++ -*----------------------------------*\ | ||
| ========= | | | ||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | ||
| \\ / O peration | Version: 3.0.0 | | ||
| \\ / A nd | Web: www.OpenFOAM.org | | ||
| \\/ M anipulation | | | ||
\*---------------------------------------------------------------------------*/ | ||
FoamFile | ||
{ | ||
version 2.0; | ||
format ascii; | ||
class dictionary; | ||
location "constant"; | ||
object fvOptions; | ||
} | ||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
degassingMassSource | ||
{ | ||
type coded; | ||
active yes; | ||
selectionMode all; | ||
field thermo:rho.air; | ||
|
||
name degassingMassSource; | ||
patches (outlet); | ||
rhoName thermo:rho.air; | ||
alphaName alpha.air; | ||
|
||
codeInclude | ||
#{ | ||
#include "fvm.H" | ||
#}; | ||
|
||
codeAddRhoSup | ||
#{ | ||
|
||
Info << "**codeAddSup**" << endl; | ||
|
||
|
||
// Get the names of the patches on which to apply the degassing forces | ||
DynamicList<word, 1, 0> patches; | ||
coeffs().lookup("patches") >> patches; | ||
|
||
// Get the required fields | ||
const word rhoName = coeffs().lookup("rhoName"); | ||
const volScalarField& rhoAir = mesh().lookupObject<volScalarField>(rhoName); | ||
const word alphaName = coeffs().lookup("alphaName"); | ||
const volScalarField& alphaAir = mesh().lookupObject<volScalarField>(alphaName); | ||
|
||
// Get the timestep | ||
const scalar deltaT = mesh().time().deltaT().value(); | ||
|
||
// Create degassing mass source coefficient and initialize to zero | ||
volScalarField degassingMassSourceCoeff | ||
( | ||
IOobject | ||
( | ||
"degassingMassSourceCoeff", | ||
mesh().time().timeName(), | ||
mesh(), | ||
IOobject::NO_READ, | ||
IOobject::AUTO_WRITE | ||
), | ||
mesh(), | ||
dimensionedScalar("degassingMassSourceCoeff", dimless/dimTime, 0.0) | ||
); | ||
|
||
// Compute the degassing mass source coefficient for each cell adjacent to the selected patches | ||
forAll(patches, iPatch) | ||
{ | ||
// Get the boundary patch | ||
const fvPatch& patch = mesh().boundary()[patches[iPatch]]; | ||
|
||
// Loop through each boundary face and compute degassing force coefficient in adjacent cell | ||
forAll(patch, iFace) | ||
{ | ||
label iCell = patch.faceCells()[iFace]; | ||
degassingMassSourceCoeff[iCell] = -alphaAir[iCell]/deltaT; | ||
} | ||
} | ||
|
||
// Add the degassing force term | ||
eqn += fvm::Sp(degassingMassSourceCoeff, rhoAir); | ||
#}; | ||
|
||
codeOptions | ||
#{ | ||
-I$(LIB_SRC)/finiteVolume/lnInclude \ | ||
-I$(LIB_SRC)/meshTools/lnInclude | ||
#}; | ||
|
||
} | ||
|
||
|
||
degassingForce | ||
{ | ||
type coded; | ||
active yes; | ||
selectionMode all; | ||
field U.air; | ||
name degassingForce; | ||
patches (outlet); | ||
rhoName thermo:rho.air; | ||
alphaName alpha.air; | ||
UName U.air; | ||
|
||
|
||
codeInclude | ||
#{ | ||
#include "fvm.H" | ||
#}; | ||
|
||
codeAddRhoSup | ||
#{ | ||
// Get the names of the patches on which to apply the degassing forces | ||
DynamicList<word, 1, 0> patches; | ||
coeffs().lookup("patches") >> patches; | ||
|
||
// Get the required fields | ||
const word rhoName = coeffs().lookup("rhoName"); | ||
const volScalarField& rhoAir = mesh().lookupObject<volScalarField>(rhoName); | ||
const word alphaName = coeffs().lookup("alphaName"); | ||
const volScalarField& alphaAir = mesh().lookupObject<volScalarField>(alphaName); | ||
const word UName = coeffs().lookup("UName"); | ||
const volVectorField& UAir = mesh().lookupObject<volVectorField>(UName); | ||
|
||
// Get the timestep | ||
const scalar deltaT = mesh().time().deltaT().value(); | ||
|
||
// Create degassing force coefficient and initialize to zero | ||
volScalarField degassingForceCoeff | ||
( | ||
IOobject | ||
( | ||
"degassingForceCoeff", | ||
mesh().time().timeName(), | ||
mesh(), | ||
IOobject::NO_READ, | ||
IOobject::AUTO_WRITE | ||
), | ||
mesh(), | ||
dimensionedScalar("degassingForceCoeff", dimDensity/dimTime, 0.0) | ||
); | ||
|
||
// Compute the degassing force coefficient for each cell adjacent to the selected patches | ||
forAll(patches, iPatch) | ||
{ | ||
// Get the boundary patch | ||
const fvPatch& patch = mesh().boundary()[patches[iPatch]]; | ||
|
||
// Loop through each boundary face and compute degassing force coefficient in adjacent cell | ||
forAll(patch, iFace) | ||
{ | ||
label iCell = patch.faceCells()[iFace]; | ||
degassingForceCoeff[iCell] = -rhoAir[iCell]*alphaAir[iCell]/deltaT; | ||
} | ||
} | ||
|
||
// Add the degassing force term | ||
eqn += fvm::Sp(degassingForceCoeff, UAir); | ||
#}; | ||
|
||
codeOptions | ||
#{ | ||
-I$(LIB_SRC)/finiteVolume/lnInclude \ | ||
-I$(LIB_SRC)/meshTools/lnInclude | ||
#}; | ||
} | ||
|
||
|
||
// ************************************************************************* // | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.