CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM

Solve dS_dt + div(vect(U)*f(S))=q

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

LinkBack Thread Tools Display Modes
Old   April 29, 2010, 11:46
Default Solve dS_dt + div(vect(U)*f(S))=q
New Member
Join Date: Aug 2009
Posts: 15
Rep Power: 10
andresbh is on a distinguished road
I am trying to solve this equation in openfoam.

dS_dt + div(vect(U)*f(S))=q

where f(S) is a known equation dependent of S. S cannot be explicitly extracted from f(S).

up to now if I implement the equation as stated above I get an error concerning calculatedFvPatchField.

Has anybody had similar problems?


andresbh is offline   Reply With Quote

Old   April 30, 2010, 01:08
Senior Member
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,910
Rep Power: 28
alberto will become famous soon enoughalberto will become famous soon enough
A bit vague :-)

You should give some more detail on how the equation was implemented, and be specific with the error message.

Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats.
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   April 30, 2010, 03:44
Default Impementaiton
New Member
Join Date: Aug 2009
Posts: 15
Rep Power: 10
andresbh is on a distinguished road
Hi Alberto,

I hope that the problem declaration this time is more illustrating.


The initial values of

volScalarField S
volVectorField U
are read from the case directory 0 and

dimensionedScalar const1
dimensionedScalar const2
from the constant directory.

The implementation reads

    volScalarField X = (S-const1)/(const2);
    f = pow(X,2)/(2*pow(X,2)-2*X-1);

    phi = linearInterpolate(U) & mesh.Sf();
    fvScalarMatrix SEqn
            por*fvm::ddt(S) +
            fvm::div(phi,f) ==


    valueInternalCoeffs cannot be called for a calculatedFvPatchField
    on patch fixedWalls of field f in file "/home/i/andres/Simulations/FOAM/darcy2/0/f"
    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 fields/fvPatchFields/basic/calculated/calculatedFvPatchField.C at line 145.
I am no very sure what this means. Do I need to create my own boundary condition to fulfill this? or can I define my equation in another way ?


andresbh is offline   Reply With Quote

Old   April 30, 2010, 03:57
Super Moderator
niklas's Avatar
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 22
niklas will become famous soon enoughniklas will become famous soon enough
try to replace

You cant solve implicitly for both f and S, they arent really the same fields are they?
niklas is offline   Reply With Quote


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
Linearized NS euqations: how to solve them?(problem with Matrix operations..) matteoL OpenFOAM Running, Solving & CFD 0 November 18, 2009 07:58
Using Compressible Solver (sonicFoam) to solve subsonic flows ezsoal OpenFOAM 0 October 27, 2009 10:13
Solve for two or more "Temperatures" Rui CFX 12 September 9, 2008 21:58
MAC method solve for pressure at boundry Ron Main CFD Forum 2 January 28, 2006 03:14
How to solve another continuum and momentum eqn? west_wing FLUENT 0 August 25, 2003 10:00

All times are GMT -4. The time now is 17:00.