Skip to content

Commit

Permalink
Solved not working fvModels, solved plot comparison errors
Browse files Browse the repository at this point in the history
  • Loading branch information
GiordiR committed Apr 15, 2022
1 parent f8c7327 commit 15c758a
Show file tree
Hide file tree
Showing 5 changed files with 226 additions and 237 deletions.
173 changes: 173 additions & 0 deletions bubbleColumnDegass/constant/fvModels
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
#};
}


// ************************************************************************* //

207 changes: 0 additions & 207 deletions bubbleColumnDegass/constant/fvModels_aaa

This file was deleted.

Loading

0 comments on commit 15c758a

Please sign in to comment.