OpenFOAM Note

本文最后更新于:2021年10月15日 凌晨

OpenFOAM 2019

elbow

terminal

fluentMeshToFoam elbow.mshsim

 //constant\poluMesh mesh location

foamCleanTutorials cleanDir
touch case.foam

boundary condition
type empty; 2D

type noSlip;

type fixedValue;

value uniform 0;

flies
flie 0 boundary

flie constant
transportProperties nu
turbulenceProperties method RAS LES laminar

flie system

units

[kg,m,s,k…]

solve
steady: deltaT 1;
writeFormat binary\ascii;

TShspe_TEST

constant /boundary /nu /laminar
0 /p /U

blockMesh
touch case.foam
simpleFoam

arota_transient

fluent3DMeshToFoam fluent.msh

/p
type codedFixedValue;
changable pressure with time on boundary

“OUTLET.*”=OUTLET1 OUTLET2 OUTLET3…

/controlDict
important: deltaT
writeFormat binary;

pimpleFoam
foamListTimes -rm  //delete previous solution data

postProcessing residuals data

foamMonitor -l postProcessing/residuals/0/residuals.dat

_sylinder_TEST

inGroups        List<word> 1(mywall);

empty cyclic cyclicAMI wedge symmetry > #includeEtc "caseDicts/setConstraintTypes"

internalField   uniform (1 0 0);

pimpleFoam &> log

nOuterCorrectors    15>>1; pimple to piso

foamMonitor yrange "[0 1]"

_TaylorCouettte_steadyState

".*"
{
	type zeroGradient;
}
> foamGet residuals
functions
{
	#includeFunc residuals
}
decomposePar 

mpirun -np 4 simpleFoam -parallel

cyclic_RANS

👉
wall function
type kqRWallFunction;
value $internalField;

./Allrun
decomposePar -force
mpirun -np 4 simpleFoam -parallel
reconstructPar

_dynMesh

dynamicMeshDict movingwall nessary file

pointDisplacement

_livingRoom

topoSet
name window;
type faceSet;
action new;
source boxToFace;
sourceInfo
{
box (0.5 1.0 -0.001)(2.5 2.0 0.001);
}

p_rgh

type        zerogradient;
    type            fixedFluxPressure;
    value           uniform 0;

equationOfState perfectGas;

buoyantSimpleFoam

_BernardCells

buoyantPimpleFoam

—> FOAM FATAL ERROR:
LHS and RHS of - have different dimensions
dimensions : [0 2 -2 0 0 0 0] - [1 -1 -2 0 0 0 0]

rhiCentralFoam

rhoSimpleFoam

mu          0;

sutherland  mu relacted with T
internalField   uniform $Uinlet;
internalField   uniform $pOut;

type           fixedMean;  //face average
type       totalTemperature;
type turbulentIntensityKineticEnergyInlet;

VOF

type constantAlphaContactAngle;
interFoam

pRefCell    0;
pRefValue           0;

Mixture

driftFluxFoam

relativeVelocityModel simple; //relative Velocity

find solvers

OpenFOAM/OpenFOAM-7/applications/solvers/xx/xx.c > discriptions

OKSS2

laplacianFoam.c

Application
    laplacianFoam

Description
    Solves a simple Laplace equation, e.g. for thermal diffusion in a solid.

            fvScalarMatrix TEqn
            (
                fvm::ddt(T) - fvm::laplacian(DT, T)
             ==
                fvOptions(T)
            );

scalarTransportFoam

Application
    scalarTransportFoam

Description
    Solves the steady or transient transport equation for a passive scalar.

            fvScalarMatrix TEqn
            (
                fvm::ddt(T)
              + fvm::div(phi, T)
              - fvm::laplacian(DT, T)
             ==
                fvOptions(T)
            );

Energe equation

name.c>Make>flies>name.C name

$ wmake

name.c

   volScalarField T
   {
IOobject
{
    "T",
           runTime.timeName(),
           mesh,
           IOobject::MUST_READ,
           IOobject::AUTO_WRITE
},
       mesh
   };

   dimensionedScalar DT
   {
       "DT",
       dimensionSet(0,2,-1,0,0),
       0.0001
   };


   fvScalarMatrix TEqn
   {
       fvm::ddt(T)
     + fvc::div(phi, T)
     - fvc::laplacian(DT, T)
   };

projectionFoam

projectionFoam.C

EXE = $(FOAM_USER_APPBIN)/projectionFoam

phi = fvc::interpolate(U) & mesh.Sf(); volume to surface

dym

>pisoDyMFoam.C
#include "dynamicFvMesh.H"
#include "createDynamicFvMesh.H"
mesh.update();
>UEqn
phi = phi - mesh.phi();

>options
-ldynamicFvMesh \
-ltopoChangerFvMesh \
-I$(LIB_SRC)/dynamicFvMesh/lnInclude \

missing operator >options environment variables

EMMS

BASUOQU

pimpleFoam -listScalarBCs -listVectorBCs \list boundary type


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!