CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Programming & Development (
-   -   How to solve this kind of continuity equation? (

shddx1 July 7, 2011 15:31

How to solve this kind of continuity equation?
Hi, I am a beginner of OpenFOAM. I try to use it to solve an equation in the mathematical form of:

div [sinh(|grad(phi)|)*div(phi)/|grad(phi)|] = 0

where phi is a volScalarField, |grad(phi)| is the magnitude of grad(phi), and sinh is the hyperbolic sine. I wrote the following codes, but it does not work.

volVectorField GradPhi=fvc::grad(phi);
surfaceScalarField MagGradPhi=mesh.Sf()*fvc::snGrad(phi);
surfaceScalarField SinhMagGradPhi=sinh(MagGradPhi)/MagGradPhi;
fvm::div(SinhMagGradPhi, GradPhi)

The error is: conversion from ‘Foam::tmp<Foam::GeometricField<Foam::Vector<doubl e>, Foam::fvsPatchField, Foam::surfaceMesh> >’ to non-scalar type ‘Foam::surfaceScalarField’ requested

I don’t understand this problem. Do you know how to solve above equation? Any opinion is welcome! Thanks!

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