trouble with totalTemperature BC
I am using OF1.5 and rhopSonicFoam for a compressible external flow case. On the far field boundary I would like to apply a totalTemperature boundary condition:
T0 uniform 300;
value uniform 300;
I find that solver aborts with the following message:
request for volVectorField U from objectRegistry region0 failed
available objects of type volVectorField are
I have found that a totalPressure boundary condition (with fixedValue for T) runs for a short time before inflow leads to rapid divergence.
In the source files for totalPressure and totalTemperature I see that the vector field for velocity is accessed in a different way in each case:
const fvPatchVectorField& Up =
Can anyone explain why the former BC fails and the latter
succeeds; and even suggest a solution?
More information ...
I noticed from the log file (for rhopSonicFoam > log) that the totalTemperature BC causes the solver to abort after writing the message:
Reading field T
This message comes from the header file "createFields.H". There is a function T.correctBoundaryConditions() that is called before the vector field for U is established. The fields are created in the order p, T, psi, rho, U, rhoU, rhoE, phiv.
My question is; may I re-arrange the code so that the vector field for U is created before T.correctBoundaryConditions() is called? The order could be p, U, T, psi, rho, rhoU, rhoE, phiv, for example.
Sorry, I can't help any, but I'm clawing my way through these bcs also. Any idea what psi and phi represent? I assume phi is the mass flux vector (rho U). Also, in the code, there's a 1 - pos(phip). Any idea where pos() is defined or what it does?
Thanks Berhard. Saw several of your talks in Montreal last June. I figured the phi part out after the post. From the code, psi must equal rho/p, but I don't know why or how this bc's dictionary works. Why is U part of the class?
Have made some progress with this problem...
First, I re-ordered the creation of the fields defined in "createFields.H". I used the order I mentioned above; p. U, T, psi, rho, rhoU, rhoE, phiv. I re-compiled and found that the solver aborted again, this time on searching for the scalar field phi.
Then I moved the T.correctBoundaryConditions() function down in the file, to the line below rhoU.correctBoundaryConditions().
I re-compiled and the solver ran successfully. However, in order to update the boundary condition after each time step one extra change is needed:
in rhopSonicFoam.C I added the update function just below the expression for U;
I have re-compiled rhopSonicFoam and it works fine; the temperature at the far field boundary is adjusted as pressure waves move through and the local velocity changes.
To answer the question on why U is involved, the totalTemperature function is simply
an expression of the energy equation; as the velocity increases the temperature drops.
|All times are GMT -4. The time now is 20:55.|