|
[Sponsors] |
volScalarField in the main function or createField.H? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 2, 2014, 23:24 |
volScalarField in the main function or createField.H?
|
#1 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 848
Rep Power: 18 |
Hi guys,
This is a very simple case. In scalarTransportFoam, I add this code into it: Code:
while (simple.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; while (simple.correctNonOrthogonal()) { fvScalarMatrix TEqn ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DT, T) == fvOptions(T) ); TEqn.solve(); } volScalarField T2 ( IOobject ( "T2", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), scalar(2)/T ); runTime.write(); } But if I add this volScalarField into createField.H like this: Code:
Info<< "Reading field T\n" << endl; volScalarField T ( IOobject ( "T", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); volScalarField T2 ( IOobject ( "T2", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), scalar(2)/T ); Info<< "Reading field U\n" << endl; volVectorField U ( IOobject ( "U", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Code:
Reading field T #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 in "/lib/x86_64-linux-gnu/libc.so.6" #3 Foam::divide(Foam::Field<double>&, double const&, Foam::UList<double> const&) at ??:? #4 void Foam::divide<Foam::fvPatchField, Foam::volMesh>(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>&, Foam::dimensioned<double> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #5 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(Foam::dimensioned<double> const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #6 Foam::tmp<Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> > Foam::operator/<Foam::fvPatchField, Foam::volMesh>(double const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&) at ??:? #7 at ??:? #8 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6" #9 at ??:? Floating point exception (core dumped) |
|
April 2, 2014, 23:29 |
|
#2 |
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Beijing, China
Posts: 848
Rep Power: 18 |
Sorry its solved...
add this code into Createfields Code:
volScalarField C ( IOobject ( "C", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), mesh, dimensionedScalar("C",dimensionSet(0,0,0,1,0,0,0),0.00008) ); volScalarField T2 ( IOobject ( "T2", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), scalar(2)/(T+C) ); |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 11:51 |
[snappyHexMesh] How to define to right point for locationInMesh | Mirage12 | OpenFOAM Meshing & Mesh Conversion | 7 | March 13, 2016 15:07 |
writing execFlowFunctionObjects | immortality | OpenFOAM Post-Processing | 30 | September 15, 2013 07:16 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
Can anybody help me to solve the list errors while compiling Openfoam 15 on Opensuse 103 32bit | coompressor | OpenFOAM Installation | 0 | November 12, 2008 20:53 |