|
[Sponsors] |
using dot products within fvOptions vectorCodedSource |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2022, 21:31 |
using dot products within fvOptions vectorCodedSource
|
#1 |
New Member
Join Date: Oct 2021
Posts: 2
Rep Power: 0 |
I am implementing marangoni convection in compressibleMultiphaseInterFoam. Modifying the source code directly works as expected by the same form does not work in with fvOptions.
Using just fvc::grad(T) works fine, but the equation needs the gradient tangential to the interface. Any ideas or help is much appreciated. Code:
FoamFile { version 2.0; format ascii; class dictionary; location "system"; object fvOptions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // MarangoniSource { type vectorCodedSource; active true; selectionMode all; fields (rho, U); name MarangoniSource; codeLibs #{ #}; codeInclude #{ #include "fvcDiv.H" #include "fvcGrad.H" #include "fvcSnGrad.H" #include "fvcFlux.H" #include "fvcMeshPhi.H" #include "surfaceInterpolate.H" #include "fvCFD.H" #include "fvc.H" #}; codeAddSup #{ vectorField& tangent_source = eqn.source(); //source will be a vector field const volScalarField& T = mesh_.lookupObject<volScalarField>("T"); const volScalarField& alpha1 = mesh_.lookupObject<volScalarField>("alpha.vapor"); const volScalarField& alpha2 = mesh_.lookupObject<volScalarField>("alpha.pentane"); const volVectorField& n =( alpha2*fvc::grad(alpha1) - alpha1*fvc::grad(alpha2) ); //normal vector to interface const volVectorField& nHat = (n /(( mag(n) ) + dimensionedScalar("tinyNumber", dimensionSet(0, -1, 0, 0, 0, 0, 0), 1e-8))); //unit normal const volVectorField& Tangent= ( mag(n)* dimensionedScalar("dSigma_dT", dimensionSet(1, 0, -2, -1, 0, 0, 0),-1e-4) * ( ( fvc::grad(T) - (nHat & fvc::grad(T)) * (nHat) //problem is here ) ) ); //end field forAll(tangent_source, i){ tangent_source[i][0] += Tangent[i][0]; tangent_source[i][1] += Tangent[i][1]; tangent_source[i][2] += Tangent[i][2]; } Pout << "*adding the tangent surface tension force*" << endl; #}; //end of addsup codeCorrect #{ #}; codeConstrain #{ #}; }//end of source // ************************************************************************* // |
|
Tags |
fvoptions momentum source, multiphase flow, surface tension |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Fixing U with vectorCodedSource via fvOptions | Tibo99 | OpenFOAM Running, Solving & CFD | 2 | January 25, 2022 11:48 |
cannot use fvOptions vectorCodedSource in parallel simulation | Sgs | OpenFOAM Running, Solving & CFD | 3 | October 13, 2020 01:36 |
Configuration of boundary conditions and fvOptions file | Raza Javed | OpenFOAM Running, Solving & CFD | 16 | May 3, 2019 17:35 |
Boundary conditions for a flame burning with wind | David | Main CFD Forum | 2 | February 4, 2005 06:59 |
chemical reaction - decompostition | La S. Hyuck | CFX | 1 | May 23, 2001 01:07 |