CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Changing Boundary Types (https://www.cfd-online.com/Forums/openfoam-pre-processing/124576-changing-boundary-types.html)

otq October 8, 2013 12:00

Changing Boundary Types
 
I am modifying the chtmultiregion solver to allow use of highly variable fluids. The major issue I am currently having is that several properties, enthalpy primarily, are using incorrect boundary conditions within the volScalarField. This is caused by the fact that h is based off of the T volScalarField.

Since I am interested in the conjugate heat transfer of the system, I am using the turbulentTemperatureCoupledBaffleMixedFvPatchScala rField for the solid-liquid boundary; however, that is an unnecessary boundary for h. I need to change the boundary type for the h volScalarField to fixedValue.

The reason for this, is that once I start solving the problem, the turbulentTemperatureCoupledBaffleMixedFvPatchScala rField is setting all the wall enthalpy values equal to the temperature values, and tries to match gradients. This causes the enthalpy to be several orders of magnitudes lower than it should be. The end result is that OpenFOAM starts reporting negative temperature values(in a Kelvin scale).

The issue I am having is that I do not know if I should do this within the solver, or within my thermophysical model. I thought that within the solver would be most appropriate, so I did the following within setRegionFluidFields.H of my modified chtMultiRegionFoam solver.

forAll(T.boundaryField(),patchi)
{
if(T.boundaryField()[patchi].type() == turbulentTemperatureCoupledBaffleMixedFvPatchScala rField::typeName)
{
h.boundaryField()[patchi].type() == fixedValueFVPatchScalarField::typeName;
rho.boundaryField()[patchi].type() ==fixedValueFVPatchScalarField::typeName;
psi.boundaryField()[patchi].type() ==fixedValueFVPatchScalarField::typeName;
mu.boundaryField()[patchi].type() ==fixedValueFVPatchScalarField::typeName;
K.boundaryField()[patchi].type() ==fixedValueFVPatchScalarField::typeName;
}
}

It tells me that neither fixedValueFVPatchScalarField, or turbulentTemperatureCoupledBaffleMixedFvPatchScala rField have been declared, even though I explicitly included the related header files to the chtMultiRegionSimpleFoam.C file. I do not know where my syntax errors are.

To summarize: I generate volScalarFields based on temperature, the boundary types from the temperature field are copied into those new volScalarFields. The turbulentTemperatureCoupledBaffleMixedFvPatchScala rField type is causing my solution to be completely nonphysical. I need to swap that boundary type to fixedValue WITHOUT changing the values. All of this is occuring before any calculations occur.

Thank you for your time.


All times are GMT -4. The time now is 14:15.