CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Solving an additional equation (https://www.cfd-online.com/Forums/openfoam-solving/60600-solving-additional-equation.html)

rene May 11, 2005 14:27

Dear all, since I'm doing s
 
Dear all,

since I'm doing some testing of a modified turbulence model based upon the LRR implementation, I'd like to solve an additional equation for a tensor field giving me an idea about its quality - this field should be a copy of R_.

I browsed all the messages posted here, but, unfortunately, cannot find a solution of my problem.

First of all, I defined a new 'volTensorField' in my .H-File I named 'HELP1',

tmp<voltensorfield> HELP1() const
{
return HELP1_;
}

which is set to a fixed set of values in .C afterwards:
HELP1_
(
IOobject
(
"HELP1",
runTime_.timeName(),
runTime_,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
mesh_,
dimensionedTensor
(
"zero",
R_.dimensions(),
tensor
(
1,0,0,
0,2,0,
0,0,3
)
)
).

To solve this, I copy the field values of R_ onto HELP1_ and define the additional equation as follwing:

HELP1_ = R_;

tmp<fvtensormatrix> HELP1Eqn
(
fvm::ddt(HELP1_)
==
P
);

solve(HELP1Eqn);

where 'P' has the correct dimensions. All the fvSchemes and other input-files are set, compilation is done without any messages and the code runs properly (I'm using turbFoam).

When I add another term on the left- or right-hand-side of 'HELP1Eqn' - i.e. + fvm::div(phi_, HELP1_) - I get the message from Foam

--> FOAM FATAL ERROR : gradientInternalCoeffs cannot be called for a calculatedFvPatchField.
You are probably trying to solve for a field with a calculated or default boundary conditions.


My question now: what's wrong here? Where is something missing? Do I have to modify an argument list?
This might be a stupid question - my last C++-course at uni is years ago - but I wouldn't mind some useful hints...

Thanks in advance,

Rene

henry May 11, 2005 14:34

The problem is that you have n
 
The problem is that you have not set any boundary conditions for HELP1_ and have let them default to calculatedFvPatchField which of course you cannot use in a transport equation. You could either read HELP1_ and set the BCs in the file or obtain the BC types from R_.

rene May 12, 2005 04:36

Thanks Henry! After setting
 
Thanks Henry!

After setting 'MUST_READ' to HELP1_ all works fine.


All times are GMT -4. The time now is 02:13.