Fanfei |
September 9, 2014 08:32 |
Hi, Bruno Santos: I wantto add the wallshearstress to pimpleFoam solver.the code is:
Code:
while (pimple.correct())
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
Info<<"1 step"<<endl;
autoPtr<incompressible::RASModel> model;
Info<<"2 step"<<endl;
const volSymmTensorField Reff(model->devReff());
Info<<"3 step"<<endl;
// #include "createPhi.H"
// autoPtr<incompressible::RASModel> model;
// singlePhaseTransportModel laminarTransport(U, phi);
// Info<<"3 step"<<endl;
// autoPtr<incompressible::RASModel> model
// (
// incompressible::RASModel::New(U, phi, laminarTransport)
// );
label patchWallID=mesh.boundaryMesh().findPatchID("bottomWall");
volVectorField wallShearStress //定义剪切应力
(
IOobject
(
"wallShearStress",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedVector
(
"wallShearStress",
sqr(dimLength)/sqr(dimTime),
vector::zero
)
);
{
wallShearStress.boundaryField()[patchWallID] =
(
-mesh.Sf().boundaryField()[patchWallID]
/mesh.magSf().boundaryField()[patchWallID]
) & Reff.boundaryField()[patchWallID];
}
when compiled, there is no problem. but as run a test, there're a problem
Code:
GAMG: Solving for p, Initial residual = 0.0390428, Final residual = 6.86508e-08, No Iterations 25
time step continuity errors : sum local = 1.61558e-07, global = -3.77072e-08, cumulative = -2.71215e-05
smoothSolver: Solving for epsilon, Initial residual = 0.187626, Final residual = 8.51315e-06, No Iterations 32
smoothSolver: Solving for k, Initial residual = 1, Final residual = 8.18223e-06, No Iterations 45
1 step
2 step
--> FOAM FATAL ERROR:
object of type N4Foam14incompressible8RASModelE is not allocated
From function Foam::autoPtr<T>::operator->()
in file /home/administrator/OpenFOAM/OpenFOAM-2.3.0/src/OpenFOAM/lnInclude/autoPtrI.H at line 176.
FOAM aborting
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2
at ??:?
#3
at ??:?
#4 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#5
at ??:?
Aborted (core dumped)
I think it's may be same parameters undefined, could you give me some advise? Thanks
|