CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   TotalPressure and buoyantFoam (http://www.cfd-online.com/Forums/openfoam-solving/59205-totalpressure-buoyantfoam.html)

ariorus January 21, 2008 09:54

Hello, I don't manage to us
 
Hello,

I don't manage to use total pressure boundary condition in buoyantFoam.

The following error appears:

--> FOAM FATAL ERROR :
request for volVectorField undefined from objectRegistry region0 failed
available objects of type volVectorField are

2
(
U_0
U
)



I think that this may be due to the fact that whenever p (and pd) are created via thermo->p() some information about the boundaries are lost

in fact writing out pd (or p) boundary after the field is created I find


type totalPressure;
U undefined;
phi undefined;
rho undefined;
psi undefined;
gamma 0;
p0 uniform 0;
value uniform 0;


while in the p file I set correctly U, phi, rho and so on.

I guess that if this was the problem it would not be too difficult to be fixed, can anybody help?

Thanks

Rosario.

ariorus January 22, 2008 09:41

Hello again, after digging
 
Hello again,

after digging a little I have found that when totalPressure boundaries p and pd are created, only this constructor is used

---------------------
totalPressureFvPatchScalarField::totalPressureFvPa tchScalarField
(
const fvPatch& p,
const DimensionedField<scalar,>& iF
)
:
fixedValueFvPatchScalarField(p, iF),
UName_("undefined"),
phiName_("undefined"),
rhoName_("undefined"),
psiName_("undefined"),
gamma_(0.0),
p0_(p.size(), 0.0)

--------------------

Since UName, phiName and rhoName are set to undefined, this boundary condition cannot work actually.

I saw that if the field is created by

-----------------------

volScalarField p
(
IOobject
(
"p",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);

-----------------------------------


these two constructors are used:

-----------------------------
totalPressureFvPatchScalarField::totalPressureFvPa tchScalarField
(
const fvPatch& p,
const DimensionedField<scalar,>& iF,
const dictionary& dict
)
:
fixedValueFvPatchScalarField(p, iF),
UName_(dict.lookup("U")),
phiName_(dict.lookup("phi")),
rhoName_(dict.lookup("rho")),
psiName_(dict.lookup("psi")),
gamma_(readScalar(dict.lookup("gamma"))),
p0_("p0", dict, p.size())

-----------------------------------------

and


------------------------------------------
totalPressureFvPatchScalarField::totalPressureFvPa tchScalarField
(
const totalPressureFvPatchScalarField& tppsf,
const DimensionedField<scalar,>& iF
)
:
fixedValueFvPatchScalarField(tppsf, iF),
UName_(tppsf.UName_),
phiName_(tppsf.phiName_),
rhoName_(tppsf.rhoName_),
psiName_(tppsf.psiName_),
gamma_(tppsf.gamma_),
p0_(tppsf.p0_)

------------------------------------------

In this case everything is fine since all the necessary parameters are set.

I'm not sure whether this might be a bug (and if it is correct to search for a solution) or whether there is any reason why it is so.

Is there anybody who can enlighten me?

Thanks in advance.

Rosario.


All times are GMT -4. The time now is 03:04.