|
[Sponsors] |
Solving with a variable non defined in 0 directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 7, 2015, 10:04 |
Solving with a variable non defined in 0 directory
|
#1 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
Hello Foamers
Im trying to solve over a variable i call X which represents the ration of inital concentration Ci while i need the new C to be written at the end of each step what i did is the following 1. in createFileds.H volScalarField COH ( IOobject ( "COH", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); volScalarField XOH ( IOobject ( "XOH", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), (COH0-COH)/COH0 ); and then i create a .H file to solve for XOH as fvScalarMatrix XOHEqn ( fvm::ddt( XOH) + fvm::div(phi, XOH) ); XOHEqn.solve(); COH=COH0*(1.0-XOH); I thought it would work swiftly, but it shows an error i dont understand which is: --> FOAM FATAL ERROR: valueInternalCoeffs cannot be called for a calculatedFvPatchField on patch atmosphere of field XOH in file "/home/alkebsi/OpenFOAM/alkebsi-2.3.1/run/heatingwater4/0/XOH" You are probably trying to solve for a field with a default boundary condition. From function calculatedFvPatchField<Type>::valueInternalCoeffs( const tmp<scalarField>&) const in file /opt/openfoam231/src/finiteVolume/lnInclude/calculatedFvPatchField.C at line 154. FOAM exiting I dont have file called XOH in 0 directory, rather i have a file for COH in which all the boundaries are zeroGradient and i use a setFiled to partially fill the domain (I wrok with interFoam and my COH exists in one phase but this has nothing to do with the current problem) |
|
April 7, 2015, 13:17 |
|
#2 |
Senior Member
|
Hi,
I guess boundary conditions for XOH should be the same as for COH. So you should use the following constructor for XOH: Code:
volScalarField XOH ( IOobject ( "XOH", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), (COH0-COH)/COH0, COH.boundaryField().types() ); |
|
April 8, 2015, 05:18 |
|
#3 |
Member
ali alkebsi
Join Date: Jan 2012
Location: Strasbourg, France
Posts: 82
Rep Power: 14 |
Thank you very much
That was it, it worked. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
High Courant Number @ icoFoam | Artex85 | OpenFOAM Running, Solving & CFD | 11 | February 16, 2017 13:40 |
simpleFoam error - "Floating point exception" | mbcx4jc2 | OpenFOAM Running, Solving & CFD | 12 | August 4, 2015 02:20 |
rhoSimplecFoam Mach0.8 no pressure values | CFDnewbie147 | OpenFOAM Running, Solving & CFD | 16 | November 23, 2013 05:58 |
pisoFoam with k-epsilon turb blows up - Some questions | Heroic | OpenFOAM Running, Solving & CFD | 26 | December 17, 2012 03:34 |
OpenFoam install script Error during paraFoam installation | SePe | OpenFOAM Installation | 10 | June 19, 2010 15:15 |