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

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

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 29, 2010, 11:46
Default Solve dS_dt + div(vect(U)*f(S))=q
  #1
New Member
 
andres
Join Date: Aug 2009
Posts: 15
Rep Power: 7
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, 01:08
Default
  #2
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,880
Rep Power: 25
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

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
GeekoCFD 32bit - The 32bit edition of GeekoCFD.
GeekoCFD text mode - A smaller version of GeekoCFD, text-mode only, with only OpenFOAM. Available in a variety of virtual formats.
alberto is offline   Reply With Quote

Old   April 30, 2010, 03:44
Default Impementaiton
  #3
New Member
 
andres
Join Date: Aug 2009
Posts: 15
Rep Power: 7
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, 03:57
Default
  #4
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 692
Rep Power: 18
niklas 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

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 06: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 02: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 00:12.