
[Sponsors] 
Solve continuity equation for one dimensional mesh motion velocity. Need derivative i 

LinkBack  Thread Tools  Search this Thread  Display Modes 
February 5, 2024, 11:30 
Solve continuity equation for one dimensional mesh motion velocity. ddz derivative

#1 
New Member
Join Date: Jan 2024
Posts: 8
Rep Power: 2 
Hello everyone,
I am trying to model a fluid to solid phase change with mesh motion caused by the phase change. Now the Mesh deforms with the velocity , but only in z direction. Therefore it should be mathematically possible to solve the following continuity equation for : where = volume fraction of solid = density of liquid solution = density of solid = fluid velocity without Mesh velocity Now I can not solve this scalar Equation for a vector, but since only the zcomponent of can be nonzero, I can write it like this: Mathematically that should make sense, but I lack the OpenFoam tools and knowledge to solve this in my program. Since there is no fvm::ddz method. I know that I can get the derivation of the zcomponent in the z direction by using: Code:
volScalarField Umz = Um.component(2); volVectorField gradUmz = fvc::grad(Umz); volScalarField gradUmzz = gradUmz.component(2); What I also tried was defining an alphaz vector field, which is 0 in his x and y component and has the alpha values in the z component. I calculated the dot product with the face normals, the same way phi gets calculated, to get a surfaceScalarField, and tried to solve for Umz. This is how it looks: Code:
forAll(alphaz,i) { alphaz[i].component(2) = alphaice[i]; } forAll(alphaz.boundaryField(), patchI) { forAll(alphaz.boundaryField()[patchI], faceI) { alphaz.boundaryFieldRef()[patchI][faceI].component(2) = alphaice.boundaryField()[patchI][faceI]; } } surfaceScalarField surfacealphaz ( IOobject ( "phialphaz", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), linearInterpolate(alphaz) & mesh.Sf() ); tmp<fvScalarMatrix> tUmEqn ( fvc::ddt(rhomix,alphawater) + rhoice*fvc::ddt(alphaice) + fvc::div(rhomixUrel) + rhoice*fvm::div(surfacealphaz,Umz) ); #0 Foam::error::printStack(Foam::Ostream&) at ??:? #1 Foam::sigFpe::sigHandler(int) at ??:? #2 ? in "/lib/x86_64linuxgnu/libc.so.6" #3 Foam::symGaussSeidelSmoother::smooth(Foam::word const&, Foam::Field<double>&, Foam::lduMatrix const&, Foam::Field<double> const&, Foam::FieldField<Foam::Fie I suppose my method is not very physical, hence a lot of problems occurr. If anyone knows, how to incorporate a derivative in only one direction of space in the solver Matrix, that would be great. Any help would be appreciated. Thank you Last edited by danylo; February 6, 2024 at 03:17. 

February 13, 2024, 05:09 
Any ideas?

#2 
New Member
Join Date: Jan 2024
Posts: 8
Rep Power: 2 
Does anyone have any idea how i could solve this issue? I did not make any progress yet
Thank you 

February 22, 2024, 05:01 

#3 
New Member
Join Date: Jan 2024
Posts: 8
Rep Power: 2 
Update:
I can get the code for the alphaz surfaceScalarField to run but I get nonsense values. Problem was that alphaice was 0 at the start, and so it was impossible to solve for Um. I set alphaice to a small starting value, but the value Um just spirals out of control up to extremely high values. 

Tags 
continuity, differentiation, equation, onedimension, solve error 
Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
SU27.0.1 on ubuntu 18.04  hyunko  SU2 Installation  7  March 16, 2020 04:37 
Difficulty in calculating angular velocity of Savonius turbine simulation  alfaruk  CFX  14  March 17, 2017 06:08 
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3  bookie56  OpenFOAM Installation  8  August 13, 2011 04:03 
continuity equation  Rafal  Main CFD Forum  4  November 29, 2006 09:27 
Could anybody help me see this error and give help  liugx212  OpenFOAM Running, Solving & CFD  3  January 4, 2006 18:07 