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:
topBoundary { type totalTemperature; T0 uniform 300; U U; phi phi; psi psi; gamma 1.4; 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 0 ( ) 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: For totalTemperatureFvPatchScalarField.C: const fvPatchVectorField& Up = patch().lookupPatchField<volVectorField, vector>(UName_); For totalPressureFvPatchScalarField.C: void totalPressureFvPatchScalarField::updateCoeffs() { updateCoeffs(patch().lookupPatchField<volVectorField, vector>(UName_)); } Can anyone explain why the former BC fails and the latter succeeds; and even suggest a solution? Many thanks. 
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 rearrange 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?


phip: phi on a patch. The definition of phi (mass flow on the face) has been discussed a number of times. Sign says whether it's flowing in or out

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?

Quote:

Have made some progress with this problem...
First, I reordered 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 recompiled 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 recompiled 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; U=rhoU/rho; T.correctBoundaryConditions(); I have recompiled 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. 