|
[Sponsors] |
How to add Surface Tension in cavitatingFoam solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 29, 2016, 14:24 |
How to add Surface Tension in cavitatingFoam solver
|
#1 |
New Member
Xin Tang
Join Date: Feb 2016
Location: College Station, Texas, USA
Posts: 2
Rep Power: 0 |
Dear Foamers,
I am new to OpenFoam and want to add surface tension to the cavitatingFoam solver. Is it possible to add surface tension in cavitatingFoam? [Background] I want to add surface tension term in cavitatingFoam solver to calculate collapsing cavitation (need compressible two phase solver). And I tried to implement surface tension according to interFoam solver. The new solver called cavitatingSTFoam is created and major files are attached. (The zip file of the whole solver exceeds the maxfilesize 195.3K, so I just upload the modified major files) In interFoam.C, the immiscibleIncompressibleTwoPhaseMixture.H is included and the following code is used for surface tension term: Code:
fvc::reconstruct ( ( mixture.surfaceTensionForce() ) * mesh.magSf() ) I tried to use the same continuum method to model the surface tension and add it in UEqn.H of cavitatingFoam refer to the previous thread Plotting suface tension with interFoam. New problem pops up for "interface","alpha1" and reconstruct function in "UEqn.H". error message for "interface" Code:
createFields.H: In function ‘int main(int, char**)’: createFields.H:78:44: error: ‘interface’ was not declared in this scope fvc::reconstruct((fvc::interpolate(interface.sigmaK())*fvc::snGrad(alphal))* mesh.magSf()) Code:
cavitatingSTFoam.C:100:55: error: ‘alpha1’ was not declared in this scope f = fvc::interpolate(interface.sigmaK())*fvc::snGrad(alpha1); Code:
In file included from cavitatingSTFoam.C:86:0: UEqn.H:39:14: error: no matching function for call to ‘reconstruct(Foam::tmp<Foam::Field<Foam::Vector<double> > >)’ ) ^ UEqn.H:39:14: note: candidates are: In file included from /opt/openfoam240/src/finiteVolume/lnInclude/fvcReconstruct.H:85:0, from /opt/openfoam240/src/finiteVolume/lnInclude/fvc.H:43, from /opt/openfoam240/src/finiteVolume/lnInclude/fvCFD.H:8, from cavitatingSTFoam.C:35: /opt/openfoam240/src/finiteVolume/lnInclude/fvcReconstruct.C:53:1: note: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::reconstruct(const Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>&) reconstruct ^ /opt/openfoam240/src/finiteVolume/lnInclude/fvcReconstruct.C:53:1: note: template argument deduction/substitution failed: In file included from cavitatingSTFoam.C:86:0: UEqn.H:39:14: note: ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’ is not derived from ‘const Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>’ ) ^ In file included from /opt/openfoam240/src/finiteVolume/lnInclude/fvcReconstruct.H:85:0, from /opt/openfoam240/src/finiteVolume/lnInclude/fvc.H:43, from /opt/openfoam240/src/finiteVolume/lnInclude/fvCFD.H:8, from cavitatingSTFoam.C:35: /opt/openfoam240/src/finiteVolume/lnInclude/fvcReconstruct.C:95:1: note: template<class Type> Foam::tmp<Foam::GeometricField<typename Foam::outerProduct<Foam::Vector<double>, Type>::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::reconstruct(const Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >&) reconstruct ^ /opt/openfoam240/src/finiteVolume/lnInclude/fvcReconstruct.C:95:1: note: template argument deduction/substitution failed: In file included from cavitatingSTFoam.C:86:0: UEqn.H:39:14: note: mismatched types ‘Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh>’ and ‘Foam::Field<Foam::Vector<double> >’ ) ^ UEqn.H:39:14: note: ‘Foam::tmp<Foam::Field<Foam::Vector<double> > >’ is not derived from ‘const Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> >’ Thanks for your time,any help and advice is appreciated! Last edited by jamestangx; March 29, 2016 at 23:34. Reason: English statements |
|
April 6, 2016, 17:39 |
Surface Tension Added
|
#2 |
New Member
Xin Tang
Join Date: Feb 2016
Location: College Station, Texas, USA
Posts: 2
Rep Power: 0 |
I finally added the surface tension term successfully by trial and error. I will share with everyone in case you met the same problem.
error message for "interface" I included the following header files compared to OpenFoam 2.1 interFoam solver in my solver source code Code:
// imported from interFoam 2.1 #include "interfaceProperties.H" #include "twoPhaseMixture.H" in createFields.H file, there is declarators for alphav, alphal. I don't know why it does not work with alpha1, however, when I change alpha1 ->alphal, the solver can be wmake sucessfully. Code:
incompressibleTwoPhaseMixture mixture(U, phi); volScalarField& alphav(mixture.alpha1()); alphav.oldTime(); volScalarField& alphal(mixture.alpha2()); Also in "creatFields.H", the following codes should be added. And call the function of interface from "interfaceProperties.H" Code:
// surface tension force is the same to the previous thread plotting surface tension with interFoam // Construct interface from alphal distribution interfaceProperties interface(alphal, U, mixture); volVectorField f ( IOobject ( "f", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), fvc::reconstruct((fvc::interpolate(interface.sigmaK())*fvc::snGrad(alphal))* mesh.magSf()) ); Last edited by jamestangx; April 6, 2016 at 23:32. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help!! customize surface tension term in interFoam | w051cxw | OpenFOAM Programming & Development | 5 | February 12, 2016 15:56 |
[Gmsh] Error : Self intersecting surface mesh, computing intersections & Error : Impossible | velan | OpenFOAM Meshing & Mesh Conversion | 3 | October 22, 2015 12:05 |
[Gmsh] Problem with Gmsh | nishant_hull | OpenFOAM Meshing & Mesh Conversion | 23 | August 5, 2015 03:09 |
VOF +surface tension force modeling+ open channel flow+cyclic region= fatal error? | SJSW | Fluent Multiphase | 2 | November 18, 2014 05:15 |
Surface Tension Test Cases | sega | OpenFOAM Running, Solving & CFD | 2 | March 8, 2011 13:19 |