Code documentation

phaseFieldFoam call graph

Call graph for phaseFieldFoam tutorial

Call graph for phaseFieldFoam tutorial.

Doxygen documentation

class anisotropySource : public fvModel
#include <anisotropySource.H>

Model for applying the anistropy source.

Usage

Example usage:

anisotropySource
{
    type            anisotropySource;

    selectionMode   all;

    tau             0.0003;
    kappa1          0.9;
    kappa2          20;

}

Public Functions

TypeName ("anisotropySource")

Runtime type information.

anisotropySource(const word &name, const word &modelType, const dictionary &dict, const fvMesh &mesh)

Construct from dictionary.

virtual ~anisotropySource()

Destructor.

inline const scalar &tau() const
inline const scalar &kappa1() const
inline const scalar &kappa2() const
virtual wordList addSupFields() const

Return the list of fields for which the fvModel adds source term.

to the transport equation

virtual void addSup(fvMatrix<scalar> &eqn, const word &fieldName) const

Add implicit contribution to equation.

virtual bool movePoints()

Update for mesh motion.

virtual void topoChange(const polyTopoChangeMap&)

Update topology using the given map.

virtual void mapMesh(const polyMeshMap&)

Update from another mesh using the given map.

virtual void distribute(const polyDistributionMap&)

Redistribute or update using the given distribution map.

virtual bool read(const dictionary &dict)

Read dictionary.

Private Functions

void readCoeffs()

Non-virtual read.

Private Members

fvCellSet set_

The set of cells the fvModel applies to.

scalar tau_
scalar kappa1_

Anisotropy coefficient.

scalar kappa2_

Anisotropy coefficient.

struct F

Public Functions

inline F()
inline ~F()

Public Members

int argc
char **argv
namespace Foam
namespace fv

Functions

defineTypeNameAndDebug (anisotropySource, 0)
addToRunTimeSelectionTable(fvModel, anisotropySource, dictionary)
file createFields.H
#include “createFvModels.H”

Variables and fields initialization.

file createFields.H
#include “createFvModels.H”

Variables and fields initialization.

file dTEqn.H

The undercooling equation.

Functions

dTEqn relax()

Apply relaxation to the undercooling equation.

dTEqn solve()

Solve the undercooling equation.

file fiEqn.H

The phase field equation.

Functions

volScalarField gradFix (IOobject("gradFix", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), gradFi.component(vector::X))
volScalarField gradFiy (IOobject("gradFiy", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), gradFi.component(vector::Y))
fvScalarMatrix fiEqn (fvm::ddt(fi) - fvm::laplacian(D, fi)==fvModels.source(fi))
fiEqn relax()

Apply relaxation to the phase field equation.

fiEqn solve()

Solve the phase field equation.

Variables

volScalarField psi = constant::mathematical::pi / 8. + Foam::atan2(gradFiy, gradFix)
volScalarField Phi = Foam::tan(N * psi / 2)
volScalarField beta = (1 - sqr(Phi)) / (1 + sqr(Phi))
volScalarField Da = sqr(alpha) * (1 + c * beta) / tau
volScalarField Ddiag = Da * (1 + c * beta)
volScalarField Doffdiag = Da * c * (-N * 2 * Phi / (1 + sqr(Phi)))
D   = Ddiag*tensor(1,0,0,0,1,0,0,0,0) + Doffdiag*tensor(0,1,0,-1,0,0,0,0,0)
file phaseFieldFoam.C

Solves phase field equations with anisotropy source.

Original source file phaseFieldFoam.C

file hello.H
#include <stdio.h>

Original source file hello.H

Functions

__global__ void cuda_hello ()
file anisotropySource.C
#include “anisotropySource.H
#include “fvModels.H”
#include “fvmSup.H”
#include “addToRunTimeSelectionTable.H”

Original source file anisotropySource.C

file anisotropySource.H
#include “fvModel.H”
#include “fvCellSet.H”
#include “fvMesh.H”
#include “volFields.H”
#include “NamedEnum.H”
#include “Function1.H”

Original source file anisotropySource.H

file test_anisotropySource.C
#include <boost/test/included/unit_test.hpp>
#include “fvCFD.H”
#include “fvModels.H”
#include “fvModel.H”
#include “setRootCaseLists.H”
#include “createTime.H”
#include “createMesh.H”
#include “createFields.H

Defines

BOOST_TEST_MODULE

Functions

BOOST_FIXTURE_TEST_SUITE(CheckAnisotropySourceFvModel, F)
BOOST_AUTO_TEST_CASE(CheckIfAnisotropySourceFvModelHasBeenRead)
BOOST_AUTO_TEST_SUITE_END()
dir src/fvModels/derived/anisotropySource
dir applications
dir src/cudaTest
dir src/fvModels/derived
dir tests/fvModels
dir src/fvModels
dir applications/solvers/multiphase
dir applications/solvers/multiphase/phaseFieldFoam
dir applications/solvers
dir src
dir tests