CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > 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 Display Modes
Old   November 22, 2005, 11:13
Default I am writing an adjoint solver
  #1
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 8
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, 12:45
Default If you want to solve a single
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
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, 18:43
Default Thank you for the answer. I
  #3
Member
 
VVqf
Join Date: Mar 2009
Location: Braunschweig
Posts: 66
Rep Power: 8
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, 18:55
Default phi does not matter - it only
  #4
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
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

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Incompatible fields for operation tehache OpenFOAM Running, Solving & CFD 4 April 7, 2010 06:48
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 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 05:50.