CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Incompatible fields for operation divphi Ub

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2005, 10:13
Default I am writing an adjoint solver
  #1
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 14
vvqf is on a distinguished road
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
vvqf is offline   Reply With Quote

Old   November 22, 2005, 11:45
Default If you want to solve a single
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,872
Rep Power: 30
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   November 22, 2005, 17:43
Default Thank you for the answer. I
  #3
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 14
vvqf is on a distinguished road
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?
vvqf is offline   Reply With Quote

Old   November 22, 2005, 17:55
Default phi does not matter - it only
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,872
Rep Power: 30
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   April 4, 2018, 03:28
Default Incompatible field operation
  #5
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 5
gouravjee is on a distinguished road
Quote:
Originally Posted by hjasak View Post
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
I am solving a heat diffusion equation in which i have two variables and one of them is derived from another but get the error :
Incompatible Field Operation [T]-[H]
T--> temperature
H-->enthalpy

can you suggest how to solve this problem
gouravjee is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incompatible fields for operation tehache OpenFOAM Running, Solving & CFD 5 January 30, 2018 15:32
incompatible fields for operationproblem in simpleFoam kbr OpenFOAM Running, Solving & CFD 3 March 10, 2009 10:25
Incompatible fields for operation su_junwei OpenFOAM Pre-Processing 1 October 15, 2008 08:34
TurbFoam simpleFoam incompatible fields for operation braennstroem OpenFOAM Running, Solving & CFD 0 June 19, 2008 10:43
The incompatible of UDF Summer FLUENT 3 April 23, 2007 04:11


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