|
[Sponsors] |
November 22, 2005, 11:13 |
I am writing an adjoint solver
|
#1 |
Member
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17 |
I am writing an adjoint solver based on simpleFoam.
I used 2 velocity fields, one is adjoint velocity- U, which needs to be calculated, the other is a read-in velocity - U'(constant, read in as initial value at the begining). phi is created by interpolating the adjoint velocity- U. I also created a PhiU'.cfg file to define the fvSchemes, and did little corresponding modifications in the solver source and testcase fvScheme files. But when I use the solver the solve the case, I have error message as follows: FOAM FATAL ERROR : incompatible fields for operation [U'] - [U] From function checkMethod(const fvMatrix<type>&, const fvMatrix<type>&) in file ~/OpenFOAM/OpenFOAM-1.2/src/OpenFOAM/lnInclude/fvMatrix.C at line 898. in fvMatrix.C line 898, it went into a if block: if (&fvm1.psi() != &fvm2.psi()) Does it mean that these two velocity fields have to be the same, or with different names but actually share the same address? ----------------- createPhi.H see http://www.cfd-online.com/OpenFOAM_D...tml?1132072161 |
|
November 22, 2005, 12:45 |
If you want to solve a single
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
If you want to solve a single equation in FOAM, it can only have one variable. In other words, when you do:
fvm::ddt(U) + fvm::div(phi, U) the first and second U need to be the same field. In your case it looks as if they are not. Please also have in mind that you are upsetting the database by the fact you've got two fields with the same name. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
November 22, 2005, 18:43 |
Thank you for the answer.
I
|
#3 |
Member
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 17 |
Thank you for the answer.
I now just want to fvm::div(phi, U') Where phi is defined as: ------------- surfaceScalarField phi ( IOobject ( "phi", runTime.timeName(), mesh, IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), linearInterpolate(U) & mesh.Sf() ); -------------- I offered a U' file to be read in at the beginning, in the 0 time directory. So U' is known and is a constant field. I want to express (U'奄)U as fvm::div(phi, U'). Is that wrong? |
|
November 22, 2005, 18:55 |
phi does not matter - it only
|
#4 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
phi does not matter - it only needs to fit dimensionally. If you do:
fvm::div(phi, U') you will get the equation for U' - to be more precise an fvVectorMatrix where U' is the variable you will try to solve for. Are you sure you want fvm rather than fvc? Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
April 4, 2018, 04:28 |
Incompatible field operation
|
#5 | |
Member
Join Date: Oct 2017
Posts: 52
Rep Power: 9 |
Quote:
Incompatible Field Operation [T]-[H] T--> temperature H-->enthalpy can you suggest how to solve this problem |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Incompatible fields for operation | tehache | OpenFOAM Running, Solving & CFD | 5 | January 30, 2018 16:32 |
incompatible fields for operationproblem in simpleFoam | kbr | OpenFOAM Running, Solving & CFD | 3 | March 10, 2009 11:25 |
Incompatible fields for operation | su_junwei | OpenFOAM Pre-Processing | 1 | October 15, 2008 09:34 |
TurbFoam simpleFoam incompatible fields for operation | braennstroem | OpenFOAM Running, Solving & CFD | 0 | June 19, 2008 11:43 |
The incompatible of UDF | Summer | FLUENT | 3 | April 23, 2007 05:11 |