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

Including user defined eqations

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 28, 2007, 09:03
Default I am trying to include a new e
  #1
Member
 
Tomislav Sencic
Join Date: Mar 2009
Posts: 42
Rep Power: 17
tsencic is on a distinguished road
I am trying to include a new equation in dieselEngineFoam.

I included:

fvScalarMatrix sootEqn
solve
(
fvm::ddt(rho, soot)
+ fvm::div(phi, soot)
==
0.5*mag(U)
);


In createFields.H I defined the field by:

volScalarField soot
(
IOobject
(
"soot",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh,
dimensionedScalar("zero", dimensionSet(1,-3,-1,0,0,0,0), 0.0)
);


It compiles, but at the beginning of the run I recive the error:

--> FOAM FATAL ERROR : valueInternalCoeffs cannot be called for a calculatedFvPatchField.
You are probably trying to solve for a field with a calculated boundary conditions.

From function
calculatedFvPatchField<type>::valueInternalCoeffs( const tmp<scalarfield>&) const
in file fields/fvPatchFields/basicFvPatchFields/calculated/calculatedFvPatchField.C at line 136.

FOAM exiting

What does it mean? How can I solve it?

Tomislav
tsencic is offline   Reply With Quote

Old   June 28, 2007, 10:18
Default What it means is: "I created a
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
What it means is: "I created a field with no defined boundary conditions. This is OK. But you want me to solve an equation without BCs. This is not OK"

Get rid of the last parameter for your soot field. Instead create a soot file in your 0 directory with intial-BC(==0), dimensions AND boundary conditions
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   June 29, 2007, 07:40
Default Thanks, it helped. But, whe
  #3
Member
 
Tomislav Sencic
Join Date: Mar 2009
Posts: 42
Rep Power: 17
tsencic is on a distinguished road
Thanks, it helped.

But, when I set the soot dimensions in the 0 directory to:
dimensions [0 0 0 0 0 0 0];

I obtain:

--> FOAM FATAL ERROR : incompatible dimensions for operation
[soot[1 -3 -1 0 0 0 0] ] == [scal[0 0 0 0 0 0 0] ]

Where else could be defined the soot dimensions, where does come from the [soot[1 -3 -1 0 0 0 0] ] dimension?
tsencic is offline   Reply With Quote

Old   June 29, 2007, 08:41
Default soot is the dimension of the r
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
soot[1 -3 -1 0 0 0 0] is the dimension of the right hand side (density per second) - the ddt ad div seem to be consistent. What seems to be wrong is the dimension of the right hand side. You've got to add a dimensioned scalar that has the right dimension (but think about the physical meaning of that)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 2, 2007, 11:17
Default I meant to say "left side" in
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
I meant to say "left side" in my last post. rho has dimension [1 -3 0 0 0 0 0] ddt adds [0 0 -1 0 0 0 0] with your undimensioned soot the resulting dimension is [1 -3 -1 0 0 0 0]

How many iterations does the linear solver need to get to "internalField uniform 0;"? What are the boundary conditions for soot? Try without a source term, but with an inhomogenous initial distribution
of soot.
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 3, 2007, 07:07
Default OK, I got the dimensions. I
  #6
Member
 
Tomislav Sencic
Join Date: Mar 2009
Posts: 42
Rep Power: 17
tsencic is on a distinguished road
OK, I got the dimensions.

I do not know the number of iterations because in the log file "soot" is never mentioned, there is no something like:

BICCG: Solving for soot, Initial residual = 1, Final residual = 1.53774e-08, No Iterations 5

Could this be the key of the problem?

I tried the other things you suggested, but without result.
The boundary conditions are:
boundaryField
{
piston
{
type zeroGradient;
}
liner
{
type zeroGradient;
}
cylinderHead
{
type zeroGradient;
}
cyclic
{
type cyclic;
value uniform 0;
}
tsencic is offline   Reply With Quote

Old   July 3, 2007, 07:10
Default ON, so you've got a field with
  #7
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
ON, so you've got a field with zero gradient or cyclic b.c.-s all the way around and I suspect a uniform internal field. Do you have any sources or sinks in the equation or does the current solution satisfy the equations already?

If it does, OpenFOAM won't bother solving for it.

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Reply


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
User defined bc anja OpenFOAM Running, Solving & CFD 20 June 6, 2008 12:12
User-Defined Fan Socrate FLUENT 0 March 28, 2007 10:25
User Defined GUI Frederik FLUENT 0 June 23, 2006 16:12
user defined scalars ramesh FLUENT 1 June 11, 2004 17:25
user defined viscosity solomon FLUENT 0 July 13, 2003 21:09


All times are GMT -4. The time now is 21:20.