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

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2010, 12:46
Default Solve dS_dt + div(vect(U)*f(S))=q
  #1
New Member
 
andres
Join Date: Aug 2009
Posts: 15
Rep Power: 17
andresbh is on a distinguished road
Hi
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?

Thanks

Andres
andresbh is offline   Reply With Quote

Old   April 30, 2010, 02:08
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
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.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
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, 04:44
Default Impementaiton
  #3
New Member
 
andres
Join Date: Aug 2009
Posts: 15
Rep Power: 17
andresbh is on a distinguished road
Hi Alberto,

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

Implementation:

The initial values of

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


Code:
dimensionedScalar const1
dimensionedScalar const2
from the constant directory.

The implementation reads

Code:
    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) ==
            q
        );
        solve(SEqn);
Code:
Error: 

--> FOAM FATAL ERROR: 

    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 ?

Thanks

Andres
andresbh is offline   Reply With Quote

Old   April 30, 2010, 04:57
Default
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
try to replace
fvm::div(phi,f)
with
fvc::div(phi,f)

You cant solve implicitly for both f and S, they arent really the same fields are they?
niklas 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
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 22: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 11:00


All times are GMT -4. The time now is 22:16.