agustinvo |
November 19, 2015 05:45 |
Create a scalar from a volScalarField
Hello
I want to modify a boundary condition, where you have to give the density as a scalar, but since in my case, the density will change, I want to use my own density.
I thought it was ok like this, but in my simulation I got this error:
Code:
Starting time loop
Time = 1
DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 1.723949e-12, No Iterations 3
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 4.017873e-11, No Iterations 1
aqui
DILUPBiCG: Solving for T, Initial residual = 1, Final residual = 6.385874e-11, No Iterations 4
#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::sigSegv::sigHandler(int) at ??:?
#2
at sigaction.c:?
#3 Foam::multiply(Foam::Field<double>&, Foam::UList<double> const&, Foam::UList<double> const&) at ??:?
#4 Foam::operator*(Foam::UList<double> const&, Foam::tmp<Foam::Field<double> > const&) at ??:?
#5 Foam::nonUniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs() at ??:?
#6 Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoeffs() at ??:?
#7 Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#8 Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacianUncorrected(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#9 Foam::fv::gaussLaplacianScheme<double, double>::fvmLaplacian(Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:?
#10
at ??:?
#11
at ??:?
#12
at ??:?
#13 __libc_start_main at ??:?
#14
at ??:?
Segmentation fault
So I went there to check what is going on.
There, I have:
Code:
void Foam::nonUniformDensityHydrostaticPressureFvPatchScalarField::updateCoeffs()
{
if (updated())
{
return;
}
const uniformDimensionedVectorField& g =
db().lookupObject<uniformDimensionedVectorField>("g");
const volScalarField& rho_ =
db().lookupObject<volScalarField>("rho");
operator==
(
pRefValue_
+ rho_*((g.value() & patch().Cf()) - (g.value() & pRefPoint_))
);
fixedValueFvPatchScalarField::updateCoeffs();
}
But in the non-modified BC, rho_ is declared as a scalar, and I am using a volScalarField.
Do you know how can I change this, it means, create a scalar from a volScalarField?
Thank you everybody!
|